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

# Register a file upload

> Registers an image or video in the org's file library and returns a presigned S3 URL to upload the bytes to. PUT the raw file to upload_url with the declared Content-Type and Content-Length headers before the URL expires, then call the complete endpoint to make it ready. The registered file has source=upload. Uploads are capped per file and per org by total size.



## OpenAPI

````yaml /api-reference/openapi-backend.json post /files
openapi: 3.1.0
info:
  description: Axilio backend HTTP API.
  title: Axilio API
  version: 0.85.0
servers:
  - url: https://api.axilio.ai/api/v1
    description: Production
security: []
tags:
  - name: API Keys
  - name: Billing
  - name: Files
  - name: Organization
  - name: Phones
  - name: Runs
  - name: Skill
  - name: Usage
  - name: Workflows
paths:
  /files:
    post:
      tags:
        - Files
      summary: Register a file upload
      description: >-
        Registers an image or video in the org's file library and returns a
        presigned S3 URL to upload the bytes to. PUT the raw file to upload_url
        with the declared Content-Type and Content-Length headers before the URL
        expires, then call the complete endpoint to make it ready. The
        registered file has source=upload. Uploads are capped per file and per
        org by total size.
      operationId: files_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FileCreateRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileUploadResponse'
          description: Created
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/V2ErrorModel'
          description: Error
      security:
        - apiKeyAuth: []
components:
  schemas:
    FileCreateRequest:
      additionalProperties: false
      description: Registers an upload and requests a presigned PUT URL.
      properties:
        filename:
          description: Display name for the file (also its name on the phone).
          maxLength: 255
          minLength: 1
          type: string
        mime_type:
          description: MIME type of the upload; must be an allowed image or video type.
          minLength: 1
          type: string
        size_bytes:
          description: >-
            Exact size of the upload in bytes, up to 100 MiB (the phone-delivery
            ceiling); the presigned URL pins it.
          format: int64
          maximum: 104857600
          minimum: 1
          type: integer
      required:
        - filename
        - mime_type
        - size_bytes
      type: object
    FileUploadResponse:
      additionalProperties: false
      description: The registered file and its presigned upload URL.
      properties:
        file:
          $ref: '#/components/schemas/FileSummary'
          description: The registered library entry.
        upload_expires_in_seconds:
          description: How long the upload URL stays valid.
          format: int64
          type: integer
        upload_url:
          description: >-
            Presigned S3 PUT URL. PUT the raw file bytes to it with the declared
            Content-Type and Content-Length headers.
          type: string
      required:
        - file
        - upload_url
        - upload_expires_in_seconds
      type: object
    V2ErrorModel:
      additionalProperties: false
      description: >-
        Error response, following RFC 9457 (Problem Details for HTTP APIs).
        Returned with a application/problem+json content type.
      properties:
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/V2ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
      type: object
    FileSummary:
      additionalProperties: false
      description: One file in the org's library.
      properties:
        attachment_url:
          description: >-
            Short-lived signed URL that downloads the file as an attachment
            under its name. Present only for ready files.
          type: string
        bytes_transferred:
          description: >-
            Bytes moved so far for an in-flight phone transfer. Absent until the
            phone reports progress.
          format: int64
          type: integer
        capture_error:
          description: Reason the capture failed, when it did. Present only for captures.
          type: string
        capture_state:
          description: >-
            Capture lifecycle: detected/uploading while in flight, ready when
            usable, or a terminal skip/failure with its reason. Present only for
            captures.
          enum:
            - detected
            - uploading
            - ready
            - skipped_size
            - skipped_quota
            - skipped_type
            - dropped_teardown
            - failed
          type: string
        checksum:
          description: >-
            SHA-256 of the bytes, computed on the phone during a capture upload.
            Present only for captures.
          type: string
        created_at:
          description: >-
            When the file was registered: upload registration, or capture
            detection.
          format: date-time
          type: string
        download_url:
          description: >-
            Short-lived signed URL to read the file's bytes. Present only for
            ready files; re-list to refresh an expired one.
          type: string
        duration_seconds:
          description: Video duration in seconds.
          format: int64
          type: integer
        filename:
          description: >-
            Original filename; used as the display name when the file lands on a
            phone.
          type: string
        height:
          description: Intrinsic pixel height of the source.
          format: int64
          type: integer
        id:
          description: >-
            File identifier. Unique across the whole library; deliverable to a
            phone regardless of source.
          type: string
        mime_type:
          description: Declared MIME type, pinned by the presigned upload.
          type: string
        on_phone_count:
          description: >-
            Distinct phones currently holding or receiving a copy. Deleting the
            file recalls these.
          format: int64
          type: integer
        preview_state:
          description: >-
            Whether the preview exists, is still being generated, or will never
            be available for this format.
          enum:
            - processing
            - ready
            - unavailable
          type: string
        reel_url:
          description: >-
            Short-lived signed URL for the animated hover preview. Videos only;
            absent until generated.
          type: string
        session_id:
          description: Session that produced the file. Present only for captures.
          type: string
        size_bytes:
          description: Declared size in bytes, pinned by the presigned upload.
          format: int64
          type: integer
        source:
          description: >-
            How the file entered the library: upload (put in directly) or
            capture (lifted off a session).
          enum:
            - upload
            - capture
          type: string
        status:
          description: >-
            uploading until the object is verified in storage, then ready. For a
            capture, read capture_state for the fuller lifecycle.
          enum:
            - uploading
            - ready
          type: string
        surface:
          description: >-
            Which surface a capture came off (phone today). Absent for a direct
            upload.
          enum:
            - phone
          type: string
        thumbnail_url:
          description: >-
            Short-lived signed URL for the generated preview image. Absent while
            generation is pending, and permanently absent for formats without a
            preview.
          type: string
        width:
          description: Intrinsic pixel width of the source.
          format: int64
          type: integer
      required:
        - id
        - source
        - filename
        - mime_type
        - size_bytes
        - status
        - created_at
        - on_phone_count
        - preview_state
      type: object
    V2ErrorDetail:
      additionalProperties: false
      description: >-
        One specific problem within an error response, locating the offending
        part of the request.
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
  securitySchemes:
    apiKeyAuth:
      description: Customer API key (axl_ prefix).
      in: header
      name: X-Axilio-Api-Key
      type: apiKey

````

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