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

# Upload a file

> API for uploading a file. The uploaded file is stored in the system, and a unique file token is returned in response. Use this token when attaching files to tickets or when submitting requested data.



## OpenAPI

````yaml /.openapi/v3/support/openapi.yaml post /dsf/files
openapi: 3.1.0
info:
  title: Support API [BETA]
  version: 3.0.0
  contact:
    name: Sendcloud API Support
    url: https://www.sendcloud.dev
    email: contact@sendcloud.com
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  description: >-
    The Sendcloud Support API lets you create support tickets easily and
    efficiently. This API can be used in conjunction with other core Sendcloud
    features or independently.
servers:
  - url: https://panel.sendcloud.sc/api/v3
    description: Sendcloud Production
security: []
tags:
  - name: Support
    description: Sendcloud's Support API
  - name: File upload
  - name: Carrier support contacts
  - name: Create ticket
  - name: Documents
  - name: Requested data
paths:
  /dsf/files:
    post:
      tags:
        - File upload
      summary: Upload a file
      description: >-
        API for uploading a file. The uploaded file is stored in the system, and
        a unique file token is returned in response. Use this token when
        attaching files to tickets or when submitting requested data.
      operationId: sc-public-v3-dsf-post-files
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/FileUploadRequest'
        required: true
      responses:
        '201':
          $ref: '#/components/responses/FilesCreated'
        '400':
          $ref: '#/components/responses/FilesBadRequest'
        '413':
          $ref: '#/components/responses/FilesPayloadTooLarge'
        '422':
          $ref: '#/components/responses/FilesUnprocessableContent'
        '429':
          $ref: '#/components/responses/FileUploadRateLimitExceededResponse'
      security:
        - HTTPBasicAuth: []
        - OAuth2ClientCreds: []
components:
  schemas:
    FileUploadRequest:
      title: File upload request
      type: object
      properties:
        file:
          title: File
          type: string
          format: binary
      required:
        - file
    ErrorsResponseSchema:
      description: Support API error response.
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              code:
                title: Error code
                type: string
              detail:
                title: Error description
                type: string
              title:
                title: Error title
                type: string
              status:
                title: HTTP status code
                type: integer
      required:
        - errors
  responses:
    FilesCreated:
      description: Created
      content:
        application/json:
          schema:
            type: object
            properties:
              file_token:
                type: string
            required:
              - file_token
          example:
            file_token: >-
              b90e7a70-57c6-4338-992a-eae50d637261-6170706c69636174696f6e2f706466
    FilesBadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorsResponseSchema'
          examples:
            File is missing:
              value:
                errors:
                  - code: bad_request
                    detail: '`file` form field is required'
                    title: Bad Request
                    status: 400
    FilesPayloadTooLarge:
      description: File is too large.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorsResponseSchema'
          examples:
            File is too large:
              value:
                errors:
                  - code: content_too_large
                    detail: File is too large.
                    title: Content Too Large
                    status: 413
    FilesUnprocessableContent:
      description: Non file object
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorsResponseSchema'
          examples:
            Non file object:
              value:
                errors:
                  - code: unprocessable_content
                    detail: '`file` field must contain a file object.'
                    title: Unprocessable Content
                    status: 422
    FileUploadRateLimitExceededResponse:
      description: Rate limit exceeded. File uploads are limited to 30 requests per minute.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorsResponseSchema'
          example:
            errors:
              - code: hit_rate_limit
                detail: 'Rate limit exceeded: 30 per 1 minute'
                title: Rate limit exceeded
                status: 429
  securitySchemes:
    HTTPBasicAuth:
      type: http
      description: >-
        Basic Authentication using API key and secrets is currently the main
        authentication mechanism.
      scheme: basic
    OAuth2ClientCreds:
      type: oauth2
      description: >-
        OAuth2 is a standardized protocol for authorization that allows users to
        share their private resources stored on one site with another site
        without having to provide their credentials. OAuth2 Client Credentials
        Grant workflow. This workflow is typically used for server-to-server
        interactions that require authorization to access specific resources.
      flows:
        clientCredentials:
          tokenUrl: https://account.sendcloud.com/oauth2/token/
          scopes:
            api: Default OAuth scope required to access Sendcloud API.

````