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

# Cancel origination

> Cancel origination.

Cancel an unfinished origination with its current ETag. Cancelling invalidates queued work; completed and failed results cannot be changed. A new assessment uses supersedes\_origination\_id and the same stable application reference. Historical results/charges are preserved; unfinished cancelled work creates no assessment charge. Required scope: insights:write.

Examples use synthetic IDs. Replace them with values returned by your environment.

## Operation name

`updateOrigination`

The `X-Amlok-Operation-Id` response header identifies this endpoint. Request receipts apply to accepted POST commands.


## OpenAPI

````yaml openapi/amlok.json PATCH /v1/originations/{id}
openapi: 3.1.0
info:
  title: AMLOK API
  version: 1.0.0
  description: >-
    AMLOK API: borrower connections, Insights origination, immutable risk
    packages and Signal monitoring. Use https://api.amlok.io for both Sandbox
    and Live; the API key selects the workspace environment.
servers:
  - url: https://api.amlok.io
    description: Customer API. Use a Sandbox or Live workspace key; paths include /v1.
security:
  - BearerAuth: []
tags:
  - name: Sandbox
    description: Reproducible developer scenarios with synthetic data and money.
paths:
  /v1/originations/{id}:
    patch:
      tags:
        - Insights
      summary: Cancel origination
      description: >-
        Cancel an unfinished origination with its current ETag. Cancelling
        invalidates queued work; completed and failed results cannot be changed.
        A new assessment uses supersedes_origination_id and the same stable
        application reference. Historical results/charges are preserved;
        unfinished cancelled work creates no assessment charge. Required scope:
        insights:write.
      operationId: updateOrigination
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            minLength: 1
          description: id
        - name: If-Match
          in: header
          required: true
          schema:
            type: string
            minLength: 1
          description: >-
            Required current ETag from the origination. Stale versions return
            412. PATCH uses optimistic concurrency; Idempotency-Key does not
            create a replay receipt.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOrigination'
            example:
              status: cancelled
      responses:
        '200':
          description: Successful response.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Origination'
                  meta:
                    $ref: '#/components/schemas/Meta'
                required:
                  - data
                  - meta
                additionalProperties: false
              example:
                data:
                  id: orgn_synthetic
                  borrower_id: bor_synthetic
                  institution_reference: LOS-2026-0042
                  status: cancelled
                  created_at: '2026-11-06T12:00:00Z'
                  updated_at: '2026-11-06T12:00:00Z'
                  requirements: []
                  risk_package_id: null
                  failure: null
                  record_version: 2
                  submitted_request:
                    borrower_id: bor_synthetic
                    application:
                      institution_reference: LOS-2026-0042
                      requested_amount:
                        amount: '50000.00'
                        currency: CAD
                      requested_term_months: 12
                      purpose: Working capital
                      application_schema_id: app_schema_synthetic
                      declared_data:
                        annual_revenue: '600000.00'
                    lending_product_version_id: lpv_synthetic
                    risk_policy_version_id: rpv_synthetic
                    connection_ids:
                      - con_synthetic
                    document_ids: []
                  document_ids: []
                  connection_ids:
                    - con_synthetic
                  borrower_snapshot:
                    id: bor_synthetic
                    type: business
                    subject_id: biz_synthetic
                    created_at: '2026-11-06T12:00:00Z'
                    client_reference: LOS-B-0042
                    profile:
                      type: business
                      business:
                        legal_name: Synthetic Borrower Inc.
                        incorporation_country: CA
                        client_reference: LOS-B-0042
                    lifecycle_status: active
                    archived_at: null
                    updated_at: '2026-11-06T12:00:00Z'
                    record_version: 1
                    profile_version: 1
                  borrower_profile_version: 1
                  participants: []
                  attempt_number: 1
                  supersedes_origination_id: null
                meta:
                  request_id: req_synthetic
                  schema_version: 1.0.0
                  environment: sandbox
          headers:
            X-Request-ID:
              schema:
                type: string
              description: >-
                Request ID for the current HTTP attempt. On an idempotent
                replay, meta.request_id in the cached response body remains the
                original accepted request ID and can differ from this header.
                Preserve both IDs for troubleshooting.
            ETag:
              schema:
                type: string
                minLength: 1
              description: Quoted record_version for conditional updates.
            X-Amlok-Operation-Id:
              schema:
                type: string
              example: updateOrigination
              description: >-
                Stable OpenAPI operation name for this endpoint. For receipt
                lookup use the original POST operation name, not the lookup
                operation, request ID or resource ID. Available on responses
                handled by a documented route; transport failures may have no
                response.
        '400':
          description: >-
            Inspect structured error; retry only when retryable. 429 and 503 can
            include Retry-After.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                required:
                  - error
                additionalProperties: false
              example:
                error:
                  code: validation_error
                  message: Validation error.
                  retryable: false
                  request_id: req_synthetic
                  field: null
          headers:
            X-Request-ID:
              schema:
                type: string
              description: >-
                Request ID for the current HTTP attempt. On an idempotent
                replay, meta.request_id in the cached response body remains the
                original accepted request ID and can differ from this header.
                Preserve both IDs for troubleshooting.
            X-Amlok-Operation-Id:
              schema:
                type: string
              example: updateOrigination
              description: >-
                Stable OpenAPI operation name for this endpoint. For receipt
                lookup use the original POST operation name, not the lookup
                operation, request ID or resource ID. Available on responses
                handled by a documented route; transport failures may have no
                response.
        '401':
          description: >-
            Inspect structured error; retry only when retryable. 429 and 503 can
            include Retry-After.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                required:
                  - error
                additionalProperties: false
              example:
                error:
                  code: unauthenticated
                  message: Unauthenticated.
                  retryable: false
                  request_id: req_synthetic
                  field: null
          headers:
            X-Request-ID:
              schema:
                type: string
              description: >-
                Request ID for the current HTTP attempt. On an idempotent
                replay, meta.request_id in the cached response body remains the
                original accepted request ID and can differ from this header.
                Preserve both IDs for troubleshooting.
            X-Amlok-Operation-Id:
              schema:
                type: string
              example: updateOrigination
              description: >-
                Stable OpenAPI operation name for this endpoint. For receipt
                lookup use the original POST operation name, not the lookup
                operation, request ID or resource ID. Available on responses
                handled by a documented route; transport failures may have no
                response.
        '403':
          description: >-
            Inspect structured error; retry only when retryable. 429 and 503 can
            include Retry-After.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                required:
                  - error
                additionalProperties: false
              example:
                error:
                  code: forbidden
                  message: Forbidden.
                  retryable: false
                  request_id: req_synthetic
                  field: null
          headers:
            X-Request-ID:
              schema:
                type: string
              description: >-
                Request ID for the current HTTP attempt. On an idempotent
                replay, meta.request_id in the cached response body remains the
                original accepted request ID and can differ from this header.
                Preserve both IDs for troubleshooting.
            X-Amlok-Operation-Id:
              schema:
                type: string
              example: updateOrigination
              description: >-
                Stable OpenAPI operation name for this endpoint. For receipt
                lookup use the original POST operation name, not the lookup
                operation, request ID or resource ID. Available on responses
                handled by a documented route; transport failures may have no
                response.
        '404':
          description: >-
            Inspect structured error; retry only when retryable. 429 and 503 can
            include Retry-After.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                required:
                  - error
                additionalProperties: false
              example:
                error:
                  code: not_found
                  message: Not found.
                  retryable: false
                  request_id: req_synthetic
                  field: null
          headers:
            X-Request-ID:
              schema:
                type: string
              description: >-
                Request ID for the current HTTP attempt. On an idempotent
                replay, meta.request_id in the cached response body remains the
                original accepted request ID and can differ from this header.
                Preserve both IDs for troubleshooting.
            X-Amlok-Operation-Id:
              schema:
                type: string
              example: updateOrigination
              description: >-
                Stable OpenAPI operation name for this endpoint. For receipt
                lookup use the original POST operation name, not the lookup
                operation, request ID or resource ID. Available on responses
                handled by a documented route; transport failures may have no
                response.
        '409':
          description: >-
            Inspect structured error; retry only when retryable. 429 and 503 can
            include Retry-After.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                required:
                  - error
                additionalProperties: false
              example:
                error:
                  code: invalid_state
                  message: Invalid state.
                  retryable: false
                  request_id: req_synthetic
                  field: null
          headers:
            X-Request-ID:
              schema:
                type: string
              description: >-
                Request ID for the current HTTP attempt. On an idempotent
                replay, meta.request_id in the cached response body remains the
                original accepted request ID and can differ from this header.
                Preserve both IDs for troubleshooting.
            X-Amlok-Operation-Id:
              schema:
                type: string
              example: updateOrigination
              description: >-
                Stable OpenAPI operation name for this endpoint. For receipt
                lookup use the original POST operation name, not the lookup
                operation, request ID or resource ID. Available on responses
                handled by a documented route; transport failures may have no
                response.
        '410':
          description: >-
            Inspect structured error; retry only when retryable. 429 and 503 can
            include Retry-After.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                required:
                  - error
                additionalProperties: false
              example:
                error:
                  code: cursor_expired
                  message: Cursor expired.
                  retryable: false
                  request_id: req_synthetic
                  field: null
          headers:
            X-Request-ID:
              schema:
                type: string
              description: >-
                Request ID for the current HTTP attempt. On an idempotent
                replay, meta.request_id in the cached response body remains the
                original accepted request ID and can differ from this header.
                Preserve both IDs for troubleshooting.
            X-Amlok-Operation-Id:
              schema:
                type: string
              example: updateOrigination
              description: >-
                Stable OpenAPI operation name for this endpoint. For receipt
                lookup use the original POST operation name, not the lookup
                operation, request ID or resource ID. Available on responses
                handled by a documented route; transport failures may have no
                response.
        '412':
          description: >-
            Inspect structured error; retry only when retryable. 429 and 503 can
            include Retry-After.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                required:
                  - error
                additionalProperties: false
              example:
                error:
                  code: precondition_failed
                  message: Precondition failed.
                  retryable: false
                  request_id: req_synthetic
                  field: null
          headers:
            X-Request-ID:
              schema:
                type: string
              description: >-
                Request ID for the current HTTP attempt. On an idempotent
                replay, meta.request_id in the cached response body remains the
                original accepted request ID and can differ from this header.
                Preserve both IDs for troubleshooting.
            X-Amlok-Operation-Id:
              schema:
                type: string
              example: updateOrigination
              description: >-
                Stable OpenAPI operation name for this endpoint. For receipt
                lookup use the original POST operation name, not the lookup
                operation, request ID or resource ID. Available on responses
                handled by a documented route; transport failures may have no
                response.
        '413':
          description: >-
            Request exceeds the effective profile size limit or media type is
            unsupported. No command is accepted.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                required:
                  - error
                additionalProperties: false
              example:
                error:
                  code: payload_too_large
                  message: payload too large
                  retryable: false
                  request_id: req_synthetic
                  field: null
          headers:
            X-Request-ID:
              schema:
                type: string
              description: >-
                Request ID for the current HTTP attempt. On an idempotent
                replay, meta.request_id in the cached response body remains the
                original accepted request ID and can differ from this header.
                Preserve both IDs for troubleshooting.
            X-Amlok-Operation-Id:
              schema:
                type: string
              example: updateOrigination
              description: >-
                Stable OpenAPI operation name for this endpoint. For receipt
                lookup use the original POST operation name, not the lookup
                operation, request ID or resource ID. Available on responses
                handled by a documented route; transport failures may have no
                response.
        '415':
          description: >-
            Request exceeds the effective profile size limit or media type is
            unsupported. No command is accepted.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                required:
                  - error
                additionalProperties: false
              example:
                error:
                  code: unsupported_media_type
                  message: unsupported media type
                  retryable: false
                  request_id: req_synthetic
                  field: null
          headers:
            X-Request-ID:
              schema:
                type: string
              description: >-
                Request ID for the current HTTP attempt. On an idempotent
                replay, meta.request_id in the cached response body remains the
                original accepted request ID and can differ from this header.
                Preserve both IDs for troubleshooting.
            X-Amlok-Operation-Id:
              schema:
                type: string
              example: updateOrigination
              description: >-
                Stable OpenAPI operation name for this endpoint. For receipt
                lookup use the original POST operation name, not the lookup
                operation, request ID or resource ID. Available on responses
                handled by a documented route; transport failures may have no
                response.
        '422':
          description: >-
            Inspect structured error; retry only when retryable. 429 and 503 can
            include Retry-After.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                required:
                  - error
                additionalProperties: false
              example:
                error:
                  code: validation_error
                  message: Validation error.
                  retryable: false
                  request_id: req_synthetic
                  field: null
          headers:
            X-Request-ID:
              schema:
                type: string
              description: >-
                Request ID for the current HTTP attempt. On an idempotent
                replay, meta.request_id in the cached response body remains the
                original accepted request ID and can differ from this header.
                Preserve both IDs for troubleshooting.
            X-Amlok-Operation-Id:
              schema:
                type: string
              example: updateOrigination
              description: >-
                Stable OpenAPI operation name for this endpoint. For receipt
                lookup use the original POST operation name, not the lookup
                operation, request ID or resource ID. Available on responses
                handled by a documented route; transport failures may have no
                response.
        '429':
          description: >-
            Rate budget, shared in-flight limit or ready-queue limit exceeded
            before admission. Retry-After is mandatory in whole seconds.
            Preserve command identity. No accepted receipt or charge is created.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                required:
                  - error
                additionalProperties: false
              example:
                error:
                  code: rate_limited
                  message: Rate limited.
                  retryable: true
                  request_id: req_synthetic
                  field: null
          headers:
            Retry-After:
              description: Minimum delay in seconds before retry.
              schema:
                type: integer
                minimum: 0
            X-Request-ID:
              schema:
                type: string
              description: >-
                Request ID for the current HTTP attempt. On an idempotent
                replay, meta.request_id in the cached response body remains the
                original accepted request ID and can differ from this header.
                Preserve both IDs for troubleshooting.
            X-Amlok-Operation-Id:
              schema:
                type: string
              example: updateOrigination
              description: >-
                Stable OpenAPI operation name for this endpoint. For receipt
                lookup use the original POST operation name, not the lookup
                operation, request ID or resource ID. Available on responses
                handled by a documented route; transport failures may have no
                response.
        '503':
          description: >-
            Inspect structured error; retry only when retryable. 429 and 503 can
            include Retry-After.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                required:
                  - error
                additionalProperties: false
              example:
                error:
                  code: temporarily_unavailable
                  message: Temporarily unavailable.
                  retryable: true
                  request_id: req_synthetic
                  field: null
          headers:
            Retry-After:
              description: Minimum delay in seconds before retry.
              schema:
                type: integer
                minimum: 0
            X-Request-ID:
              schema:
                type: string
              description: >-
                Request ID for the current HTTP attempt. On an idempotent
                replay, meta.request_id in the cached response body remains the
                original accepted request ID and can differ from this header.
                Preserve both IDs for troubleshooting.
            X-Amlok-Operation-Id:
              schema:
                type: string
              example: updateOrigination
              description: >-
                Stable OpenAPI operation name for this endpoint. For receipt
                lookup use the original POST operation name, not the lookup
                operation, request ID or resource ID. Available on responses
                handled by a documented route; transport failures may have no
                response.
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |-
            curl --request PATCH --fail-with-body --max-time 30 \
              "${AMLOK_API_BASE_URL}/v1/originations/record_synthetic" \
              --header "Authorization: Bearer ${AMLOK_API_KEY}" \
              --header 'Accept: application/json' \
              --header 'If-Match: "1"' \
              --header 'Content-Type: application/json' \
              --data '{"status":"cancelled"}'
        - lang: Python
          source: >
            import os

            import requests


            headers = {'Accept': 'application/json', 'If-Match': '"1"',
            'Content-Type': 'application/json'}

            headers["Authorization"] = "Bearer " + os.environ["AMLOK_API_KEY"]

            response = requests.request('PATCH',
            os.environ["AMLOK_API_BASE_URL"] +
            '/v1/originations/record_synthetic', headers=headers,
            json={'status': 'cancelled'}, timeout=30, allow_redirects=False)

            response.raise_for_status()

            print(response.json())
        - lang: JavaScript
          source: >
            const headers = {"Accept": "application/json", "If-Match": "\"1\"",
            "Content-Type": "application/json"};

            headers.Authorization = `Bearer ${process.env.AMLOK_API_KEY}`;

            const response = await fetch(process.env.AMLOK_API_BASE_URL +
            "/v1/originations/record_synthetic", {
              method: "PATCH", headers, redirect: "error", signal: AbortSignal.timeout(30000),
              body: JSON.stringify({"status": "cancelled"})
            });

            if (!response.ok) throw new Error(`HTTP ${response.status}: ${await
            response.text()}`);

            console.log(await response.json());
components:
  schemas:
    UpdateOrigination:
      type: object
      properties:
        status:
          const: cancelled
          description: >-
            Cancel unfinished assessment work. Completed/failed results remain
            immutable. Cancelled unfinished work creates no product charge.
      required:
        - status
      additionalProperties: false
    Origination:
      type: object
      properties:
        id:
          type: string
          minLength: 1
          description: >-
            Opaque identifier, authorized within the API key workspace and
            environment.
        borrower_id:
          type: string
          minLength: 1
          description: >-
            Opaque identifier, authorized within the API key workspace and
            environment.
        institution_reference:
          type: string
          minLength: 1
          description: >-
            Stable institution application identity reused across explicit
            assessment attempts. Borrower and reference must remain unchanged
            when superseding an attempt.
        status:
          type: string
          enum:
            - accepted
            - collecting
            - requires_action
            - processing
            - waiting_for_credits
            - completed
            - failed
            - cancelled
          description: >-
            Current lifecycle state. See the product lifecycle and recovery
            guides.
        created_at:
          type: string
          minLength: 1
          format: date-time
          description: UTC time the record was created.
        updated_at:
          type: string
          minLength: 1
          format: date-time
          description: UTC time this resource last changed.
        requirements:
          type: array
          items:
            $ref: '#/components/schemas/Requirement'
          description: >-
            Requirements for Origination. Constraints, requiredness and allowed
            values are defined by this schema.
        risk_package_id:
          anyOf:
            - type: string
              minLength: 1
              description: >-
                Opaque identifier, authorized within the API key workspace and
                environment.
            - type: 'null'
          description: >-
            Risk package id for Origination. Constraints, requiredness and
            allowed values are defined by this schema.
        failure:
          anyOf:
            - $ref: '#/components/schemas/Error'
            - type: 'null'
          description: >-
            Failure for Origination. Constraints, requiredness and allowed
            values are defined by this schema.
        submitted_request:
          $ref: '#/components/schemas/CreateOrigination'
          description: >-
            Submitted request for Origination. Constraints, requiredness and
            allowed values are defined by this schema.
        document_ids:
          type: array
          items:
            type: string
            minLength: 1
            description: Opaque ID within the authorized workspace and environment.
          uniqueItems: true
          description: >-
            Accepted primary-borrower document associations, including initially
            submitted files and later files accepted while the origination is
            open. Related-party files appear separately in
            participants[].document_ids. A completed risk package freezes its
            own document and evidence references; later borrower-only uploads do
            not change them.
        connection_ids:
          type: array
          items:
            type: string
            minLength: 1
            description: Opaque identifier in the authorized workspace and environment.
          uniqueItems: true
          description: >-
            Current effective connections, including resolved requirements.
            submitted_request remains immutable.
        record_version:
          type: integer
          minimum: 1
          description: >-
            Monotonic version for this resource; compare with
            event.resource_version.
        borrower_snapshot:
          $ref: '#/components/schemas/Borrower'
          description: >-
            Exact institution-supplied identity pinned when this assessment
            attempt was accepted. Later profile edits do not change this
            assessment or its results; registration is not verification.
        borrower_profile_version:
          type: integer
          minimum: 1
        participants:
          type: array
          items:
            $ref: '#/components/schemas/ParticipantSnapshot'
          maxItems: 100
        attempt_number:
          type: integer
          minimum: 1
        supersedes_origination_id:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
      required:
        - id
        - borrower_id
        - institution_reference
        - status
        - created_at
        - updated_at
        - requirements
        - risk_package_id
        - failure
        - submitted_request
        - document_ids
        - connection_ids
        - record_version
        - borrower_snapshot
        - borrower_profile_version
        - participants
        - attempt_number
        - supersedes_origination_id
      additionalProperties: false
      allOf:
        - if:
            properties:
              status:
                const: completed
          then:
            properties:
              risk_package_id:
                type: string
                minLength: 1
                description: >-
                  Opaque identifier, authorized within the API key workspace and
                  environment.
          else:
            properties:
              risk_package_id:
                type: 'null'
        - if:
            properties:
              status:
                const: requires_action
          then:
            properties:
              requirements:
                minItems: 1
          else:
            properties:
              requirements:
                maxItems: 0
        - if:
            properties:
              status:
                const: failed
          then:
            properties:
              failure:
                $ref: '#/components/schemas/Error'
          else:
            properties:
              failure:
                type: 'null'
    Meta:
      type: object
      properties:
        request_id:
          type: string
          minLength: 1
          description: >-
            Opaque identifier, authorized within the API key workspace and
            environment.
        schema_version:
          type: string
          minLength: 1
          description: >-
            Schema version for Meta. Constraints, requiredness and allowed
            values are defined by this schema.
        environment:
          type: string
          enum:
            - sandbox
            - live
          description: >-
            Environment for Meta. Constraints, requiredness and allowed values
            are defined by this schema.
      required:
        - request_id
        - schema_version
        - environment
      additionalProperties: false
    Error:
      type: object
      properties:
        code:
          type: string
          enum:
            - validation_error
            - unauthenticated
            - forbidden
            - not_found
            - invalid_state
            - idempotency_conflict
            - insufficient_credits
            - precondition_failed
            - cursor_expired
            - rate_limited
            - temporarily_unavailable
            - deal_snapshot_conflict
            - payload_too_large
            - unsupported_media_type
            - document_rejected
            - processing_failed
            - session_expired
            - consent_purpose_missing
            - sandbox_only
            - scenario_not_available
            - idempotency_result_expired
            - capacity_exceeded
            - queue_full
            - queue_wait_exceeded
            - processing_deadline_exceeded
            - response_too_large
            - export_too_large
            - export_expired
            - invalid_export_part
          description: >-
            Stable machine-readable code. validation_error: Correct the named
            field, schema or incompatible input. Do not retry unchanged.
            unauthenticated: Use an unexpired, unrevoked API key for this
            workspace environment. forbidden: Check current membership, scopes,
            product access, Live activation and source consent. not_found: Check
            the ID and workspace/environment; foreign records are not exposed.
            invalid_state: Fetch current state and choose an allowed lifecycle
            action. idempotency_conflict: Reuse the original payload for that
            key, or use a fresh key for a genuinely new command.
            insufficient_credits: Top up through the Console. For an accepted
            resource, inspect waiting_for_credits before submitting more work.
            precondition_failed: Fetch the current ETag, review the change and
            submit If-Match again. cursor_expired: Start a new snapshot and
            reconcile; retain deduplication state. Expired event replays cannot
            be queued. rate_limited: Respect Retry-After and use bounded
            jittered backoff with the same command identity.
            temporarily_unavailable: Respect retryable and Retry-After; recover
            an uncertain accepted command before repeating it.
            deal_snapshot_conflict: Read the current deal snapshot and review
            previous_snapshot_id before appending. payload_too_large: Reduce
            JSON or upload size to the operational profile limit; do not split a
            single document arbitrarily. unsupported_media_type: Send the
            supported Content-Type and matching detected file content.
            document_rejected: Inspect the rejected document and replace unsafe,
            corrupt or unsupported content. processing_failed: Inspect the
            terminal origination, monitor, run or export failure and retain
            request_id for support. session_expired: Create a new short-lived
            embedding session; do not reuse its launch URL.
            consent_purpose_missing: Obtain the required borrower purpose
            through the approved Hub configuration. sandbox_only: Remove
            simulation controls from Live; use the Sandbox environment to test
            scenarios. scenario_not_available: For a command header, choose a
            scenario enabled in configuration.sandbox.scenario_ids and supported
            by that endpoint. Named scenario runs use the separate Sandbox
            catalog. idempotency_result_expired: Look up the durable request
            receipt and resource; an expired cached response does not authorize
            duplicate work. capacity_exceeded: Lower concurrency or resource
            fan-out and respect Retry-After. queue_full: Apply bounded backoff;
            do not replace the idempotency key while retrying submission.
            queue_wait_exceeded: Inspect the accepted resource failure; review
            capacity before an intentional new command.
            processing_deadline_exceeded: Inspect partial evidence and the
            terminal failure; do not interpret a deadline as a completed result.
            response_too_large: Use Error.recovery to choose a summary, section,
            smaller page or supported export. export_too_large: Reduce the
            export scope or choose a supported partitioned format.
            export_expired: Create a new export; expired downloads are not
            renewed indefinitely. invalid_export_part: Read the export manifest
            and request an existing part number.
        message:
          type: string
          minLength: 1
          description: >-
            Message for Error. Constraints, requiredness and allowed values are
            defined by this schema.
        retryable:
          type: boolean
          description: >-
            Retryable for Error. Constraints, requiredness and allowed values
            are defined by this schema.
        request_id:
          type: string
          minLength: 1
          description: >-
            Opaque identifier, authorized within the API key workspace and
            environment.
        field:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          description: >-
            Field for Error. Constraints, requiredness and allowed values are
            defined by this schema.
        capacity:
          $ref: '#/components/schemas/CapacityErrorDetail'
        recovery:
          $ref: '#/components/schemas/LargeResponseRecovery'
      required:
        - code
        - message
        - retryable
        - request_id
        - field
      additionalProperties: false
      allOf:
        - if:
            properties:
              code:
                const: response_too_large
          then:
            required:
              - recovery
            properties:
              retryable:
                const: false
        - if:
            properties:
              code:
                enum:
                  - capacity_exceeded
                  - queue_full
          then:
            required:
              - capacity
            properties:
              retryable:
                const: true
    Requirement:
      type: object
      properties:
        id:
          type: string
          minLength: 1
          description: Opaque identifier in the authorized workspace and environment.
        code:
          type: string
          enum:
            - source_missing
            - source_reauthorization_required
            - document_required
            - contact_support
          description: >-
            Code for Requirement. Constraints, requiredness and allowed values
            are defined by this schema.
        message:
          type: string
          minLength: 1
          description: >-
            Human-readable explanation; automate using code/action and typed
            fields.
        action:
          type: string
          enum:
            - connect_source
            - reauthorize_source
            - upload_document
            - contact_support
          description: >-
            Action for Requirement. Constraints, requiredness and allowed values
            are defined by this schema.
        connection_id:
          anyOf:
            - type: string
              minLength: 1
              description: Opaque identifier in the authorized workspace and environment.
            - type: 'null'
          description: >-
            Connection id for Requirement. Constraints, requiredness and allowed
            values are defined by this schema.
        integration_id:
          anyOf:
            - type: string
              minLength: 1
              description: Opaque identifier in the authorized workspace and environment.
            - type: 'null'
          description: >-
            Integration id for Requirement. Constraints, requiredness and
            allowed values are defined by this schema.
        document_type:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          description: >-
            Document type for Requirement. Constraints, requiredness and allowed
            values are defined by this schema.
        accepted_mime_types:
          type: array
          items:
            type: string
            minLength: 1
          description: >-
            Accepted mime types for Requirement. Constraints, requiredness and
            allowed values are defined by this schema.
        consent_purposes:
          type: array
          items:
            type: string
            enum:
              - credit_assessment
              - continuous_monitoring
          uniqueItems: true
          description: >-
            Consent purposes for Requirement. Constraints, requiredness and
            allowed values are defined by this schema.
        borrower_id:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          description: >-
            Participant borrower requiring action, or null/omitted for the
            primary borrower. Hub recovery must use this identity and the
            matching requirement.
      required:
        - id
        - code
        - message
        - action
        - connection_id
        - integration_id
        - document_type
        - accepted_mime_types
        - consent_purposes
      additionalProperties: false
      allOf:
        - if:
            properties:
              action:
                const: reauthorize_source
          then:
            properties:
              code:
                const: source_reauthorization_required
              connection_id:
                type: string
                minLength: 1
                description: Opaque identifier in the authorized workspace and environment.
              consent_purposes:
                minItems: 1
        - if:
            properties:
              action:
                const: connect_source
          then:
            properties:
              code:
                const: source_missing
              integration_id:
                type: string
                minLength: 1
                description: Opaque identifier in the authorized workspace and environment.
              consent_purposes:
                minItems: 1
        - if:
            properties:
              action:
                const: upload_document
          then:
            properties:
              code:
                const: document_required
              document_type:
                type: string
                minLength: 1
              accepted_mime_types:
                minItems: 1
        - if:
            properties:
              action:
                const: contact_support
          then:
            properties:
              code:
                const: contact_support
    CreateOrigination:
      type: object
      properties:
        borrower_id:
          type: string
          minLength: 1
          description: >-
            Opaque identifier, authorized within the API key workspace and
            environment.
        application:
          $ref: '#/components/schemas/ApplicationInput'
          description: >-
            Application for CreateOrigination. Constraints, requiredness and
            allowed values are defined by this schema.
        lending_product_version_id:
          type: string
          minLength: 1
          description: >-
            Opaque identifier, authorized within the API key workspace and
            environment.
        risk_policy_version_id:
          type: string
          minLength: 1
          description: >-
            Opaque identifier, authorized within the API key workspace and
            environment.
        connection_ids:
          type: array
          items:
            type: string
            minLength: 1
            description: >-
              Opaque identifier, authorized within the API key workspace and
              environment.
          uniqueItems: true
          description: >-
            Connection ids for CreateOrigination. Constraints, requiredness and
            allowed values are defined by this schema.
        document_ids:
          type: array
          items:
            type: string
            minLength: 1
            description: >-
              Opaque identifier, authorized within the API key workspace and
              environment.
          uniqueItems: true
          description: >-
            Available borrower-context documents owned by the primary borrower.
            Upload first, wait until each Document.status is available, then
            include its ID here. Processing or rejected files return 422; a
            borrower-only upload is not associated automatically. Related-party
            files belong in participants[].document_ids.
        supersedes_origination_id:
          type: string
          minLength: 1
          description: >-
            For a new assessment attempt of an existing application, provide the
            latest terminal origination for the same borrower and
            institution_reference. Omit for the first attempt.
      required:
        - borrower_id
        - application
        - lending_product_version_id
        - risk_policy_version_id
        - connection_ids
        - document_ids
      additionalProperties: false
      description: >-
        AMLOK resolves authorized source data, coverage, verification and
        calculations. Clients do not provide workflow IDs, manifests or
        processing_context. Validate product, policy, currency, market and
        borrower-type compatibility.
    Borrower:
      type: object
      properties:
        id:
          type: string
          minLength: 1
          description: >-
            Opaque identifier, authorized within the API key workspace and
            environment.
        type:
          type: string
          enum:
            - business
            - person
          description: >-
            Type for Borrower. Constraints, requiredness and allowed values are
            defined by this schema.
        subject_id:
          type: string
          minLength: 1
          description: >-
            Canonical business (biz_) or person (person_) identity used by
            normalized records, verification and billing. Use id (bor_) with
            public borrower routes.
        created_at:
          type: string
          minLength: 1
          format: date-time
          description: UTC time the record was created.
        client_reference:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          description: >-
            Client reference for Borrower. Constraints, requiredness and allowed
            values are defined by this schema.
        profile:
          $ref: '#/components/schemas/CreateBorrower'
          description: >-
            Profile for Borrower. Constraints, requiredness and allowed values
            are defined by this schema.
        lifecycle_status:
          type: string
          enum:
            - active
            - archived
          description: >-
            Profile availability, independent of underwriting and monitoring
            outcomes. Archived profiles cannot start intake or product activity;
            restore with PATCH.
        archived_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        updated_at:
          type: string
          format: date-time
        record_version:
          type: integer
          minimum: 1
        profile_version:
          type: integer
          minimum: 1
          description: >-
            Identity-profile revision. Changes only when supplied identity
            fields change; lifecycle-only changes increment record_version
            instead.
      required:
        - id
        - type
        - subject_id
        - created_at
        - client_reference
        - profile
        - lifecycle_status
        - archived_at
        - updated_at
        - record_version
        - profile_version
      additionalProperties: false
    ParticipantSnapshot:
      type: object
      properties:
        borrower_id:
          type: string
          minLength: 1
          description: >-
            Separate related-party borrower ID; cannot be the primary borrower
            or repeated in the same participant list.
        roles:
          type: array
          items:
            type: string
            enum:
              - owner
              - controller
              - guarantor
              - related_party
          minItems: 1
          uniqueItems: true
        ownership_share:
          anyOf:
            - type: string
              pattern: ^(?:100(?:\.0+)?|(?:0|[1-9][0-9]?)(?:\.[0-9]+)?)$
              description: >-
                Declared ownership percentage from 0 to 100, not a verified
                fact; null when not supplied or not applicable.
            - type: 'null'
        authority:
          $ref: '#/components/schemas/ParticipantAuthority'
        connection_ids:
          type: array
          items:
            type: string
            minLength: 1
          uniqueItems: true
          description: >-
            Sources owned by this participant; each must have active consent for
            this product purpose.
          maxItems: 100
        document_ids:
          type: array
          items:
            type: string
            minLength: 1
          uniqueItems: true
          description: Available borrower-context documents owned by this participant.
          maxItems: 100
        borrower_snapshot:
          $ref: '#/components/schemas/Borrower'
          description: >-
            Exact institution-supplied identity used at acceptance or
            evaluation, not an assertion of successful identity verification.
        borrower_profile_version:
          type: integer
          minimum: 1
      required:
        - borrower_id
        - roles
        - ownership_share
        - authority
        - connection_ids
        - document_ids
        - borrower_snapshot
        - borrower_profile_version
      additionalProperties: false
    CapacityErrorDetail:
      type: object
      properties:
        group:
          type: string
          enum:
            - http
            - origination
            - monitoring
            - export
        reason:
          type: string
          enum:
            - in_flight_limit
            - queue_full
        limit:
          type: integer
          minimum: 0
          maximum: 9007199254740991
          description: Effective admission limit.
        profile_id:
          type: string
          minLength: 1
        profile_version:
          type: string
          minLength: 1
      required:
        - group
        - reason
        - limit
        - profile_id
        - profile_version
      additionalProperties: false
    LargeResponseRecovery:
      type: object
      properties:
        export_request:
          $ref: '#/components/schemas/CreateExport'
        summary_available:
          type: boolean
        snapshot_expires_at:
          anyOf:
            - type: string
              minLength: 1
              format: date-time
            - type: 'null'
        data_checkpoint:
          anyOf:
            - $ref: '#/components/schemas/DataCheckpoint'
            - type: 'null'
      required:
        - export_request
        - summary_available
        - snapshot_expires_at
        - data_checkpoint
      additionalProperties: false
      description: >-
        Complete authorized export source captured before the failed response.
        Existing export scopes and source permissions still apply. Snapshot
        expiry is null for immutable package/record sources; create snapshot
        exports before expiry.
    ApplicationInput:
      type: object
      properties:
        institution_reference:
          type: string
          minLength: 1
          description: >-
            Institution reference for ApplicationInput. Constraints,
            requiredness and allowed values are defined by this schema.
        requested_amount:
          $ref: '#/components/schemas/Money'
          description: >-
            Requested amount for ApplicationInput. Constraints, requiredness and
            allowed values are defined by this schema.
        requested_term_months:
          type: integer
          minimum: 1
          description: >-
            Requested term months for ApplicationInput. Constraints,
            requiredness and allowed values are defined by this schema.
        purpose:
          type: string
          minLength: 1
          description: >-
            Purpose for ApplicationInput. Constraints, requiredness and allowed
            values are defined by this schema.
        declared_data:
          type: object
          description: >-
            Institution-defined application fields validated against
            application_schema_id; additionalProperties here does not bypass
            that schema.
        application_schema_id:
          type: string
          minLength: 1
          description: >-
            Opaque identifier, authorized within the API key workspace and
            environment.
        related_borrower_ids:
          type: array
          items:
            type: string
            minLength: 1
            description: >-
              Opaque identifier, authorized within the API key workspace and
              environment.
          uniqueItems: true
          description: >-
            Optional correlation list. When nonempty, it must exactly match
            participants[].borrower_id. An ID alone never requests or proves a
            related-person verification.
        participants:
          type: array
          items:
            $ref: '#/components/schemas/ParticipantInput'
          description: >-
            Explicit related-party roles, authority and evidence. Omit or use []
            when no related party is submitted. For a Signal portfolio baseline,
            these participants are used when CreateMonitor.participants is
            omitted; if both are supplied their definitions must match (set
            ordering is ignored). Continuous-monitoring authority and source
            consent are required for Signal.
          maxItems: 100
      required:
        - institution_reference
        - requested_amount
        - requested_term_months
        - purpose
        - application_schema_id
        - declared_data
      additionalProperties: false
    CreateBorrower:
      oneOf:
        - type: object
          properties:
            type:
              const: business
            business:
              $ref: '#/components/schemas/BusinessInput'
          required:
            - type
            - business
          additionalProperties: false
          title: Business borrower
        - type: object
          properties:
            type:
              const: person
            person:
              $ref: '#/components/schemas/PersonInput'
          required:
            - type
            - person
          additionalProperties: false
          title: Person borrower or related party
    ParticipantAuthority:
      type: object
      properties:
        basis:
          const: institution_attested
          description: >-
            The institution attests legal authority to submit this participant.
            This is not provider verification and does not replace source
            consent.
        attested_at:
          type: string
          format: date-time
          description: When authority was attested; must not be in the future.
        purposes:
          type: array
          items:
            type: string
            enum:
              - credit_assessment
              - continuous_monitoring
          minItems: 1
          uniqueItems: true
      required:
        - basis
        - attested_at
        - purposes
      additionalProperties: false
    CreateExport:
      type: object
      properties:
        kind:
          type: string
          enum:
            - risk_package
            - evidence
            - billing
            - data
          description: >-
            Kind for CreateExport. Constraints, requiredness and allowed values
            are defined by this schema.
        risk_package_id:
          type: string
          minLength: 1
          description: >-
            Opaque identifier, authorized within the API key workspace and
            environment.
        evidence_set_id:
          type: string
          minLength: 1
          description: >-
            Opaque identifier, authorized within the API key workspace and
            environment.
        billing_report_type:
          type: string
          enum:
            - usage
            - credits
            - statements
            - funding
            - rates
            - workload
          description: >-
            Billing report type for CreateExport. Constraints, requiredness and
            allowed values are defined by this schema.
        window:
          $ref: '#/components/schemas/Window'
          description: >-
            Window for CreateExport. Constraints, requiredness and allowed
            values are defined by this schema.
        format:
          type: string
          enum:
            - json
            - csv
            - pdf
          description: >-
            Format for CreateExport. Constraints, requiredness and allowed
            values are defined by this schema.
        data_snapshot_id:
          type: string
          minLength: 1
          description: Opaque ID within the authorized workspace and environment.
        data_record_id:
          type: string
          minLength: 1
          description: >-
            Exact immutable DataRecord version, alternative to data_snapshot_id
            for kind=data.
      required:
        - kind
        - format
      additionalProperties: false
      oneOf:
        - properties:
            kind:
              const: risk_package
            format:
              type: string
              enum:
                - json
                - pdf
          required:
            - risk_package_id
          not:
            anyOf:
              - required:
                  - evidence_set_id
              - required:
                  - billing_report_type
              - required:
                  - window
              - required:
                  - data_snapshot_id
              - required:
                  - data_record_id
          title: Risk-package export
        - properties:
            kind:
              const: evidence
            format:
              type: string
              enum:
                - json
                - csv
          required:
            - evidence_set_id
          not:
            anyOf:
              - required:
                  - risk_package_id
              - required:
                  - billing_report_type
              - required:
                  - window
              - required:
                  - data_snapshot_id
              - required:
                  - data_record_id
          title: Evidence export
        - properties:
            kind:
              const: billing
            format:
              type: string
              enum:
                - json
                - csv
          required:
            - billing_report_type
            - window
          not:
            anyOf:
              - required:
                  - risk_package_id
              - required:
                  - evidence_set_id
              - required:
                  - data_snapshot_id
              - required:
                  - data_record_id
          title: Billing export
        - title: Collected data export
          properties:
            kind:
              const: data
            format:
              type: string
              enum:
                - json
                - csv
          required: []
          not:
            anyOf:
              - required:
                  - risk_package_id
              - required:
                  - evidence_set_id
              - required:
                  - billing_report_type
              - required:
                  - window
          oneOf:
            - required:
                - data_snapshot_id
              not:
                required:
                  - data_record_id
            - required:
                - data_record_id
              not:
                required:
                  - data_snapshot_id
    DataCheckpoint:
      type: object
      properties:
        snapshot_id:
          type: string
          minLength: 1
        as_of:
          type: string
          minLength: 1
          format: date-time
        changes_cursor:
          type: string
          minLength: 1
        expires_at:
          type: string
          minLength: 1
          format: date-time
      required:
        - snapshot_id
        - as_of
        - changes_cursor
        - expires_at
      additionalProperties: false
      description: >-
        Atomic data snapshot and feed boundary retained even when the first
        record exceeds the response limit.
    Money:
      type: object
      properties:
        amount:
          type: string
          minLength: 1
          pattern: ^(?:0|[1-9][0-9]*)\.[0-9]{2}$
          description: >-
            Amount for Money. Constraints, requiredness and allowed values are
            defined by this schema.
        currency:
          type: string
          minLength: 1
          pattern: ^[A-Z]{3}$
          description: >-
            Currency for Money. Constraints, requiredness and allowed values are
            defined by this schema.
      required:
        - amount
        - currency
      additionalProperties: false
    ParticipantInput:
      type: object
      properties:
        borrower_id:
          type: string
          minLength: 1
          description: >-
            Separate related-party borrower ID; cannot be the primary borrower
            or repeated in the same participant list.
        roles:
          type: array
          items:
            type: string
            enum:
              - owner
              - controller
              - guarantor
              - related_party
          minItems: 1
          uniqueItems: true
        ownership_share:
          anyOf:
            - type: string
              pattern: ^(?:100(?:\.0+)?|(?:0|[1-9][0-9]?)(?:\.[0-9]+)?)$
              description: >-
                Declared ownership percentage from 0 to 100, not a verified
                fact; null when not supplied or not applicable.
            - type: 'null'
        authority:
          $ref: '#/components/schemas/ParticipantAuthority'
        connection_ids:
          type: array
          items:
            type: string
            minLength: 1
          uniqueItems: true
          description: >-
            Sources owned by this participant; each must have active consent for
            this product purpose.
          maxItems: 100
        document_ids:
          type: array
          items:
            type: string
            minLength: 1
          uniqueItems: true
          description: Available borrower-context documents owned by this participant.
          maxItems: 100
      required:
        - borrower_id
        - roles
        - ownership_share
        - authority
        - connection_ids
        - document_ids
      additionalProperties: false
    BusinessInput:
      type: object
      properties:
        legal_name:
          type: string
          minLength: 1
          description: Client-asserted legal name.
        client_reference:
          type: string
          minLength: 1
          description: >-
            Stable institution-owned identity reference, unique by borrower type
            within workspace/environment. Reuse the borrower across
            applications; lookup with GET /v1/borrowers?client_reference=.
            Immutable once created.
        registration_number:
          type: string
          minLength: 1
          description: Company or registry registration identifier.
        incorporation_country:
          type: string
          minLength: 1
          description: Country of formation.
      required:
        - legal_name
      additionalProperties: false
    PersonInput:
      type: object
      properties:
        given_name:
          type: string
          minLength: 1
          description: Authorized individual given name.
        family_name:
          type: string
          minLength: 1
          description: Authorized individual family name.
        email:
          type: string
          minLength: 1
          description: Contact email.
        phone:
          type: string
          minLength: 1
          description: Contact telephone.
        residence_country:
          type: string
          minLength: 1
          description: Current country of residence when established.
        client_reference:
          type: string
          minLength: 1
          description: >-
            Institution borrower reference, unique by borrower type in the
            workspace/environment when supplied.
      required:
        - given_name
        - family_name
      additionalProperties: false
    Window:
      type: object
      properties:
        start:
          type: string
          minLength: 1
          format: date-time
          description: >-
            Start for Window. Constraints, requiredness and allowed values are
            defined by this schema.
        end:
          type: string
          minLength: 1
          format: date-time
          description: >-
            End for Window. Constraints, requiredness and allowed values are
            defined by this schema.
      required:
        - start
        - end
      additionalProperties: false
      description: UTC interval [start, end). The server rejects end <= start.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: >-
        Server-to-server API key bound to exactly one workspace, institution
        tenant and environment. No caller-supplied workspace override is
        accepted. Do not use in public browser code.

````

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