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

# Upload a document

> Start uploading a document a beneficiary in review waits for (listed in its
`requiredActions`). Returns a presigned upload: POST the file to `upload.url`
as `multipart/form-data`, with every field of `upload.fields` first and the
file as a `file` part last. The upload must use the declared `contentType`,
stay under 20 MB, and happen before `expiresAt`. Then call
`POST /v1/beneficiaries/{beneficiaryId}/documents/{documentId}/complete`.
Up to 5 documents.



## OpenAPI

````yaml POST /v1/beneficiaries/{beneficiaryId}/documents
openapi: 3.0.0
info:
  title: nxos API
  version: 1.0.0
  contact:
    name: nxos
    url: https://nxos.io
  description: |-
    The nxos platform API provides programmatic access to accounts, balances,
    quotes, and trades. All endpoints require API key authentication.
servers:
  - url: https://api.nxos.io
    description: Production
    variables: {}
  - url: https://api.sandbox.nxos.io
    description: Sandbox
    variables: {}
security: []
tags:
  - name: Accounts
  - name: Quotes
  - name: Beneficiaries
  - name: Fiat Payouts
  - name: Crypto Payouts
  - name: Sandbox Faucet
  - name: Nxosnet
  - name: Fees
  - name: Sub-Org Tiers
  - name: Assets
  - name: Funding Methods
  - name: Transactions
  - name: Organizations
  - name: Authorizations
  - name: Referral invites
  - name: Referral links
  - name: Reports
  - name: Webhooks
    description: >-
      Register an HTTPS endpoint to receive events (organization verification,

      transaction status changes, finished reports, and beneficiaries entering
      or leaving review) instead of polling. Deliveries are signed; verify

      the `svix-signature` header before acting on an event.


      See the [Webhooks guide](https://docs.nxos.io/core-concepts/webhooks) for
      the

      delivery format, signature verification, retries, and broker behavior.
      Payload

      shapes are documented in the `…Event` models below.
paths:
  /v1/beneficiaries/{beneficiaryId}/documents:
    post:
      tags:
        - Beneficiaries
      description: >-
        Start uploading a document a beneficiary in review waits for (listed in
        its

        `requiredActions`). Returns a presigned upload: POST the file to
        `upload.url`

        as `multipart/form-data`, with every field of `upload.fields` first and
        the

        file as a `file` part last. The upload must use the declared
        `contentType`,

        stay under 20 MB, and happen before `expiresAt`. Then call

        `POST
        /v1/beneficiaries/{beneficiaryId}/documents/{documentId}/complete`.

        Up to 5 documents.
      operationId: Beneficiaries_startDocumentUpload
      parameters:
        - $ref: '#/components/parameters/ApiKeyAuth'
        - $ref: '#/components/parameters/IdempotencyKey'
        - name: beneficiaryId
          in: path
          required: true
          description: Beneficiary identifier.
          schema:
            type: string
        - name: accountId
          in: query
          required: true
          description: Account this beneficiary belongs to.
          schema:
            type: string
          explode: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StartBeneficiaryDocumentUploadRequest'
      responses:
        '201':
          description: >-
            The request has succeeded and a new resource has been created as a
            result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentUpload'
        '400':
          description: The server could not understand the request due to invalid syntax.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error400'
        '401':
          description: Access is unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error401'
        '403':
          description: Access is forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error403'
        '404':
          description: The server cannot find the requested resource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error404'
              examples:
                beneficiary_not_found:
                  summary: beneficiary_not_found
                  value:
                    error:
                      code: beneficiary_not_found
                      message: Beneficiary not found.
                      requestId: req_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4
        '409':
          description: The request conflicts with the current state of the server.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error409'
              examples:
                beneficiary_not_awaiting_document:
                  summary: beneficiary_not_awaiting_document
                  value:
                    error:
                      code: beneficiary_not_awaiting_document
                      message: This beneficiary is not waiting for a document.
                      requestId: req_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4
        '422':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error422'
              examples:
                document_too_large:
                  summary: document_too_large
                  value:
                    error:
                      code: document_too_large
                      message: A document can be at most 20 MB.
                      requestId: req_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4
                too_many_documents:
                  summary: too_many_documents
                  value:
                    error:
                      code: too_many_documents
                      message: >-
                        This beneficiary already has the maximum number of
                        files.
                      requestId: req_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4
        '429':
          description: Client error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error429'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error500'
components:
  parameters:
    ApiKeyAuth:
      name: Authorization
      in: header
      required: true
      description: 'Bearer token. Format: `Bearer <api_key>`'
      schema:
        type: string
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        Unique key per logical operation. UUID v4 recommended. Max 255
        characters.
      schema:
        type: string
  schemas:
    StartBeneficiaryDocumentUploadRequest:
      type: object
      required:
        - fileName
        - contentType
        - size
      properties:
        fileName:
          type: string
          maxLength: 255
          description: The file's name, kept for reference.
        contentType:
          type: string
          enum:
            - application/pdf
            - image/png
            - image/jpeg
          description: >-
            The file's type. The upload is held to it, and the stored file is
            checked against PDF, PNG and JPEG on completion.
        size:
          type: integer
          format: int32
          minimum: 1
          maximum: 20971520
          description: The file's size in bytes, up to 20 MB (20971520).
      description: A document to upload for a beneficiary in review.
    DocumentUpload:
      type: object
      required:
        - object
        - documentId
        - type
        - upload
        - expiresAt
      properties:
        object:
          type: string
          enum:
            - document_upload
          description: Object type. Always `document_upload`.
        documentId:
          type: string
          description: Document identifier, for the complete call.
        type:
          allOf:
            - $ref: '#/components/schemas/RequirementType'
          description: Which required document this is.
        upload:
          type: object
          properties:
            url:
              type: string
            fields:
              type: object
              additionalProperties:
                type: string
          required:
            - url
            - fields
          description: >-
            Where and how to POST the file: `multipart/form-data`, every field
            first, the file as `file` last.
        expiresAt:
          allOf:
            - $ref: '#/components/schemas/dateTimeString'
          description: The upload URL stops working after this time.
      description: 'A presigned upload: POST the file straight to storage, then complete it.'
      example:
        object: document_upload
        documentId: doc_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4
        type: invoice
        upload:
          url: https://nxos-hold-documents.s3.amazonaws.com/
          fields:
            key: holds/hold_a1b2…/doc_a1b2…
            Content-Type: application/pdf
            Policy: eyJ…
            X-Amz-Signature: …
        expiresAt: '2026-10-21T10:10:00.000Z'
    Error400:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
      description: Standard error response returned by all endpoints on failure.
    Error401:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
      description: Standard error response returned by all endpoints on failure.
      example:
        error:
          code: missing_api_key
          message: 'Missing or invalid Authorization header. Expected: Bearer <api_key>'
          requestId: req_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4
    Error403:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
      description: Standard error response returned by all endpoints on failure.
    Error404:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
      description: Standard error response returned by all endpoints on failure.
    Error409:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
      description: Standard error response returned by all endpoints on failure.
    Error422:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
      description: Standard error response returned by all endpoints on failure.
    Error429:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
      description: Standard error response returned by all endpoints on failure.
      example:
        error:
          code: rate_limited
          message: 'Rate limit exceeded: 1000 requests per minute. Retry in 23 seconds.'
          requestId: req_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4
    Error500:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
      description: Standard error response returned by all endpoints on failure.
      example:
        error:
          code: internal_error
          message: An unexpected error occurred.
          requestId: req_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4
    RequirementType:
      type: string
      enum:
        - invoice
        - supporting_documents
        - source_of_funds
        - counterparty_details
        - bank_statement
      description: A document type a held transaction can require.
    dateTimeString:
      type: string
      description: ISO 8601 timestamp string.
    ErrorBody:
      type: object
      required:
        - code
        - message
        - requestId
      properties:
        code:
          allOf:
            - $ref: '#/components/schemas/ErrorCode'
          description: Machine-readable error code.
        message:
          type: string
          description: Human-readable error message.
        requestId:
          type: string
          description: Unique identifier for this request, useful for debugging.
    ErrorCode:
      type: string
      enum:
        - missing_api_key
        - authentication_failed
        - invalid_api_key
        - forbidden
        - acting_org_not_found
        - authorization_required
        - swap_direction_not_allowed
        - sub_org_tier_not_available
        - service_not_enabled
        - not_found
        - organization_not_found
        - account_not_found
        - quote_not_found
        - beneficiary_not_found
        - transaction_not_found
        - funding_method_not_found
        - authorization_not_found
        - nxosnet_handle_not_found
        - sub_org_tier_not_found
        - report_not_found
        - quote_expired
        - quote_already_used
        - not_yet_sellable
        - beneficiary_already_archived
        - beneficiary_not_archived
        - beneficiary_blocked
        - beneficiary_in_review
        - beneficiary_not_awaiting_document
        - transaction_blocked
        - transaction_not_held
        - beneficiary_fix_not_requested
        - fee_schedule_drifted
        - nxosnet_not_enabled
        - nxosnet_handle_taken
        - chain_send_failed
        - swift_copy_not_found
        - swift_copy_not_ready
        - bank_unavailable
        - verification_closed
        - idempotency_key_in_use
        - idempotency_request_in_flight
        - referral_invite_already_accepted
        - report_not_ready
        - too_many_pending_reports
        - invalid_request
        - insufficient_funds
        - trade_size_out_of_bounds
        - validation_error
        - invalid_document
        - too_many_documents
        - document_too_large
        - invalid_beneficiary_details
        - document_not_found
        - document_not_uploaded
        - share_token_invalid
        - verification_import_unsupported
        - verification_required
        - terms_not_accepted
        - rate_limited
        - webhooks_unavailable
        - internal_error
      description: All possible error codes returned by the API.

````

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