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

# Renew connection authorization

> Create a fresh short-lived authorization action on the existing pending, active or reauth_required connection. Preserve its ID, records and synchronization lineage. The consent must authorize the same subject, provider products and purposes. Validate redirect_uri against portal registration. Bind state to this connection and action; echo it on return. A new action invalidates any older unused action. An identical idempotent retry returns the same action, including its original expiry; use a new key when intentionally replacing an expired action. Reauthorization does not backfill data until a successful sync. Revoked or disconnected connections cannot be reopened; obtain new consent and create a new connection. Account cancellation rejects new processing immediately with 409 invalid_state. Read-only access lasts only until workspace deletion. No separate product charge or financial mutation is introduced. Browser return parameters are connection_id, state and result (completed, cancelled or failed); failed returns a sanitized error_code. Verify the saved state and expected connection, then retrieve the connection server-side. The callback never proves consent or connection activation. No credentials or source data appear in return parameters. The state must be unpredictable, bound to the initiating browser session and accepted only once. 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:** `connections:write`

Create a fresh short-lived authorization action on the existing pending, active or reauth\_required connection. Preserve its ID, records and synchronization lineage. The consent must authorize the same subject, provider products and purposes. Validate redirect\_uri against portal registration. Bind state to this connection and action; echo it on return. A new action invalidates any older unused action. An identical idempotent retry returns the same action, including its original expiry; use a new key when intentionally replacing an expired action. Reauthorization does not backfill data until a successful sync. Revoked or disconnected connections cannot be reopened; obtain new consent and create a new connection. Account cancellation rejects new processing immediately with 409 invalid\_state. Read-only access lasts only until workspace deletion. No separate product charge or financial mutation is introduced. Browser return parameters are connection\_id, state and result (completed, cancelled or failed); failed returns a sanitized error\_code. Verify the saved state and expected connection, then retrieve the connection server-side. The callback never proves consent or connection activation. No credentials or source data appear in return parameters. The state must be unpredictable, bound to the initiating browser session and accepted only once. 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/connections/{id}/authorization
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/connections/{id}/authorization:
    post:
      tags:
        - Platform
      summary: Renew connection authorization
      description: >-
        Create a fresh short-lived authorization action on the existing pending,
        active or reauth_required connection. Preserve its ID, records and
        synchronization lineage. The consent must authorize the same subject,
        provider products and purposes. Validate redirect_uri against portal
        registration. Bind state to this connection and action; echo it on
        return. A new action invalidates any older unused action. An identical
        idempotent retry returns the same action, including its original expiry;
        use a new key when intentionally replacing an expired action.
        Reauthorization does not backfill data until a successful sync. Revoked
        or disconnected connections cannot be reopened; obtain new consent and
        create a new connection. Account cancellation rejects new processing
        immediately with 409 invalid_state. Read-only access lasts only until
        workspace deletion. No separate product charge or financial mutation is
        introduced. Browser return parameters are connection_id, state and
        result (completed, cancelled or failed); failed returns a sanitized
        error_code. Verify the saved state and expected connection, then
        retrieve the connection server-side. The callback never proves consent
        or connection activation. No credentials or source data appear in return
        parameters. The state must be unpredictable, bound to the initiating
        browser session and accepted only once. 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: IR001
      parameters:
        - name: id
          in: path
          required: true
          description: Authorized identifier in this workspace.
          schema:
            type: string
          example: connection_example
        - name: Idempotency-Key
          in: header
          required: true
          description: Stable key for this intended action; retain across retries.
          schema:
            type: string
          example: idem_integration_example
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthorizationRequest'
            example:
              consent_id: con_example
              redirect_uri: https://client.example.com/connected
              state: synthetic-random-state-at-least-32-characters
      responses:
        '201':
          description: Authorized response.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Connection'
                  meta:
                    $ref: '#/components/schemas/ResponseMeta'
                  action:
                    $ref: '#/components/schemas/Action'
                required:
                  - data
                  - meta
                  - action
              examples:
                synthetic:
                  value:
                    data:
                      id: connection_example
                      object: connection
                      subject_id: biz_example
                      created_at: '2026-10-23T14:00:00Z'
                      updated_at: '2026-10-23T14:00:00Z'
                      record_version: 1
                      source_refs: []
                      data_status: partial
                      missing_fields: []
                      schema_version: 1.4.2
                      client_reference: app-1029
                      provider_id: BANK-02
                      provider_tenant_id: item_example
                      status: active
                      institution_id: ins_example
                      institution_name: Example Bank
                      country: CA
                      products:
                        - transactions
                        - balance
                      scopes:
                        - banking:read
                      consent_id: con_01JAMLOK
                      last_successful_sync_at: null
                      next_refresh_at: null
                      history_available_from: '2025-10-22'
                      reauth_required_at: null
                      error_code: reauth_required
                      sync_cursor: cur_example
                    meta:
                      request_id: req_example
                      schema_version: 1.4.2
                      generated_at: '2026-10-23T14:00:00Z'
                      data_status: complete
                    action:
                      type: redirect
                      url: https://authorize.example.com/session/synthetic
                      expires_at: '2026-10-23T14:15:00Z'
        '400':
          $ref: '#/components/responses/Error400'
        '401':
          $ref: '#/components/responses/Error401'
        '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'
        '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/connections/connection_example/authorization" \
              --header "Authorization: Bearer ${AMLOK_API_KEY}" \
              --header "Accept: application/json" \
              --header 'Idempotency-Key: idem_example_1001' \
              --header 'Content-Type: application/json' \
              --data '{
              "consent_id": "con_example",
              "redirect_uri": "https://client.example.com/connected",
              "state": "synthetic-random-state-at-least-32-characters"
            }'
        - 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/connections/connection_example/authorization",
                headers=headers, timeout=30, allow_redirects=False,
                json={'consent_id': 'con_example',
             'redirect_uri': 'https://client.example.com/connected',
             'state': 'synthetic-random-state-at-least-32-characters'},
            )
            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/connections/connection_example/authorization", {
              method: "POST", headers,
              redirect: "error", signal: AbortSignal.timeout(30000),
              body: JSON.stringify({
              "consent_id": "con_example",
              "redirect_uri": "https://client.example.com/connected",
              "state": "synthetic-random-state-at-least-32-characters"
            }),

            });

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

            console.log(await response.json());
components:
  schemas:
    AuthorizationRequest:
      type: object
      properties:
        consent_id:
          type: string
          minLength: 1
        redirect_uri:
          type: string
          format: uri
          pattern: ^https://
        state:
          type: string
          minLength: 32
          maxLength: 256
      required:
        - consent_id
        - redirect_uri
        - state
      additionalProperties: false
    Connection:
      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: connection
        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.
        provider_id:
          type: string
          description: >-
            Integration catalog identifier. Preserve original evidence; do not
            invent missing values.
          x-field-id: F0017
          x-classification: Confidential
          x-availability: Required when resource exists
        provider_tenant_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Opaque external organization or item identifier. Preserve original
            evidence; do not invent missing values.
          x-field-id: F0018
          x-classification: Restricted
          x-availability: >-
            Source, module, country, consent and contracted permissions
            determine population.
        status:
          $ref: '#/components/schemas/Enum_connection_status'
          description: >-
            Current connection usability. Preserve original evidence; do not
            invent missing values.
          x-field-id: F0019
          x-classification: Confidential
          x-availability: Required when resource exists
        institution_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Provider-specific institution identifier. Preserve original
            evidence; do not invent missing values.
          x-field-id: F0020
          x-classification: Confidential
          x-availability: >-
            Source, module, country, consent and contracted permissions
            determine population.
        institution_name:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Institution display name. Preserve original evidence; do not invent
            missing values.
          x-field-id: F0021
          x-classification: Confidential
          x-availability: >-
            Source, module, country, consent and contracted permissions
            determine population.
        country:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Institution country when established. Preserve original evidence; do
            not invent missing values.
          x-field-id: F0022
          x-classification: Confidential
          x-availability: >-
            Source, module, country, consent and contracted permissions
            determine population.
        products:
          type: array
          items:
            type: string
          description: >-
            Data products enabled for this connection. Preserve original
            evidence; do not invent missing values.
          x-field-id: F0023
          x-classification: Confidential
          x-availability: Required when resource exists
        scopes:
          type: array
          items:
            type: string
          description: >-
            Granted read/write entitlements. Preserve original evidence; do not
            invent missing values.
          x-field-id: F0024
          x-classification: Confidential
          x-availability: Required when resource exists
        consent_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Consent record authorizing the connection. Preserve original
            evidence; do not invent missing values.
          x-field-id: F0025
          x-classification: Confidential
          x-availability: >-
            Source, module, country, consent and contracted permissions
            determine population.
        last_successful_sync_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          description: >-
            Latest fully successful retrieval. Preserve original evidence; do
            not invent missing values.
          x-field-id: F0026
          x-classification: Confidential
          x-availability: >-
            Source, module, country, consent and contracted permissions
            determine population.
        next_refresh_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          description: >-
            Scheduled next refresh if known. Preserve original evidence; do not
            invent missing values.
          x-field-id: F0027
          x-classification: Confidential
          x-availability: >-
            Source, module, country, consent and contracted permissions
            determine population.
        history_available_from:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          description: >-
            Earliest date actually returned for the selected resource. Do not
            infer from a provider's maximum advertised history.
          x-field-id: F0028
          x-classification: Confidential
          x-availability: >-
            Source, module, country, consent and contracted permissions
            determine population.
        reauth_required_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          description: >-
            When renewed user authorization became necessary. Preserve original
            evidence; do not invent missing values.
          x-field-id: F0029
          x-classification: Confidential
          x-availability: >-
            Source, module, country, consent and contracted permissions
            determine population.
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Sanitized connection error code. Preserve original evidence; do not
            invent missing values.
          x-field-id: F0030
          x-classification: Confidential
          x-availability: >-
            Source, module, country, consent and contracted permissions
            determine population.
        sync_cursor:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Opaque AMLOK change cursor for authorized synchronization. Never
            expose a provider secret or access token.
          x-field-id: F0031
          x-classification: Restricted
          x-availability: >-
            Source, module, country, consent and contracted permissions
            determine population.
      required:
        - id
        - object
        - created_at
        - updated_at
        - record_version
        - source_refs
        - data_status
        - missing_fields
        - schema_version
        - provider_id
        - status
        - products
        - scopes
      title: connection
      description: >-
        One authorized link to a provider tenant or financial institution.
        Population depends on source and tenant entitlement.
    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
    Action:
      type: object
      properties:
        type:
          type: string
          description: Next applicant interaction such as authorize_connection.
        url:
          type: string
          description: Short-lived authorized HTTPS interaction URL.
        expires_at:
          type: string
          format: date-time
          description: Expiry of interaction URL.
      required:
        - type
        - url
        - expires_at
    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_connection_status:
      type: string
      enum:
        - pending
        - active
        - reauth_required
        - revoked
        - disconnected
        - error
    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
    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
    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.