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

# Update a File

> Update a file. Only the owner can update. Fields are optional: an absent
 field is left unchanged, an empty value clears it.



## OpenAPI

````yaml PATCH /v1/files/{id}
openapi: 3.1.0
info:
  title: Stashy API
  version: 1.0.0
servers:
  - url: https://stashy.example.com
    description: Your Stashy instance
security:
  - BearerAuth: []
paths:
  /v1/files/{id}:
    patch:
      summary: UpdateFile
      description: |-
        Update a file. Only the owner can update. Fields are optional: an absent
         field is left unchanged, an empty value clears it.
      operationId: StorageService_UpdateFile
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            title: id
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                slug:
                  type:
                    - string
                    - 'null'
                  title: slug
                  maxLength: 128
                  pattern: ^[A-Za-z0-9._~-]*$
                  description: >-
                    Human-readable slug used in the file's canonical URL
                    (/{id}/{slug}).
                     An empty string clears it.
              title: UpdateFileRequest
              additionalProperties: false
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/stashy.v1alpha1.UpdateFileResponse'
components:
  schemas:
    stashy.v1alpha1.UpdateFileResponse:
      type: object
      properties:
        url:
          type: string
          title: url
          format: uri
          description: Canonical URL of the file after the update.
      title: UpdateFileResponse
      additionalProperties: false
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: opaque

````