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

# Finalize a direct file upload

> Final (third) step of the direct file-upload flow. Confirms the file
was uploaded to S3 and records it. Call this with the `fileId` from
`/api/files/upload-url` after the `multipart/form-data` POST to the
presigned `url` succeeded. Returns the file's download URL.




## OpenAPI

````yaml /openapi.yaml post /api/files/upload-complete
openapi: 3.0.3
info:
  title: Aptly API
  version: '1.0'
  description: >
    The Aptly API lets you read and write cards on any Aptly board from external
    systems.


    All requests require an API key passed as the `x-token` header.

    API keys are scoped to your company and work across all boards.
servers:
  - url: https://core-api.getaptly.com
    description: Production
security:
  - ApiKeyHeader: []
paths:
  /api/files/upload-complete:
    post:
      tags:
        - Files
      summary: Finalize a direct file upload
      description: |
        Final (third) step of the direct file-upload flow. Confirms the file
        was uploaded to S3 and records it. Call this with the `fileId` from
        `/api/files/upload-url` after the `multipart/form-data` POST to the
        presigned `url` succeeded. Returns the file's download URL.
      operationId: completeFileUpload
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - fileId
              properties:
                fileId:
                  type: string
                  description: The `fileId` returned by `/api/files/upload-url`.
      responses:
        '200':
          description: Upload finalized.
          content:
            application/json:
              schema:
                type: object
                properties:
                  fileId:
                    type: string
                    description: ID of the stored file.
                  url:
                    type: string
                    description: Download URL for the stored file.
        '400':
          description: Missing fileId or the upload was already completed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid or missing credential.
        '404':
          description: No pending upload found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyHeader: []
        - DelegateToken: []
        - PartnerBearer: []
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: x-token
    DelegateToken:
      type: apiKey
      in: header
      name: Authorization
      description: 'Delegate token issued by the platform. Format: `DelegateToken <token>`'
    PartnerBearer:
      type: http
      scheme: bearer
      description: 'Partner token. Format: `Authorization: Bearer <token>`'

````