> ## Documentation Index
> Fetch the complete documentation index at: https://autorender.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Rename file

> Change a file display name; server may normalize extension.

<RequestExample>
  ```bash cURL theme={null}
  curl --request PATCH \
    --url 'https://upload.autorender.io/api/v1/files/2338045312/rename' \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "name": "demo"
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "974628c2-9b55-4ce4-adf1-9b63edff6baa",
    "file_no": "2338045312",
    "name": "demo.png",
    "folder_id": null,
    "path": null,
    "url": "FWA7PWC7LZ/demo.png",
    "original_url": null,
    "workspace_id": "4328e3bf-8252-4f07-a0ec-b3265ffe1552",
    "workspace_no": "FWA7PWC7LZ",
    "height": 910,
    "width": 1849,
    "format": "png",
    "file_size": 194141,
    "is_delete": false,
    "is_active": true,
    "created_by": "27d7fa01-2cd1-4326-9f56-015af7df06e1",
    "meta_data": {
      "size": 194141,
      "width": 1849,
      "format": "image/png",
      "height": 910,
      "orientation": null
    },
    "created_at": "2026-03-27T14:56:20.511Z",
    "updated_at": "2026-03-27T17:55:05.675Z",
    "transform_string": null,
    "source": "app",
    "is_default": false,
    "orientation": "square",
    "extension": "image"
  }
  ```

  ```json 404 theme={null}
  {
    "error": "File with ID File not found or access denied not found",
    "code": "FILE_NOT_FOUND"
  }
  ```

  ```json 401 theme={null}
  {
    "success": false,
    "error": "Unauthorized",
    "message": "Invalid or missing API key"
  }
  ```
</ResponseExample>

## Overview

Updates a file's display name. Send the new base name as `name` in JSON; the server keeps or appends the correct extension (e.g. `"demo"` becomes `"demo.png"`).

## Request body

| Field  | Type   | Required | Description                                          |
| ------ | ------ | -------- | ---------------------------------------------------- |
| `name` | string | Yes      | New name (extension may be normalized by the server) |

## Success body

Returns the updated file record — fields such as `id`, `file_no`, `name`, `url`, `workspace_no`, `meta_data`, and timestamps.

## Next steps

<CardGroup cols={2}>
  <Card title="File details" icon="circle-info" iconType="solid" href="/docs/api-reference/get-file-details">
    Fetch the full metadata for the renamed file.
  </Card>

  <Card title="Delete file" icon="trash" iconType="solid" href="/docs/api-reference/delete-file">
    Permanently remove a file from your workspace.
  </Card>
</CardGroup>


## OpenAPI

````yaml api-reference/openapi.json PATCH /api/v1/files/{fileNo}/rename
openapi: 3.0.0
info:
  title: AutoRender Public API
  description: >-
    REST API for uploading, managing, and serving media assets. All endpoints
    require an API key via the x-api-key header or Authorization: Bearer <key>.
  version: 1.0.0
  contact:
    name: AutoRender Support
    email: support@autorender.io
servers:
  - url: https://app-api.autorender.io
    description: Production server
security:
  - apiKey: []
tags:
  - name: Uploads
    description: Upload endpoints (API key required)
  - name: Files
    description: File management endpoints (API key required)
  - name: Folders
    description: Folder management endpoints (API key required)
paths:
  /api/v1/files/{fileNo}/rename:
    patch:
      tags:
        - Files
      summary: Rename file
      operationId: renameFile
      parameters:
        - schema:
            type: string
          in: path
          name: fileNo
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: New file name without extension or path separators
              required:
                - name
      responses:
        '200':
          description: Renamed file
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      file_no:
                        type: string
                      name:
                        type: string
                      path:
                        type: string
                      url:
                        type: string
                      width:
                        nullable: true
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      height:
                        nullable: true
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      size:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      format:
                        nullable: true
                        type: string
                      mime_type:
                        type: string
                      tags:
                        type: array
                        items:
                          type: string
                      metadata:
                        nullable: true
                        type: object
                        additionalProperties:
                          x-stainless-any: true
                      folder_no:
                        nullable: true
                        type: string
                      folder_name:
                        nullable: true
                        type: string
                      source:
                        type: string
                      created_at:
                        type: string
                        format: date-time
                        pattern: >-
                          ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                      updated_at:
                        nullable: true
                        type: string
                        format: date-time
                        pattern: >-
                          ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                    required:
                      - id
                      - file_no
                      - name
                      - path
                      - url
                      - width
                      - height
                      - size
                      - format
                      - mime_type
                      - tags
                      - metadata
                      - folder_no
                      - folder_name
                      - source
                      - created_at
                      - updated_at
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
                description: Renamed file
        '400':
          description: Invalid payload
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
                description: Invalid payload
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                  - error
                  - message
                additionalProperties: false
                description: Unauthorized
        '404':
          description: File not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
                description: File not found
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                  retryAfterSeconds:
                    type: number
                required:
                  - error
                  - message
                additionalProperties: false
                description: Rate limit exceeded
        '503':
          description: Limit service unavailable
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
                description: Limit service unavailable
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: apiKey
      name: x-api-key
      in: header
      description: >-
        API key for public endpoints. Can also be provided via Authorization:
        Bearer <key>

````