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

# Upload File

> Endpoint to upload a single file



## OpenAPI

````yaml api-reference/file-upload/file-upload-openapi.json post /upload
openapi: 3.0.1
info:
  title: File Upload API
  description: API for handling file uploads
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api-staging.reporta.ng/api/v1/
security: []
paths:
  /upload:
    post:
      summary: Upload a file
      description: Endpoint to upload a single file
      operationId: uploadFile
      requestBody:
        description: File to upload
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: The file to upload
              required:
                - file
        required: true
      responses:
        '200':
          description: File uploaded successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadResponse'
                type: object
        '400':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: File too large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    UploadResponse:
      type: object
      required:
        - success
        - message
        - data
      properties:
        success:
          type: boolean
          description: Indicates if the upload was successful
        message:
          type: string
          description: Response message
        data:
          type: object
          properties:
            id:
              type: string
              description: Unique identifier for the uploaded file
            url:
              type: string
              description: URL to access the uploaded file
          required:
            - id
            - url
    Error:
      required:
        - success
        - message
        - data
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          description: Error message
        data:
          type: object
          nullable: true
          example: null

````