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

# Rename File or Directory

> Rename or move a file or directory.



## OpenAPI

````yaml /sprites/api/openapi.json post /v1/sprites/{name}/fs/rename
openapi: 3.1.0
info:
  title: Sprites API
  version: 0.1.12
  x-sprite-env-version: v0.0.1-rc48
servers:
  - url: https://api.sprites.dev
security: []
paths:
  /v1/sprites/{name}/fs/rename:
    post:
      tags:
        - Filesystem
      summary: Rename File or Directory
      description: Rename or move a file or directory.
      operationId: sprite_env_rename__file_or__directory
      parameters:
        - in: path
          name: name
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RenameRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RenameResponse'
          description: Success
        '400':
          description: Bad Request - Invalid request body
        '404':
          description: Not Found - Resource not found
        '500':
          description: Internal Server Error
      security:
        - bearerAuth: []
components:
  schemas:
    RenameRequest:
      properties:
        asRoot:
          type: boolean
        dest:
          type: string
        source:
          type: string
        workingDir:
          type: string
      required:
        - source
        - dest
        - workingDir
        - asRoot
      type: object
    RenameResponse:
      properties:
        dest:
          type: string
        source:
          type: string
      required:
        - source
        - dest
      type: object
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````