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

# Handles `POST /v1/verification-flows/{flow_id}/publish`.

> Validates the draft against the catalog as it is now and writes the next
immutable revision.

# Errors

`401`, `403`, `404`, `409` when archived, `422` when the draft no longer
validates (a capability disabled since it was saved, say), `503`.



## OpenAPI

````yaml /openapi.json post /v1/verification-flows/{flow_id}/publish
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: []
security: []
paths:
  /v1/verification-flows/{flow_id}/publish:
    post:
      tags:
        - Verification flows
      summary: Handles `POST /v1/verification-flows/{flow_id}/publish`.
      description: |-
        Validates the draft against the catalog as it is now and writes the next
        immutable revision.

        # Errors

        `401`, `403`, `404`, `409` when archived, `422` when the draft no longer
        validates (a capability disabled since it was saved, say), `503`.
      operationId: publish_handler
      parameters:
        - name: flow_id
          in: path
          description: Flow identifier
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The flow, now active, with the new revision
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FlowBody'
        '401':
          description: No usable credentials
        '403':
          description: The caller does not hold VERIFICATION_FLOWS_MANAGE
        '404':
          description: This tenant has no such flow
        '409':
          description: The flow is archived
        '422':
          description: The draft does not validate against the current catalog
        '503':
          description: A backing store could not be reached
      security:
        - session_cookie: []
components:
  schemas:
    FlowBody:
      type: object
      description: A flow as the API shows it.
      required:
        - flow_id
        - name
        - status
        - flow_type
        - documents
        - created_at
        - updated_at
      properties:
        archived_at:
          type:
            - string
            - 'null'
          description: RFC 3339 time it was archived.
        created_at:
          type: string
          description: RFC 3339 creation time.
        documents:
          type: array
          items:
            $ref: '#/components/schemas/FlowDocumentSelection'
          description: The draft's selection, by catalog code.
        flow_id:
          type: string
          description: Identifier, `vf_...`.
        flow_type:
          $ref: '#/components/schemas/FlowType'
          description: The draft's type.
        name:
          type: string
          description: Name.
        published:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/FlowRevisionBody'
              description: The latest published revision, when there is one.
        published_at:
          type:
            - string
            - 'null'
          description: RFC 3339 time of the latest publish.
        published_revision:
          type:
            - integer
            - 'null'
          format: int32
          description: The latest published revision number.
          minimum: 0
        return_url:
          type:
            - string
            - 'null'
          description: The draft's return URL, as entered.
        status:
          $ref: '#/components/schemas/FlowStatus'
          description: '`DRAFT`, `ACTIVE` or `ARCHIVED`.'
        updated_at:
          type: string
          description: RFC 3339 time of the last change.
    FlowDocumentSelection:
      type: object
      description: 'What an admin chose for one country: which of its catalog entries.'
      required:
        - country
        - capabilities
      properties:
        capabilities:
          type: array
          items:
            type: string
          description: Catalog codes, each belonging to `country`.
        country:
          type: string
          description: ISO-3166-1 alpha-2 country, upper case.
    FlowType:
      type: string
      description: Which journey a flow describes.
      enum:
        - BIOMETRIC
        - DOCUMENT
        - FULL_IDENTITY
    FlowRevisionBody:
      type: object
      description: A published revision as the API shows it.
      required:
        - revision
        - configuration
        - published_at
        - published_by
      properties:
        configuration:
          $ref: '#/components/schemas/FlowConfiguration'
          description: What was published.
        published_at:
          type: string
          description: RFC 3339 publication time.
        published_by:
          type: string
          description: Who published it.
        revision:
          type: integer
          format: int32
          description: Revision number, from 1.
          minimum: 0
    FlowStatus:
      type: string
      description: Where a flow is in its life.
      enum:
        - DRAFT
        - ACTIVE
        - ARCHIVED
    FlowConfiguration:
      type: object
      description: What a published revision - and a session opened under it - carries.
      required:
        - flow_type
        - required_checks
        - documents
      properties:
        documents:
          type: array
          items:
            $ref: '#/components/schemas/FlowDocument'
          description: The documents accepted, as snapshots. Empty for `BIOMETRIC`.
        flow_type:
          $ref: '#/components/schemas/FlowType'
          description: Which journey.
        required_checks:
          type: array
          items:
            $ref: '#/components/schemas/CheckKind'
          description: |-
            The checks, from the type. Stored rather than derived so a session
            written under one build is read identically by the next.
        return_url:
          type:
            - string
            - 'null'
          description: The validated return URL, when the flow has one.
    FlowDocument:
      type: object
      description: |-
        One catalog entry as it was when a flow was published.

        A copy, not a reference. The global catalog may rename, re-reader or
        disable the entry afterwards; this revision, and every session opened
        under it, keeps what was true when it was published.
      required:
        - code
        - country
        - document_type
        - display_name
      properties:
        capture:
          $ref: '#/components/schemas/CaptureRequirements'
          description: Capture rules at publish time.
        code:
          type: string
          description: Catalog code.
        country:
          type: string
          description: Issuing country.
        display_name:
          type: string
          description: Display name at publish time.
        document_type:
          $ref: '#/components/schemas/DocumentType'
          description: Document type.
        reader:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/ReaderClass'
              description: Reader at publish time.
    CheckKind:
      type: string
      description: >-
        A check a tenant's policy can require.


        Deliberately a closed vocabulary: a policy that names a check Esectra
        does

        not understand should fail to load rather than be silently ignored.
      enum:
        - FACE_MATCH
        - LIVENESS
        - AUTHENTICITY
        - DOCUMENT_EXTRACTION
        - DOCUMENT_CONSISTENCY
        - DOCUMENT_AUTHORITY
        - SANCTIONS
        - PEP
        - ADVERSE_MEDIA
        - ADDRESS
        - PHONE
        - EMAIL
    CaptureRequirements:
      type: object
      description: |-
        Capture rules a capability may set, from the ones the page and the route
        already implement. Nothing here invents a requirement the application
        cannot enforce.
      required:
        - document_number_required
      properties:
        document_number_required:
          type: boolean
          description: >-
            Whether the person must type their document number. The page
            compares

            the last four characters against what was read, so a document that
            is

            read wants it; a document with no number does not.
    DocumentType:
      type: string
      description: Kind of identity document presented.
      enum:
        - PASSPORT
        - DRIVING_LICENCE
        - NATIONAL_ID
        - RESIDENCE_PERMIT
        - NIN_SLIP
        - OTHER
    ReaderClass:
      type: string
      description: >-
        The reader classes the inference service implements.


        These are the document classes `Gorgon-ML` reports and

        [`crate::document_reading`] accepts; a test holds the two lists
        together.

        Adding a class here without a reader behind it is exactly the dishonesty

        the catalog exists to prevent, so the list is closed and reviewed.
      enum:
        - NG_NIN_SLIP
        - TD3_MRZ
  securitySchemes:
    session_cookie:
      type: apiKey
      in: cookie
      name: esectra_session
      description: >-
        A signed-in reviewer's session. httpOnly and SameSite=Lax; set by `POST
        /v1/control/sessions` and only usable once the second factor is met.

````

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