> ## 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.

# Replace a File

> Replace the content of an existing file. Only the owner can update.



## OpenAPI

````yaml PUT /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}:
    put:
      summary: ReplaceFile
      description: Replace the content of an existing file. Only the owner can update.
      operationId: StorageService_ReplaceFile
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            title: id
      requestBody:
        content:
          '*/*':
            schema:
              type: string
              format: binary
        required: false
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/stashy.v1alpha1.ReplaceFileResponse'
components:
  schemas:
    stashy.v1alpha1.ReplaceFileResponse:
      type: object
      title: ReplaceFileResponse
      additionalProperties: false
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: opaque

````