> ## 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 File Content

> Update a file's content, replacing it entirely. Its ID and URL stay the
 same.



## OpenAPI

````yaml PUT /v1/files/{id}/content
openapi: 3.1.0
info:
  title: Stashy API
  description: API documentation for Stashy API
  version: 1.0.0
servers:
  - url: https://stashy.example.com
    description: Your Stashy instance
security:
  - BearerAuth: []
paths:
  /v1/files/{id}/content:
    put:
      summary: UpdateFileContent
      description: |-
        Update a file's content, replacing it entirely. Its ID and URL stay the
         same.
      operationId: FileService_UpdateFileContent
      parameters:
        - name: id
          in: path
          description: The id path parameter.
          required: true
          schema:
            type: string
            title: id
            pattern: ^[A-Za-z0-9_-]{21}$
      requestBody:
        content:
          '*/*':
            schema:
              type: string
              format: binary
        required: false
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/stashy.v1.File'
                title: file
components:
  schemas:
    stashy.v1.File:
      type: object
      properties:
        id:
          type: string
          title: id
          pattern: ^[A-Za-z0-9_-]{21}$
          description: Unique file ID.
        slug:
          type: string
          title: slug
          maxLength: 128
          pattern: ^[A-Za-z0-9._~-]*$
          description: Human-readable name at the end of the URL. Empty when not set.
        url:
          type: string
          title: url
          format: uri
          description: Canonical URL of the file, including the slug when set.
        name:
          type: string
          title: name
          maxLength: 255
          pattern: ^[^/\x00-\x1F\x7F]*$
          description: Original filename, e.g. "Quarterly report.pdf". Empty when not set.
        content_type:
          type: string
          title: content_type
          description: Media type of the content, from the Content-Type of the upload.
        size:
          type: string
          title: size
          minimum: 0
          format: int64
          description: Size of the content in bytes.
        checksum:
          type: string
          title: checksum
          pattern: ^([A-Za-z0-9+/]{6}==)?$
          description: CRC32C checksum of the content.
        visibility:
          type: string
          title: visibility
          enum:
            - private
            - internal
            - public
          description: >-
            Who can open the file by its URL: "private" (only the owner),
            "internal"
             (any signed-in user), or "public" (anyone).
        created_at:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: created_at
        updated_at:
          allOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: updated_at
      title: File
      required:
        - id
        - slug
        - url
        - name
        - content_type
        - size
        - checksum
        - visibility
        - created_at
        - updated_at
      additionalProperties: false
    google.protobuf.Timestamp:
      type: string
      examples:
        - '2023-01-15T01:30:15.01Z'
        - '2024-12-25T12:00:00Z'
      format: date-time
      description: >-
        A point in time in RFC 3339 format, with up to nanosecond precision.
        Output uses UTC (`Z`); input may use an offset from UTC.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: opaque

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.