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

# Start workflow run

> Run a coordinated risk workflow.

Required scope: `workflows:execute`. AMLOK returns evidence and assessment results. The institution performs all borrower outreach and intervention in its own systems. Once account cancellation is submitted, processing and usage deductions stop immediately. Reject new operational commands with 409 invalid_state; pending work is cancelled without another debit. Read-only reporting remains available until workspace deletion. Billable work requires available credits covering its cost; otherwise return 402 insufficient_credits before accepting work, with no debit. A separately requested full underwriting uses Insights. Signal change-driven reassessment is included in Signal and does not create an additional Insights charge. A root underwrite request is a full Insights underwriting and requires application_id and input_manifest_id. Other workflow types require processing_context and are included stages. Signal reassessment is a Signal child run, never a separately billed root underwrite. Workload checks reject known over-limit inputs with 422 workload_limit_exceeded. If discovery reveals more records later, pause as blocked_by_limit before processing beyond the limit. No automatic tier upgrade occurs. Available credits are checked at acceptance and again atomically with output publication and the one usage debit at successful completion. No credits are reserved. If funds were spent by concurrent work, keep the run waiting_for_credits and withhold its final output; resume without duplicate processing when funded. Cancelled runs never publish or charge. Each evidence manifest is immutable. While an unfinished run waits for required evidence, accepted evidence can create a successor manifest; retain initial_input_manifest_id, update input_manifest_id and record_version, and emit an audit event identifying both manifests. The final snapshot and usage link to the final manifest. This continuation keeps the same run and single charge. Accepted commands have a durable request receipt. Full response replay lasts 24 hours; afterward the same key and target return 409 idempotency_result_expired without re-execution. Different payloads return 409 idempotency_conflict. Use GET /v1/request-receipts/lookup to find the original resource. The fingerprint includes the resolved target path and intended payload; a key used on another target is rejected rather than replayed onto it. Pre-execution validation or insufficient-credit rejection creates no accepted receipt.

**Required scope:** `workflows:execute`

Run a coordinated risk workflow.

Required scope: `workflows:execute`. AMLOK returns evidence and assessment results. The institution performs all borrower outreach and intervention in its own systems. Once account cancellation is submitted, processing and usage deductions stop immediately. Reject new operational commands with 409 invalid\_state; pending work is cancelled without another debit. Read-only reporting remains available until workspace deletion. Billable work requires available credits covering its cost; otherwise return 402 insufficient\_credits before accepting work, with no debit. A separately requested full underwriting uses Insights. Signal change-driven reassessment is included in Signal and does not create an additional Insights charge. A root underwrite request is a full Insights underwriting and requires application\_id and input\_manifest\_id. Other workflow types require processing\_context and are included stages. Signal reassessment is a Signal child run, never a separately billed root underwrite. Workload checks reject known over-limit inputs with 422 workload\_limit\_exceeded. If discovery reveals more records later, pause as blocked\_by\_limit before processing beyond the limit. No automatic tier upgrade occurs. Available credits are checked at acceptance and again atomically with output publication and the one usage debit at successful completion. No credits are reserved. If funds were spent by concurrent work, keep the run waiting\_for\_credits and withhold its final output; resume without duplicate processing when funded. Cancelled runs never publish or charge. Each evidence manifest is immutable. While an unfinished run waits for required evidence, accepted evidence can create a successor manifest; retain initial\_input\_manifest\_id, update input\_manifest\_id and record\_version, and emit an audit event identifying both manifests. The final snapshot and usage link to the final manifest. This continuation keeps the same run and single charge. Accepted commands have a durable request receipt. Full response replay lasts 24 hours; afterward the same key and target return 409 idempotency\_result\_expired without re-execution. Different payloads return 409 idempotency\_conflict. Use GET /v1/request-receipts/lookup to find the original resource. The fingerprint includes the resolved target path and intended payload; a key used on another target is rejected rather than replayed onto it. Pre-execution validation or insufficient-credit rejection creates no accepted receipt.

[Product scope](https://docs.amlok.io/api-reference/products-and-endpoints.md) · [Processing lifecycle](https://docs.amlok.io/api-reference/processing-lifecycle.md) · [Errors](https://docs.amlok.io/api-reference/errors.md)


## OpenAPI

````yaml openapi/amlok-v1.json POST /v1/workflow-runs
openapi: 3.1.0
info:
  title: AMLOK API
  version: 1.4.2
  description: >-
    API reference for AMLOK 1.4.2, with example requests and responses.
    Configure your institution-issued environment URL before making requests.
  x-source-workbook: >-
    https://docs.google.com/spreadsheets/d/14pU2PLv9JDda8gAa1367hipa2oJQB260fIJthevrp10/edit
servers:
  - url: https://api.example.com
    description: Set the server URL to your institution-issued AMLOK environment URL.
security:
  - BearerAuth: []
tags:
  - name: Platform
    description: Platform operations.
  - name: Identity
    description: Identity operations.
  - name: Banking
    description: Banking operations.
  - name: Payments
    description: Payments operations.
  - name: Commerce
    description: Commerce operations.
  - name: Accounting
    description: Accounting operations.
  - name: Inventory
    description: Inventory operations.
  - name: Lending
    description: Lending operations.
  - name: Liens
    description: Liens operations.
  - name: Risk
    description: Risk operations.
  - name: Operations
    description: Operations operations.
  - name: Webhooks
    description: Webhooks operations.
  - name: Reporting
    description: Reporting operations.
paths:
  /v1/workflow-runs:
    post:
      tags:
        - Operations
      summary: Start workflow run
      description: >-
        Run a coordinated risk workflow.


        Required scope: `workflows:execute`. AMLOK returns evidence and
        assessment results. The institution performs all borrower outreach and
        intervention in its own systems. Once account cancellation is submitted,
        processing and usage deductions stop immediately. Reject new operational
        commands with 409 invalid_state; pending work is cancelled without
        another debit. Read-only reporting remains available until workspace
        deletion. Billable work requires available credits covering its cost;
        otherwise return 402 insufficient_credits before accepting work, with no
        debit. A separately requested full underwriting uses Insights. Signal
        change-driven reassessment is included in Signal and does not create an
        additional Insights charge. A root underwrite request is a full Insights
        underwriting and requires application_id and input_manifest_id. Other
        workflow types require processing_context and are included stages.
        Signal reassessment is a Signal child run, never a separately billed
        root underwrite. Workload checks reject known over-limit inputs with 422
        workload_limit_exceeded. If discovery reveals more records later, pause
        as blocked_by_limit before processing beyond the limit. No automatic
        tier upgrade occurs. Available credits are checked at acceptance and
        again atomically with output publication and the one usage debit at
        successful completion. No credits are reserved. If funds were spent by
        concurrent work, keep the run waiting_for_credits and withhold its final
        output; resume without duplicate processing when funded. Cancelled runs
        never publish or charge. Each evidence manifest is immutable. While an
        unfinished run waits for required evidence, accepted evidence can create
        a successor manifest; retain initial_input_manifest_id, update
        input_manifest_id and record_version, and emit an audit event
        identifying both manifests. The final snapshot and usage link to the
        final manifest. This continuation keeps the same run and single charge.
        Accepted commands have a durable request receipt. Full response replay
        lasts 24 hours; afterward the same key and target return 409
        idempotency_result_expired without re-execution. Different payloads
        return 409 idempotency_conflict. Use GET /v1/request-receipts/lookup to
        find the original resource. The fingerprint includes the resolved target
        path and intended payload; a key used on another target is rejected
        rather than replayed onto it. Pre-execution validation or
        insufficient-credit rejection creates no accepted receipt.
      operationId: EP147
      parameters:
        - name: X-Request-ID
          in: header
          required: false
          description: >-
            Optional caller correlation ID; the response includes AMLOK
            request_id.
          schema:
            type: string
          example: client-request-example
        - name: Idempotency-Key
          in: header
          required: true
          description: >-
            Reuse for retries of the same intended command and identical
            payload. Retention: 24 hours.
          schema:
            type: string
          example: idem_example_1001
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EP147Request'
            example:
              subject_id: biz_example
              workflow_type: underwrite
              workflow_version: underwrite-v1
              input_resource_ids:
                - app_example
                - doc_example
              application_id: app_example
              input_manifest_id: manifest_example
      responses:
        '202':
          description: Run a coordinated risk workflow. Accepted work is not yet complete.
          headers:
            X-Request-ID:
              description: AMLOK response correlation identifier.
              schema:
                type: string
              example: req_example
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/WorkflowRun'
                  meta:
                    $ref: '#/components/schemas/ResponseMeta'
                required:
                  - data
                  - meta
              examples:
                synthetic:
                  summary: Synthetic start workflow run
                  value:
                    data:
                      id: wfr_example
                      object: workflow_run
                      subject_id: biz_example
                      created_at: '2026-10-22T13:00:00Z'
                      updated_at: '2026-10-22T14:00:00Z'
                      record_version: 1
                      source_refs: []
                      data_status: pending
                      missing_fields: []
                      schema_version: 1.4.2
                      workflow_type: underwrite
                      workflow_version: underwrite-v1
                      status: queued
                      input_resource_ids:
                        - app_example
                        - doc_example
                      output_resource_ids: []
                      application_id: app_example
                      product: insights
                      input_manifest_id: manifest_example
                      initial_input_manifest_id: manifest_example
                      workload_id: workload_example
                      billing_usage_id: null
                      monitoring_period_id: null
                      blocked_reason: null
                      stop_reason: null
                      failure: null
                      attempt: 1
                    meta:
                      request_id: req_example
                      schema_version: 1.4.2
                      generated_at: '2026-10-23T14:00:00Z'
                      data_status: pending
        '400':
          $ref: '#/components/responses/Error400'
        '401':
          $ref: '#/components/responses/Error401'
        '402':
          $ref: '#/components/responses/Error402'
        '403':
          $ref: '#/components/responses/Error403'
        '404':
          $ref: '#/components/responses/Error404'
        '409':
          $ref: '#/components/responses/Error409'
        '410':
          $ref: '#/components/responses/Error410'
        '422':
          $ref: '#/components/responses/Error422'
        '429':
          $ref: '#/components/responses/Error429'
        '500':
          $ref: '#/components/responses/Error500'
        '502':
          $ref: '#/components/responses/Error502'
        '503':
          $ref: '#/components/responses/Error503'
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |-
            curl --request POST --fail-with-body --max-time 30 \
              "${AMLOK_API_BASE_URL}/v1/workflow-runs" \
              --header "Authorization: Bearer ${AMLOK_API_KEY}" \
              --header "Accept: application/json" \
              --header 'Idempotency-Key: idem_example_1001' \
              --header 'Content-Type: application/json' \
              --data '{
              "subject_id": "biz_example",
              "workflow_type": "underwrite",
              "workflow_version": "underwrite-v1",
              "input_resource_ids": [
                "app_example",
                "doc_example"
              ],
              "application_id": "app_example",
              "input_manifest_id": "manifest_example"
            }'
        - lang: Python
          source: |-
            import os
            import requests

            base_url = os.environ["AMLOK_API_BASE_URL"].rstrip("/")
            headers = {'Accept': 'application/json',
             'Idempotency-Key': 'idem_example_1001',
             'Content-Type': 'application/json'}
            headers["Authorization"] = "Bearer " + os.environ["AMLOK_API_KEY"]

            response = requests.request(
                "POST", base_url + "/v1/workflow-runs",
                headers=headers, timeout=30, allow_redirects=False,
                json={'subject_id': 'biz_example',
             'workflow_type': 'underwrite',
             'workflow_version': 'underwrite-v1',
             'input_resource_ids': ['app_example', 'doc_example'],
             'application_id': 'app_example',
             'input_manifest_id': 'manifest_example'},
            )
            response.raise_for_status()
            print(response.json())
        - lang: JavaScript
          label: Node.js
          source: >-

            const baseUrl = process.env.AMLOK_API_BASE_URL;

            const apiKey = process.env.AMLOK_API_KEY;

            if (!baseUrl || !apiKey) throw new Error("Configure
            AMLOK_API_BASE_URL and AMLOK_API_KEY");

            const headers = {
              "Accept": "application/json",
              "Idempotency-Key": "idem_example_1001",
              "Content-Type": "application/json"
            };

            headers.Authorization = `Bearer ${apiKey}`;

            const response = await fetch(baseUrl.replace(/\/$/, "") +
            "/v1/workflow-runs", {
              method: "POST", headers,
              redirect: "error", signal: AbortSignal.timeout(30000),
              body: JSON.stringify({
              "subject_id": "biz_example",
              "workflow_type": "underwrite",
              "workflow_version": "underwrite-v1",
              "input_resource_ids": [
                "app_example",
                "doc_example"
              ],
              "application_id": "app_example",
              "input_manifest_id": "manifest_example"
            }),

            });

            if (!response.ok) throw new Error(`AMLOK returned HTTP
            ${response.status}`);

            console.log(await response.json());
components:
  schemas:
    EP147Request:
      type: object
      properties:
        subject_id:
          type: string
          minLength: 1
          description: Primary workflow subject.
        workflow_type:
          $ref: '#/components/schemas/Enum_workflow_type'
          description: One of four assessment workflow types.
        workflow_version:
          type: string
          minLength: 1
          description: >-
            Approved ID from GET /v1/configuration workflow_versions, matching
            this workflow type and product.
        input_resource_ids:
          type: array
          items:
            type: string
          minItems: 1
          description: Input records authorized for this run.
        application_id:
          type: string
          minLength: 1
          description: Application context if applicable.
        loan_id:
          type: string
          minLength: 1
          description: Loan context if applicable.
        input_manifest_id:
          type: string
          minLength: 1
          description: >-
            Ready immutable initial manifest for this run. All input references
            must exist in this manifest. Its ID is retained as
            initial_input_manifest_id. Accepted missing evidence can produce a
            successor manifest without changing the run or creating another
            charge; the current input_manifest_id and audit event identify it.
        processing_context:
          $ref: '#/components/schemas/ProcessingContext'
      required:
        - subject_id
        - workflow_type
        - workflow_version
        - input_resource_ids
        - input_manifest_id
      additionalProperties: false
      allOf:
        - if:
            properties:
              workflow_type:
                const: underwrite
          then:
            required:
              - application_id
            not:
              required:
                - processing_context
        - if:
            properties:
              workflow_type:
                enum:
                  - verify
                  - monitor
                  - investigate
          then:
            required:
              - processing_context
        - properties:
            processing_context:
              not:
                required:
                  - subject_association_id
    WorkflowRun:
      type: object
      properties:
        id:
          type: string
          description: >-
            Stable identifier scoped to the client tenant. Never use a provider
            ID as the public primary key.
          x-field-id: F0001
          x-classification: Confidential
          x-availability: Required when resource exists
        object:
          type: string
          const: workflow_run
        subject_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Business or person to which this record relates. Null for
            tenant-level configuration and unresolved subjects.
          x-field-id: F0003
          x-classification: Confidential
          x-availability: >-
            Source, module, country, consent and contracted permissions
            determine population.
        created_at:
          type: string
          format: date-time
          description: >-
            Time AMLOK first stored this resource. Preserve original evidence;
            do not invent missing values.
          x-field-id: F0004
          x-classification: Confidential
          x-availability: Required when resource exists
        updated_at:
          type: string
          format: date-time
          description: >-
            Time the normalized representation last changed. Preserve original
            evidence; do not invent missing values.
          x-field-id: F0005
          x-classification: Confidential
          x-availability: Required when resource exists
        observed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          description: >-
            Time the source was observed by AMLOK. Do not imply this is the
            economic event time.
          x-field-id: F0006
          x-classification: Confidential
          x-availability: >-
            Source, module, country, consent and contracted permissions
            determine population.
        effective_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          description: >-
            Time the source states this version became valid. Preserve original
            evidence; do not invent missing values.
          x-field-id: F0007
          x-classification: Confidential
          x-availability: >-
            Source, module, country, consent and contracted permissions
            determine population.
        record_version:
          type: integer
          description: >-
            Monotonically increasing AMLOK version for this resource. Preserve
            original evidence; do not invent missing values.
          x-field-id: F0008
          x-classification: Confidential
          x-availability: Required when resource exists
        deleted_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          description: >-
            Tombstone timestamp for a source or AMLOK deletion. Null for records
            not deleted; retain only under the configured policy.
          x-field-id: F0009
          x-classification: Confidential
          x-availability: >-
            Source, module, country, consent and contracted permissions
            determine population.
        source_refs:
          type: array
          items:
            $ref: '#/components/schemas/SourceRef'
          description: >-
            Evidence references contributing to this record. A known empty array
            is valid for a newly client-created record.
          x-field-id: F0010
          x-classification: Confidential
          x-availability: Required when resource exists
        field_provenance:
          anyOf:
            - type: array
              items:
                $ref: '#/components/schemas/FieldProvenance'
            - type: 'null'
          description: >-
            Field-level source, extraction, transformation and quality details.
            Preserve original evidence; do not invent missing values.
          x-field-id: F0011
          x-classification: Confidential
          x-availability: >-
            Source, module, country, consent and contracted permissions
            determine population.
        data_status:
          $ref: '#/components/schemas/Enum_data_status'
          description: >-
            Whether the requested resource is complete for its stated scope.
            Completeness is relative to declared fields, sources and time
            interval.
          x-field-id: F0012
          x-classification: Confidential
          x-availability: Required when resource exists
        missing_fields:
          type: array
          items:
            $ref: '#/components/schemas/MissingField'
          description: >-
            Unavailable field paths and their explicit reasons. Preserve
            original evidence; do not invent missing values.
          x-field-id: F0013
          x-classification: Confidential
          x-availability: Required when resource exists
        schema_version:
          type: string
          description: >-
            Contract version used to serialize this record. Preserve original
            evidence; do not invent missing values.
          x-field-id: F0014
          x-classification: Confidential
          x-availability: Required when resource exists
        client_reference:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Optional caller-owned correlation identifier. Scoped to tenant;
            uniqueness only when explicitly contracted.
          x-field-id: F0015
          x-classification: Confidential
          x-availability: >-
            Source, module, country, consent and contracted permissions
            determine population.
        extensions:
          anyOf:
            - type: object
              additionalProperties: true
            - type: 'null'
          description: >-
            Namespaced extra provider fields without changing the core schema.
            Access-controlled and documented per provider; no provider tokens.
          x-field-id: F0016
          x-classification: Restricted
          x-availability: >-
            Source, module, country, consent and contracted permissions
            determine population.
        workflow_type:
          $ref: '#/components/schemas/Enum_workflow_type'
          description: >-
            Risk workflow category. Preserve original evidence; do not invent
            missing values.
          x-field-id: F0946
          x-classification: Confidential
          x-availability: Required when resource exists
        workflow_version:
          type: string
          description: >-
            Version of the orchestration definition. Preserve original evidence;
            do not invent missing values.
          x-field-id: F0947
          x-classification: Confidential
          x-availability: Required when resource exists
        status:
          $ref: '#/components/schemas/Enum_workflow_status'
          description: >-
            Execution state. Preserve original evidence; do not invent missing
            values.
          x-field-id: F0948
          x-classification: Confidential
          x-availability: Required when resource exists
        application_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Application context if applicable. Preserve original evidence; do
            not invent missing values.
          x-field-id: F0949
          x-classification: Confidential
          x-availability: >-
            Source, module, country, consent and contracted permissions
            determine population.
        loan_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Loan context if applicable. Preserve original evidence; do not
            invent missing values.
          x-field-id: F0950
          x-classification: Confidential
          x-availability: >-
            Source, module, country, consent and contracted permissions
            determine population.
        input_resource_ids:
          type: array
          items:
            type: string
          description: >-
            Immutable input references. Preserve original evidence; do not
            invent missing values.
          x-field-id: F0951
          x-classification: Confidential
          x-availability: Required when resource exists
        output_resource_ids:
          type: array
          items:
            type: string
          description: >-
            Produced assessments, checks, risk findings or reports. Preserve
            original evidence; do not invent missing values.
          x-field-id: F0952
          x-classification: Confidential
          x-availability: Required when resource exists
        started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          description: >-
            Execution start. Preserve original evidence; do not invent missing
            values.
          x-field-id: F0954
          x-classification: Confidential
          x-availability: >-
            Source, module, country, consent and contracted permissions
            determine population.
        completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          description: >-
            Terminal completion time. Preserve original evidence; do not invent
            missing values.
          x-field-id: F0955
          x-classification: Confidential
          x-availability: >-
            Source, module, country, consent and contracted permissions
            determine population.
        parent_run_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Run that triggered this one, such as Monitor re-entering Underwrite.
            Preserve original evidence; do not invent missing values.
          x-field-id: F0956
          x-classification: Confidential
          x-availability: >-
            Source, module, country, consent and contracted permissions
            determine population.
        product:
          type: string
          enum:
            - insights
            - signal
        input_manifest_id:
          type: string
          minLength: 1
        initial_input_manifest_id:
          type: string
          minLength: 1
        workload_id:
          type: string
          minLength: 1
        billing_usage_id:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
        monitoring_period_id:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
        blocked_reason:
          anyOf:
            - type: string
              enum:
                - insufficient_credits
                - workload_limit_exceeded
                - missing_evidence
            - type: 'null'
        stop_reason:
          anyOf:
            - type: string
              enum:
                - account_cancellation
                - parent_cancelled
                - consent_revoked
            - type: 'null'
        failure:
          anyOf:
            - $ref: '#/components/schemas/ProcessingFailure'
            - type: 'null'
        attempt:
          type: integer
          minimum: 1
      required:
        - id
        - object
        - created_at
        - updated_at
        - record_version
        - source_refs
        - data_status
        - missing_fields
        - schema_version
        - workflow_type
        - workflow_version
        - status
        - input_resource_ids
        - output_resource_ids
        - product
        - input_manifest_id
        - initial_input_manifest_id
        - workload_id
        - billing_usage_id
        - monitoring_period_id
        - blocked_reason
        - stop_reason
        - failure
        - attempt
      title: workflow_run
      description: >-
        Coordinated execution of Verify, Underwrite, Monitor or Investigate.
        Population depends on source and tenant entitlement.
      allOf:
        - if:
            properties:
              status:
                const: failed
            required:
              - status
          then:
            properties:
              failure:
                $ref: '#/components/schemas/ProcessingFailure'
              billing_usage_id:
                type: 'null'
              output_resource_ids:
                maxItems: 0
          else:
            properties:
              failure:
                type: 'null'
    ResponseMeta:
      type: object
      properties:
        request_id:
          type: string
          description: AMLOK request correlation ID.
        schema_version:
          type: string
          description: Serialization contract version.
        generated_at:
          type: string
          format: date-time
          description: Response generation time, not source data freshness.
        data_status:
          $ref: '#/components/schemas/Enum_data_status'
          description: Completeness of this response within its declared scope.
        coverage:
          anyOf:
            - $ref: '#/components/schemas/Coverage'
            - type: 'null'
          description: Requested and achieved source/time coverage.
      required:
        - request_id
        - schema_version
        - generated_at
        - data_status
    Enum_workflow_type:
      type: string
      enum:
        - verify
        - underwrite
        - monitor
        - investigate
    ProcessingContext:
      oneOf:
        - type: object
          properties:
            product:
              const: insights
              type: string
            workflow_run_id:
              type: string
              minLength: 1
            subject_association_id:
              type: string
              minLength: 1
          required:
            - product
            - workflow_run_id
          additionalProperties: false
        - type: object
          properties:
            product:
              const: signal
              type: string
            monitoring_period_id:
              type: string
              minLength: 1
            subject_association_id:
              type: string
              minLength: 1
          required:
            - product
            - monitoring_period_id
          additionalProperties: false
      discriminator:
        propertyName: product
      description: >-
        Parent must belong to this workspace. Same-subject stages need no
        association. Only person KYC may target a different subject: supply an
        active subject_association_id linking that person to the parent
        business. Insights requires an unfinished authorized root run; Signal
        requires an active paid period. Stage scope, consent, association and
        workload are checked on every attempt. The parent business remains the
        billing and workload subject. No standalone service or extra charge.
    SourceRef:
      type: object
      properties:
        provider_id:
          type: string
          description: >-
            Inventory or supplemental provider identifier; AMLOK or CLIENT for
            internal evidence.
        connection_id:
          anyOf:
            - type: string
            - type: 'null'
          description: Authorized provider connection.
        source_record_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Upstream record identifier scoped by provider, connection and record
            type.
        source_record_type:
          anyOf:
            - type: string
            - type: 'null'
          description: Provider object or report type.
        source_updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          description: Source update time; do not replace with retrieval time.
        retrieved_at:
          type: string
          format: date-time
          description: Time AMLOK retrieved this evidence.
        document_id:
          anyOf:
            - type: string
            - type: 'null'
          description: Evidence document when applicable.
        source_api_version:
          anyOf:
            - type: string
            - type: 'null'
          description: Version of provider API/schema used.
      required:
        - provider_id
        - retrieved_at
    FieldProvenance:
      type: object
      properties:
        field_path:
          type: string
          description: Relative path in the normalized resource.
        source_ref_index:
          type: integer
          description: Zero-based index into source_refs.
        source_field_path:
          anyOf:
            - type: string
            - type: 'null'
          description: Actual field path or document locator.
        transformation_id:
          anyOf:
            - type: string
            - type: 'null'
          description: Versioned conversion/mapping rule.
        evidence_level:
          $ref: '#/components/schemas/Enum_evidence_level'
          description: Provenance class for the resulting value.
        confidence:
          anyOf:
            - type: string
              pattern: ^-?(?:0|[1-9][0-9]*)(?:\.[0-9]+)?$
              description: >-
                Exact decimal string in major units. Do not use binary
                floating-point arithmetic.
            - type: 'null'
          description: Calibrated extraction or matching confidence, if available.
        source_timezone:
          anyOf:
            - type: string
            - type: 'null'
          description: Original timezone where needed to interpret local time.
      required:
        - field_path
        - source_ref_index
        - evidence_level
    Enum_data_status:
      type: string
      enum:
        - complete
        - partial
        - unavailable
        - pending
    MissingField:
      type: object
      properties:
        field_path:
          type: string
          description: Unavailable relative field path.
        reason:
          $ref: '#/components/schemas/Enum_null_reason'
          description: Specific reason the field has no value.
        detail:
          anyOf:
            - type: string
            - type: 'null'
          description: Sanitized explanation useful to the caller.
      required:
        - field_path
        - reason
    Enum_workflow_status:
      type: string
      enum:
        - queued
        - running
        - waiting_for_data
        - completed
        - failed
        - cancelled
        - waiting_for_credits
        - blocked_by_limit
    ProcessingFailure:
      type: object
      properties:
        code:
          type: string
          enum:
            - provider_unavailable
            - processing_timeout
            - invalid_evidence
            - unsupported_scope
            - internal_processing_error
        message:
          type: string
          minLength: 1
        retryable:
          type: boolean
        recovery_action:
          type: string
          enum:
            - retry_same_run
            - correct_evidence
            - contact_support
        retry_after_seconds:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
        occurred_at:
          type: string
          format: date-time
        request_id:
          type: string
          minLength: 1
      required:
        - code
        - message
        - retryable
        - recovery_action
        - retry_after_seconds
        - occurred_at
        - request_id
      additionalProperties: false
      allOf:
        - if:
            properties:
              retryable:
                const: true
          then:
            properties:
              recovery_action:
                const: retry_same_run
              retry_after_seconds:
                type: integer
                minimum: 0
          else:
            properties:
              recovery_action:
                type: string
                enum:
                  - correct_evidence
                  - contact_support
              retry_after_seconds:
                type: 'null'
    Coverage:
      type: object
      properties:
        requested_from:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          description: Inclusive start requested.
        requested_to:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          description: Exclusive end requested.
        available_from:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          description: Earliest actual coverage.
        available_to:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          description: Exclusive end of actual coverage.
        source_ids:
          type: array
          items:
            type: string
          description: Sources actually contributing.
        missing_intervals:
          type: array
          items:
            $ref: '#/components/schemas/Interval'
          description: Known gaps within requested scope.
        jurisdictions_completed:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
          description: Completed geographic search scope when applicable.
      required:
        - source_ids
        - missing_intervals
    ErrorEnvelope:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/Error'
        meta:
          $ref: '#/components/schemas/ResponseMeta'
      required:
        - error
        - meta
    Enum_evidence_level:
      type: string
      enum:
        - source_record
        - document_extracted
        - client_asserted
        - derived
        - model_inferred
    Enum_null_reason:
      type: string
      enum:
        - not_provided
        - not_supported
        - not_authorized
        - not_applicable
        - pending
        - redacted
        - source_error
        - invalid
        - insufficient_history
    Interval:
      type: object
      properties:
        from:
          type: string
          format: date
          description: Inclusive interval start.
        to:
          type: string
          format: date
          description: Exclusive interval end.
      required:
        - from
        - to
    Error:
      type: object
      properties:
        code:
          type: string
          description: Stable machine-readable error code.
        message:
          type: string
          description: Safe caller-facing explanation.
        field:
          anyOf:
            - type: string
            - type: 'null'
          description: Invalid request field when relevant.
        retryable:
          type: boolean
          description: Whether retry may succeed without changing the request.
        request_id:
          type: string
          description: Correlation identifier for support.
      required:
        - code
        - message
        - retryable
        - request_id
  responses:
    Error400:
      description: Request failed. Inspect error.code and error.retryable.
      headers:
        X-Request-ID:
          description: AMLOK response correlation identifier.
          schema:
            type: string
          example: req_example
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            invalid_request:
              summary: invalid_request
              value:
                error:
                  code: invalid_request
                  message: Malformed input, unknown parameter or incompatible filters.
                  retryable: false
                  request_id: req_example
                meta:
                  request_id: req_example
                  schema_version: 1.4.2
                  generated_at: '2026-10-23T14:00:00Z'
                  data_status: complete
            unsupported_parameter:
              summary: unsupported_parameter
              value:
                error:
                  code: unsupported_parameter
                  message: Historical query or filter not implemented on this resource.
                  retryable: false
                  request_id: req_example
                meta:
                  request_id: req_example
                  schema_version: 1.4.2
                  generated_at: '2026-10-23T14:00:00Z'
                  data_status: complete
            validation_error:
              summary: validation_error
              value:
                error:
                  code: validation_error
                  message: >-
                    A field, projection, or request value is invalid. Inspect
                    error.field.
                  retryable: false
                  request_id: req_example
                meta:
                  request_id: req_example
                  schema_version: 1.4.2
                  generated_at: '2026-10-23T14:00:00Z'
                  data_status: complete
    Error401:
      description: Request failed. Inspect error.code and error.retryable.
      headers:
        X-Request-ID:
          description: AMLOK response correlation identifier.
          schema:
            type: string
          example: req_example
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            unauthenticated:
              summary: unauthenticated
              value:
                error:
                  code: unauthenticated
                  message: Missing, expired or invalid credential.
                  retryable: false
                  request_id: req_example
                meta:
                  request_id: req_example
                  schema_version: 1.4.2
                  generated_at: '2026-10-23T14:00:00Z'
                  data_status: complete
    Error402:
      description: Request failed. Inspect error.code and error.retryable.
      headers:
        X-Request-ID:
          description: AMLOK response correlation identifier.
          schema:
            type: string
          example: req_example
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            insufficient_credits:
              summary: insufficient_credits
              value:
                error:
                  code: insufficient_credits
                  message: >-
                    Available credits cannot cover this operation. A rejected
                    request creates no charge. Fund the workspace through the
                    portal before retrying.
                  retryable: false
                  request_id: req_example
                meta:
                  request_id: req_example
                  schema_version: 1.4.2
                  generated_at: '2026-10-23T14:00:00Z'
                  data_status: complete
    Error403:
      description: Request failed. Inspect error.code and error.retryable.
      headers:
        X-Request-ID:
          description: AMLOK response correlation identifier.
          schema:
            type: string
          example: req_example
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            forbidden:
              summary: forbidden
              value:
                error:
                  code: forbidden
                  message: Tenant scope or field/product entitlement missing.
                  retryable: false
                  request_id: req_example
                meta:
                  request_id: req_example
                  schema_version: 1.4.2
                  generated_at: '2026-10-23T14:00:00Z'
                  data_status: complete
    Error404:
      description: Request failed. Inspect error.code and error.retryable.
      headers:
        X-Request-ID:
          description: AMLOK response correlation identifier.
          schema:
            type: string
          example: req_example
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            not_found:
              summary: not_found
              value:
                error:
                  code: not_found
                  message: Record does not exist or is not visible in this tenant.
                  retryable: false
                  request_id: req_example
                meta:
                  request_id: req_example
                  schema_version: 1.4.2
                  generated_at: '2026-10-23T14:00:00Z'
                  data_status: complete
    Error409:
      description: Request failed. Inspect error.code and error.retryable.
      headers:
        X-Request-ID:
          description: AMLOK response correlation identifier.
          schema:
            type: string
          example: req_example
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            idempotency_conflict:
              summary: idempotency_conflict
              value:
                error:
                  code: idempotency_conflict
                  message: Same key was reused with different intended input.
                  retryable: false
                  request_id: req_example
                meta:
                  request_id: req_example
                  schema_version: 1.4.2
                  generated_at: '2026-10-23T14:00:00Z'
                  data_status: complete
            invalid_state:
              summary: invalid_state
              value:
                error:
                  code: invalid_state
                  message: >-
                    The operation is unavailable in the current resource or
                    account state. Operational commands are unavailable after
                    cancellation is submitted.
                  retryable: false
                  request_id: req_example
                meta:
                  request_id: req_example
                  schema_version: 1.4.2
                  generated_at: '2026-10-23T14:00:00Z'
                  data_status: complete
    Error410:
      description: Request failed. Inspect error.code and error.retryable.
      headers:
        X-Request-ID:
          description: AMLOK response correlation identifier.
          schema:
            type: string
          example: req_example
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            cursor_expired:
              summary: cursor_expired
              value:
                error:
                  code: cursor_expired
                  message: >-
                    The synchronization cursor has expired. Begin a new
                    synchronization checkpoint and rebuild the collection
                    snapshot.
                  retryable: false
                  request_id: req_example
                meta:
                  request_id: req_example
                  schema_version: 1.4.2
                  generated_at: '2026-10-23T14:00:00Z'
                  data_status: complete
    Error422:
      description: Request failed. Inspect error.code and error.retryable.
      headers:
        X-Request-ID:
          description: AMLOK response correlation identifier.
          schema:
            type: string
          example: req_example
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            invalid_search_scope:
              summary: invalid_search_scope
              value:
                error:
                  code: invalid_search_scope
                  message: Missing or unsupported jurisdiction/search mode.
                  retryable: false
                  request_id: req_example
                meta:
                  request_id: req_example
                  schema_version: 1.4.2
                  generated_at: '2026-10-23T14:00:00Z'
                  data_status: complete
            invalid_money:
              summary: invalid_money
              value:
                error:
                  code: invalid_money
                  message: >-
                    Invalid decimal, missing required currency or incompatible
                    currency pair.
                  retryable: false
                  request_id: req_example
                meta:
                  request_id: req_example
                  schema_version: 1.4.2
                  generated_at: '2026-10-23T14:00:00Z'
                  data_status: complete
            insufficient_evidence:
              summary: insufficient_evidence
              value:
                error:
                  code: insufficient_evidence
                  message: Required decision or metric prerequisites are missing.
                  retryable: false
                  request_id: req_example
                meta:
                  request_id: req_example
                  schema_version: 1.4.2
                  generated_at: '2026-10-23T14:00:00Z'
                  data_status: complete
            workload_limit_exceeded:
              summary: workload_limit_exceeded
              value:
                error:
                  code: workload_limit_exceeded
                  message: >-
                    The agreed workload limit cannot cover this work. No
                    automatic tier upgrade or surcharge occurs. Contact AMLOK to
                    agree expanded scope.
                  retryable: false
                  request_id: req_example
                meta:
                  request_id: req_example
                  schema_version: 1.4.2
                  generated_at: '2026-10-23T14:00:00Z'
                  data_status: complete
    Error429:
      description: Request failed. Inspect error.code and error.retryable.
      headers:
        X-Request-ID:
          description: AMLOK response correlation identifier.
          schema:
            type: string
          example: req_example
        Retry-After:
          description: >-
            Delay in seconds or an HTTP-date. The example is illustrative, not a
            contractual quota.
          schema:
            type: string
          example: '30'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            rate_limited:
              summary: rate_limited
              value:
                error:
                  code: rate_limited
                  message: AMLOK tenant quota or upstream throttle.
                  retryable: true
                  request_id: req_example
                meta:
                  request_id: req_example
                  schema_version: 1.4.2
                  generated_at: '2026-10-23T14:00:00Z'
                  data_status: complete
    Error500:
      description: Request failed. Inspect error.code and error.retryable.
      headers:
        X-Request-ID:
          description: AMLOK response correlation identifier.
          schema:
            type: string
          example: req_example
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            internal_error:
              summary: internal_error
              value:
                error:
                  code: internal_error
                  message: Unexpected AMLOK processing error.
                  retryable: false
                  request_id: req_example
                meta:
                  request_id: req_example
                  schema_version: 1.4.2
                  generated_at: '2026-10-23T14:00:00Z'
                  data_status: complete
    Error502:
      description: Request failed. Inspect error.code and error.retryable.
      headers:
        X-Request-ID:
          description: AMLOK response correlation identifier.
          schema:
            type: string
          example: req_example
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            source_error:
              summary: source_error
              value:
                error:
                  code: source_error
                  message: Upstream returned invalid or failed data.
                  retryable: false
                  request_id: req_example
                meta:
                  request_id: req_example
                  schema_version: 1.4.2
                  generated_at: '2026-10-23T14:00:00Z'
                  data_status: complete
    Error503:
      description: Request failed. Inspect error.code and error.retryable.
      headers:
        X-Request-ID:
          description: AMLOK response correlation identifier.
          schema:
            type: string
          example: req_example
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            source_unavailable:
              summary: source_unavailable
              value:
                error:
                  code: source_unavailable
                  message: Required source temporarily unavailable.
                  retryable: true
                  request_id: req_example
                meta:
                  request_id: req_example
                  schema_version: 1.4.2
                  generated_at: '2026-10-23T14:00:00Z'
                  data_status: complete
  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.