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

# `POST /v1/capture/{token}/media`: stores one capture against the session.



## OpenAPI

````yaml /openapi.json post /v1/capture/{token}/media
openapi: 3.1.0
info:
  title: Esectra API
  description: >-
    Transaction screening, identity verification, and wallet risk.


    Every create route accepts `Idempotency-Key`; replaying one returns the
    original record with `200` where the first call returned `201`. `POST
    /v1/transactions` requires the header, because a duplicated transaction is a
    duplicated financial record.
  license:
    name: proprietary
    identifier: proprietary
  version: 0.1.0
servers:
  - url: https://qa.esectra.com
    description: Esectra QA Documentation
security: []
paths:
  /v1/capture/{token}/media:
    post:
      tags:
        - Capture
      summary: >-
        `POST /v1/capture/{token}/media`: stores one capture against the
        session.
      operationId: media_handler
      parameters:
        - name: token
          in: path
          description: Single-use capture token
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CaptureBody'
        required: true
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CaptureAcceptedBody'
        '404':
          description: Unknown or expired token
        '422':
          description: The media is not usable
        '429':
          description: Too many attempts; carries Retry-After
        '503':
          description: A backing store could not be reached
components:
  schemas:
    CaptureBody:
      type: object
      description: One capture from the person being verified.
      required:
        - kind
        - media_type
        - image_base64
        - challenge_nonce
      properties:
        challenge_nonce:
          type: string
          description: The session's nonce, echoed back.
        declared_document:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/DeclaredDocument'
              description: >-
                What the person says the document is, sent with the document
                capture.


                Optional, and ignored on a selfie. An older capture client that
                does

                not send it still works; it declares nothing, and nothing is
                compared.
        image_base64:
          type: string
          description: The capture itself.
        kind:
          $ref: '#/components/schemas/CaptureKind'
          description: Which capture this is.
        media_type:
          type: string
          description: What the client says the bytes are.
    CaptureAcceptedBody:
      type: object
      description: What the subject is told. Deliberately thin - see the module docs.
      required:
        - stored
        - awaiting
      properties:
        awaiting:
          type: array
          items:
            type: string
          description: Whether Esectra still expects something else before it can finish.
        stored:
          type: string
          description: Which capture was stored.
    DeclaredDocument:
      type: object
      description: >-
        What the person said their document is, before anything has read it.


        Collected by the capture flow so the extractor is checked against a
        claim

        rather than trusted on its own: a passport that reads as a driving
        licence,

        or a GB document whose machine-readable zone says DE, is a mismatch a

        reviewer should see. It is a declaration, never evidence - nothing here
        is

        verified at the point it is captured, and it must not be treated as
        though

        it were.
      required:
        - document_type
      properties:
        document_type:
          $ref: '#/components/schemas/DocumentType'
          description: Kind of document the person says this is.
        issuing_country:
          type:
            - string
            - 'null'
          description: ISO-3166 alpha-2 issuing country, upper case.
        number_last4:
          type:
            - string
            - 'null'
          description: >-
            Last four characters of the number the person typed.


            Only the last four, for the same reason [`IdDocument::number_last4`]

            holds only four: the full number identifies a person to anyone who
            can

            read the record. The capture page truncates before sending, so the

            rest never crosses the network at all.
    CaptureKind:
      type: string
      description: Which capture is being presented.
      enum:
        - SELFIE
        - DOCUMENT
    DocumentType:
      type: string
      description: Kind of identity document presented.
      enum:
        - PASSPORT
        - DRIVING_LICENCE
        - NATIONAL_ID
        - RESIDENCE_PERMIT
        - OTHER

````