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

# Upload A File

> Upload a file to UQPAY. The maximum size of the upload file is up to `20MB`. Supported file types include `jpeg`, `png`, `jpg`, `doc`, `docx`, `pdf`. When you upload a file, the API responds with a file_id. This file ID can then be referenced as required as part of the attachments object in our other endpoints.



## OpenAPI

````yaml /account-center/v1.6/supporting.yaml post /v1/files/upload
openapi: 3.0.2
info:
  version: 0.0.1
  title: Supporting Services
servers:
  - url: https://files.uqpaytech.com/api
    description: Sandbox base URL.
  - url: https://files.uqpay.com/api
    description: Production base URL.
security: []
tags:
  - name: File Service
paths:
  /v1/files/upload:
    post:
      tags:
        - File Service
      summary: Upload A File
      description: >-
        Upload a file to UQPAY. The maximum size of the upload file is up to
        `20MB`. Supported file types include `jpeg`, `png`, `jpg`, `doc`,
        `docx`, `pdf`. When you upload a file, the API responds with a file_id.
        This file ID can then be referenced as required as part of the
        attachments object in our other endpoints.
      operationId: upload-file
      parameters:
        - $ref: '#/components/parameters/XOnBehalfOf'
        - $ref: '#/components/parameters/XIdempotencyKey'
        - $ref: '#/components/parameters/Notes'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              properties:
                file:
                  type: string
                  format: binary
      responses:
        '200':
          description: OK - Successfully uploaded a file.
          headers:
            x-response-id:
              $ref: '#/components/headers/XResponseId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadFileResponse'
                title: UploadFileResponse
      security:
        - XAuthToken: []
components:
  parameters:
    XOnBehalfOf:
      in: header
      name: x-on-behalf-of
      schema:
        type: string
      required: false
      description: >-
        The value set to the connected account's ID. More information at [List
        Connected
        Accounts](/account-center/v1.6/api-reference/list-connected-accounts)
      example: 18523f72-f4de-4f9c-bb8e-ec7d1c4f32be
    XIdempotencyKey:
      in: header
      name: x-idempotency-key
      schema:
        type: string
        format: uuid
      required: true
      description: >-
        A unique identifier (UUID) used to maintain operation idempotency,
        ensuring that repeated executions of the same operation do not result in
        unintended effects or duplication. It helps preserve data consistency in
        the face of network errors, retries, or failures.
      example: 2adesf8e-9d63-44bc-b975-9b6ae3440dde
    Notes:
      name: notes
      description: The notes of the uploaded file, max length is 50 characters
      in: query
      required: false
      schema:
        type: string
        maxLength: 50
  headers:
    XResponseId:
      description: >-
        Universally unique identifier (UUID v4) for the response. Helpful for
        identifying a request when communicating with UQPAY support.
      schema:
        type: string
        format: uuid
        example: 2adba88e-9d63-44bc-b975-9b6ae3440dde
  schemas:
    UploadFileResponse:
      type: object
      required:
        - create_time
        - file_id
        - file_name
        - file_type
        - size
        - notes
      properties:
        create_time:
          type: string
          description: Timestamp when the file was uploaded.
          example: '2024-08-22T17:12:58+08:00'
        file_id:
          type: string
          description: >-
            Unique identifier for the uploaded file. Use this ID to reference
            the file in other API calls.
          example: b3d9d2d5-4c12-4946-a09d-953e82sed2b0
        file_name:
          type: string
          description: Original name of the uploaded file including extension.
          example: example.png
        file_type:
          type: string
          description: File extension type (e.g., `png`, `pdf`, `docx`).
          example: png
        size:
          type: integer
          description: File size in bytes.
          example: 123456
        notes:
          type: string
          description: Optional notes associated with the file.
          example: This is a note
  securitySchemes:
    XAuthToken:
      type: apiKey
      in: header
      name: x-auth-token
      description: Token used to request APIs

````