> ## 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.

# Mark an upload complete

> Call after PUTting the bytes to the upload URL. Verifies the object landed at the declared size and type, checks the content really is the media it claims to be, and moves the file to ready so it can be delivered. Idempotent: completing an already-ready file just returns it. Applies to source=upload files; a captured file finalizes on its own from the phone's report.



## OpenAPI

````yaml /api-reference/openapi-backend.json post /files/{file_id}/complete
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/{file_id}/complete:
    post:
      tags:
        - Files
      summary: Mark an upload complete
      description: >-
        Call after PUTting the bytes to the upload URL. Verifies the object
        landed at the declared size and type, checks the content really is the
        media it claims to be, and moves the file to ready so it can be
        delivered. Idempotent: completing an already-ready file just returns it.
        Applies to source=upload files; a captured file finalizes on its own
        from the phone's report.
      operationId: files_complete
      parameters:
        - description: file identifier to finalize
          in: path
          name: file_id
          required: true
          schema:
            description: file identifier to finalize
            format: uuid
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompleteFileOutputBody'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/V2ErrorModel'
          description: Error
      security:
        - apiKeyAuth: []
components:
  schemas:
    CompleteFileOutputBody:
      additionalProperties: false
      properties:
        file:
          $ref: '#/components/schemas/FileSummary'
          description: The finalized library entry, now ready.
      required:
        - file
      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.