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

# Create monitor

> Enroll a funded deal in Signal with an existing risk package or approved portfolio baseline. AMLOK schedules refreshes and change-driven reassessments.

Enroll a funded deal in Signal with an existing risk package or approved portfolio baseline. AMLOK schedules refreshes and change-driven reassessments. All IDs and cursors must belong to the authorized workspace and environment. Required scope: signal:write.

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


## OpenAPI

````yaml openapi/amlok.json POST /v1/monitors
openapi: 3.1.0
info:
  title: AMLOK API
  version: 1.0.0
  description: >-
    AMLOK API: borrower connections, Insights origination, immutable risk
    packages and Signal monitoring. Use your institution-issued API origin.
servers: []
security:
  - BearerAuth: []
paths:
  /v1/monitors:
    post:
      tags:
        - Signal
      summary: Create monitor
      description: >-
        Enroll a funded deal in Signal with an existing risk package or approved
        portfolio baseline. AMLOK schedules refreshes and change-driven
        reassessments. All IDs and cursors must belong to the authorized
        workspace and environment. Required scope: signal:write.
      operationId: createMonitor
      parameters:
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
            minLength: 1
          description: >-
            Stable for one intended command and its retries, scoped to key
            workspace/environment and operation. Mismatched body returns 409.
            Full response replay 24 hours; durable receipt remains.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMonitor'
            example:
              borrower_id: bor_synthetic
              deal:
                institution_reference: LOAN-0042
                funded_amount:
                  amount: '50000.00'
                  currency: CAD
                outstanding_amount:
                  amount: '50000.00'
                  currency: CAD
                funded_at: '2026-11-05T12:00:00Z'
                maturity_date: '2027-11-06'
                repayment_frequency: monthly
                terms_document_ids: []
              baseline:
                risk_package_id: rp_synthetic
              risk_policy_version_id: rpv_synthetic
              cadence_id: cadence_synthetic
              connection_ids:
                - con_synthetic
      responses:
        '202':
          description: Accepted asynchronously; inspect status, not just HTTP success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Monitor'
                  meta:
                    $ref: '#/components/schemas/Meta'
                required:
                  - data
                  - meta
                additionalProperties: false
              example:
                data:
                  id: mon_synthetic
                  borrower_id: bor_synthetic
                  deal:
                    institution_reference: LOAN-0042
                    funded_amount:
                      amount: '50000.00'
                      currency: CAD
                    outstanding_amount:
                      amount: '50000.00'
                      currency: CAD
                    funded_at: '2026-11-05T12:00:00Z'
                    maturity_date: '2027-11-06'
                    repayment_frequency: monthly
                    terms_document_ids: []
                  status: initializing
                  baseline_package_id: rp_synthetic
                  latest_package_id: null
                  risk_policy_version_id: rpv_synthetic
                  cadence_id: cadence_synthetic
                  next_evaluation_at: null
                  record_version: 1
                  connection_ids:
                    - con_synthetic
                  requirements: []
                  failure: null
                  latest_deal_snapshot_id: ds_initial
                  updated_at: '2026-11-06T12:00:00Z'
                meta:
                  request_id: req_synthetic
                  schema_version: 1.0.0
                  environment: sandbox
          headers:
            ETag:
              schema:
                type: string
                minLength: 1
              description: >-
                Quoted monitor record version for conditional configuration
                changes.
            X-Request-ID:
              schema:
                type: string
                minLength: 1
              description: Same request ID as meta.request_id or error.request_id.
        '400':
          description: >-
            Inspect structured error; retry only when retryable. 429 and 503 can
            include Retry-After.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                required:
                  - error
                additionalProperties: false
              example:
                error:
                  code: validation_error
                  message: Validation error.
                  retryable: false
                  request_id: req_synthetic
                  field: null
          headers:
            X-Request-ID:
              schema:
                type: string
                minLength: 1
              description: Same request ID as meta.request_id or error.request_id.
        '401':
          description: >-
            Inspect structured error; retry only when retryable. 429 and 503 can
            include Retry-After.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                required:
                  - error
                additionalProperties: false
              example:
                error:
                  code: unauthenticated
                  message: Unauthenticated.
                  retryable: false
                  request_id: req_synthetic
                  field: null
          headers:
            X-Request-ID:
              schema:
                type: string
                minLength: 1
              description: Same request ID as meta.request_id or error.request_id.
        '402':
          description: >-
            Inspect structured error; retry only when retryable. 429 and 503 can
            include Retry-After.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                required:
                  - error
                additionalProperties: false
              example:
                error:
                  code: insufficient_credits
                  message: Insufficient credits.
                  retryable: false
                  request_id: req_synthetic
                  field: null
          headers:
            X-Request-ID:
              schema:
                type: string
                minLength: 1
              description: Same request ID as meta.request_id or error.request_id.
        '403':
          description: >-
            Inspect structured error; retry only when retryable. 429 and 503 can
            include Retry-After.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                required:
                  - error
                additionalProperties: false
              example:
                error:
                  code: forbidden
                  message: Forbidden.
                  retryable: false
                  request_id: req_synthetic
                  field: null
          headers:
            X-Request-ID:
              schema:
                type: string
                minLength: 1
              description: Same request ID as meta.request_id or error.request_id.
        '404':
          description: >-
            Inspect structured error; retry only when retryable. 429 and 503 can
            include Retry-After.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                required:
                  - error
                additionalProperties: false
              example:
                error:
                  code: not_found
                  message: Not found.
                  retryable: false
                  request_id: req_synthetic
                  field: null
          headers:
            X-Request-ID:
              schema:
                type: string
                minLength: 1
              description: Same request ID as meta.request_id or error.request_id.
        '409':
          description: >-
            Inspect structured error; retry only when retryable. 429 and 503 can
            include Retry-After.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                required:
                  - error
                additionalProperties: false
              example:
                error:
                  code: idempotency_conflict
                  message: Idempotency conflict.
                  retryable: false
                  request_id: req_synthetic
                  field: null
          headers:
            X-Request-ID:
              schema:
                type: string
                minLength: 1
              description: Same request ID as meta.request_id or error.request_id.
        '410':
          description: >-
            Inspect structured error; retry only when retryable. 429 and 503 can
            include Retry-After.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                required:
                  - error
                additionalProperties: false
              example:
                error:
                  code: cursor_expired
                  message: Cursor expired.
                  retryable: false
                  request_id: req_synthetic
                  field: null
          headers:
            X-Request-ID:
              schema:
                type: string
                minLength: 1
              description: Same request ID as meta.request_id or error.request_id.
        '413':
          description: >-
            Request exceeds the effective profile size limit or media type is
            unsupported. No command is accepted.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                required:
                  - error
                additionalProperties: false
              example:
                error:
                  code: payload_too_large
                  message: payload too large
                  retryable: false
                  request_id: req_synthetic
                  field: null
        '415':
          description: >-
            Request exceeds the effective profile size limit or media type is
            unsupported. No command is accepted.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                required:
                  - error
                additionalProperties: false
              example:
                error:
                  code: unsupported_media_type
                  message: unsupported media type
                  retryable: false
                  request_id: req_synthetic
                  field: null
        '422':
          description: >-
            Inspect structured error; retry only when retryable. 429 and 503 can
            include Retry-After.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                required:
                  - error
                additionalProperties: false
              example:
                error:
                  code: validation_error
                  message: Validation error.
                  retryable: false
                  request_id: req_synthetic
                  field: null
          headers:
            X-Request-ID:
              schema:
                type: string
                minLength: 1
              description: Same request ID as meta.request_id or error.request_id.
        '429':
          description: >-
            Inspect structured error; retry only when retryable. 429 and 503 can
            include Retry-After.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                required:
                  - error
                additionalProperties: false
              example:
                error:
                  code: rate_limited
                  message: Rate limited.
                  retryable: true
                  request_id: req_synthetic
                  field: null
          headers:
            Retry-After:
              description: Minimum delay in seconds before retry.
              schema:
                type: integer
                minimum: 0
            X-Request-ID:
              schema:
                type: string
                minLength: 1
              description: Same request ID as meta.request_id or error.request_id.
        '503':
          description: >-
            Inspect structured error; retry only when retryable. 429 and 503 can
            include Retry-After.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    $ref: '#/components/schemas/Error'
                required:
                  - error
                additionalProperties: false
              example:
                error:
                  code: temporarily_unavailable
                  message: Temporarily unavailable.
                  retryable: true
                  request_id: req_synthetic
                  field: null
          headers:
            Retry-After:
              description: Minimum delay in seconds before retry.
              schema:
                type: integer
                minimum: 0
            X-Request-ID:
              schema:
                type: string
                minLength: 1
              description: Same request ID as meta.request_id or error.request_id.
      security:
        - BearerAuth: []
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |-
            curl --request POST --fail-with-body --max-time 30 \
              "${AMLOK_API_BASE_URL}/v1/monitors" \
              --header "Authorization: Bearer ${AMLOK_API_KEY}" \
              --header 'Accept: application/json' \
              --header 'Idempotency-Key: createMonitor-synthetic-0042' \
              --header 'Content-Type: application/json' \
              --data '{"borrower_id":"bor_synthetic","deal":{"institution_reference":"LOAN-0042","funded_amount":{"amount":"50000.00","currency":"CAD"},"outstanding_amount":{"amount":"50000.00","currency":"CAD"},"funded_at":"2026-11-05T12:00:00Z","maturity_date":"2027-11-06","repayment_frequency":"monthly","terms_document_ids":[]},"baseline":{"risk_package_id":"rp_synthetic"},"risk_policy_version_id":"rpv_synthetic","cadence_id":"cadence_synthetic","connection_ids":["con_synthetic"]}'
        - lang: Python
          source: >
            import os

            import requests


            headers = {'Accept': 'application/json', 'Idempotency-Key':
            'createMonitor-synthetic-0042', 'Content-Type': 'application/json'}

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

            response = requests.request('POST', os.environ["AMLOK_API_BASE_URL"]
            + '/v1/monitors', headers=headers, json={'borrower_id':
            'bor_synthetic', 'deal': {'institution_reference': 'LOAN-0042',
            'funded_amount': {'amount': '50000.00', 'currency': 'CAD'},
            'outstanding_amount': {'amount': '50000.00', 'currency': 'CAD'},
            'funded_at': '2026-11-05T12:00:00Z', 'maturity_date': '2027-11-06',
            'repayment_frequency': 'monthly', 'terms_document_ids': []},
            'baseline': {'risk_package_id': 'rp_synthetic'},
            'risk_policy_version_id': 'rpv_synthetic', 'cadence_id':
            'cadence_synthetic', 'connection_ids': ['con_synthetic']},
            timeout=30, allow_redirects=False)

            response.raise_for_status()

            print(response.json())
        - lang: JavaScript
          source: >
            const headers = {"Accept": "application/json", "Idempotency-Key":
            "createMonitor-synthetic-0042", "Content-Type": "application/json"};

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

            const response = await fetch(process.env.AMLOK_API_BASE_URL +
            "/v1/monitors", {
              method: "POST", headers, redirect: "error", signal: AbortSignal.timeout(30000),
              body: JSON.stringify({"borrower_id": "bor_synthetic", "deal": {"institution_reference": "LOAN-0042", "funded_amount": {"amount": "50000.00", "currency": "CAD"}, "outstanding_amount": {"amount": "50000.00", "currency": "CAD"}, "funded_at": "2026-11-05T12:00:00Z", "maturity_date": "2027-11-06", "repayment_frequency": "monthly", "terms_document_ids": []}, "baseline": {"risk_package_id": "rp_synthetic"}, "risk_policy_version_id": "rpv_synthetic", "cadence_id": "cadence_synthetic", "connection_ids": ["con_synthetic"]})
            });

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

            console.log(await response.json());
components:
  schemas:
    CreateMonitor:
      type: object
      properties:
        borrower_id:
          type: string
          minLength: 1
          description: >-
            Opaque identifier, authorized within the API key workspace and
            environment.
        deal:
          $ref: '#/components/schemas/Deal'
          description: >-
            Deal for CreateMonitor. Constraints, requiredness and allowed values
            are defined by this schema.
        baseline:
          $ref: '#/components/schemas/BaselineInput'
          description: >-
            Baseline for CreateMonitor. Constraints, requiredness and allowed
            values are defined by this schema.
        risk_policy_version_id:
          type: string
          minLength: 1
          description: >-
            Opaque identifier, authorized within the API key workspace and
            environment.
        cadence_id:
          type: string
          minLength: 1
          description: >-
            Opaque identifier, authorized within the API key workspace and
            environment.
        connection_ids:
          type: array
          items:
            type: string
            minLength: 1
            description: >-
              Opaque identifier, authorized within the API key workspace and
              environment.
          uniqueItems: true
          description: >-
            Connection ids for CreateMonitor. Constraints, requiredness and
            allowed values are defined by this schema.
      required:
        - borrower_id
        - deal
        - baseline
        - risk_policy_version_id
        - cadence_id
        - connection_ids
      additionalProperties: false
    Monitor:
      type: object
      properties:
        id:
          type: string
          minLength: 1
          description: >-
            Opaque identifier, authorized within the API key workspace and
            environment.
        borrower_id:
          type: string
          minLength: 1
          description: >-
            Opaque identifier, authorized within the API key workspace and
            environment.
        deal:
          $ref: '#/components/schemas/Deal'
          description: >-
            Deal for Monitor. Constraints, requiredness and allowed values are
            defined by this schema.
        status:
          type: string
          enum:
            - initializing
            - active
            - paused
            - requires_action
            - waiting_for_credits
            - stopped
            - failed
          description: >-
            Current lifecycle state. See the product lifecycle and recovery
            guides.
        baseline_package_id:
          anyOf:
            - type: string
              minLength: 1
              description: >-
                Opaque identifier, authorized within the API key workspace and
                environment.
            - type: 'null'
          description: >-
            Baseline package id for Monitor. Constraints, requiredness and
            allowed values are defined by this schema.
        latest_package_id:
          anyOf:
            - type: string
              minLength: 1
              description: >-
                Opaque identifier, authorized within the API key workspace and
                environment.
            - type: 'null'
          description: >-
            Latest package id for Monitor. Constraints, requiredness and allowed
            values are defined by this schema.
        risk_policy_version_id:
          type: string
          minLength: 1
          description: >-
            Opaque identifier, authorized within the API key workspace and
            environment.
        cadence_id:
          type: string
          minLength: 1
          description: >-
            Opaque identifier, authorized within the API key workspace and
            environment.
        next_evaluation_at:
          anyOf:
            - type: string
              minLength: 1
              format: date-time
            - type: 'null'
          description: >-
            Next evaluation at for Monitor. Constraints, requiredness and
            allowed values are defined by this schema.
        record_version:
          type: integer
          minimum: 1
          description: Monotonic resource version for event reconciliation.
        connection_ids:
          type: array
          items:
            type: string
            minLength: 1
            description: Opaque identifier in the authorized workspace and environment.
          uniqueItems: true
          description: Identifiers of the associated authorized records.
        requirements:
          type: array
          items:
            $ref: '#/components/schemas/Requirement'
          description: >-
            Requirements for Monitor. Constraints, requiredness and allowed
            values are defined by this schema.
        failure:
          anyOf:
            - $ref: '#/components/schemas/Error'
            - type: 'null'
          description: >-
            Failure for Monitor. Constraints, requiredness and allowed values
            are defined by this schema.
        latest_deal_snapshot_id:
          type: string
          minLength: 1
          description: Opaque identifier in the authorized workspace and environment.
        updated_at:
          type: string
          minLength: 1
          description: UTC timestamp in RFC 3339 format.
          format: date-time
      required:
        - id
        - borrower_id
        - deal
        - status
        - baseline_package_id
        - latest_package_id
        - risk_policy_version_id
        - cadence_id
        - next_evaluation_at
        - record_version
        - connection_ids
        - requirements
        - failure
        - latest_deal_snapshot_id
        - updated_at
      additionalProperties: false
      allOf:
        - if:
            properties:
              status:
                const: requires_action
          then:
            properties:
              requirements:
                minItems: 1
          else:
            properties:
              requirements:
                maxItems: 0
        - if:
            properties:
              status:
                const: failed
          then:
            properties:
              failure:
                $ref: '#/components/schemas/Error'
          else:
            properties:
              failure:
                type: 'null'
    Meta:
      type: object
      properties:
        request_id:
          type: string
          minLength: 1
          description: >-
            Opaque identifier, authorized within the API key workspace and
            environment.
        schema_version:
          type: string
          minLength: 1
          description: >-
            Schema version for Meta. Constraints, requiredness and allowed
            values are defined by this schema.
        environment:
          type: string
          enum:
            - sandbox
            - live
          description: >-
            Environment for Meta. Constraints, requiredness and allowed values
            are defined by this schema.
      required:
        - request_id
        - schema_version
        - environment
      additionalProperties: false
    Error:
      type: object
      properties:
        code:
          type: string
          enum:
            - validation_error
            - unauthenticated
            - forbidden
            - not_found
            - invalid_state
            - idempotency_conflict
            - insufficient_credits
            - precondition_failed
            - cursor_expired
            - rate_limited
            - temporarily_unavailable
            - deal_snapshot_conflict
            - payload_too_large
            - unsupported_media_type
            - document_rejected
            - processing_failed
            - session_expired
            - consent_purpose_missing
            - sandbox_only
            - scenario_not_available
            - idempotency_result_expired
          description: >-
            Code for Error. Constraints, requiredness and allowed values are
            defined by this schema.
        message:
          type: string
          minLength: 1
          description: >-
            Message for Error. Constraints, requiredness and allowed values are
            defined by this schema.
        retryable:
          type: boolean
          description: >-
            Retryable for Error. Constraints, requiredness and allowed values
            are defined by this schema.
        request_id:
          type: string
          minLength: 1
          description: >-
            Opaque identifier, authorized within the API key workspace and
            environment.
        field:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          description: >-
            Field for Error. Constraints, requiredness and allowed values are
            defined by this schema.
      required:
        - code
        - message
        - retryable
        - request_id
        - field
      additionalProperties: false
    Deal:
      type: object
      properties:
        institution_reference:
          type: string
          minLength: 1
          description: >-
            Institution reference for Deal. Constraints, requiredness and
            allowed values are defined by this schema.
        funded_amount:
          $ref: '#/components/schemas/Money'
          description: >-
            Funded amount for Deal. Constraints, requiredness and allowed values
            are defined by this schema.
        outstanding_amount:
          $ref: '#/components/schemas/Money'
          description: >-
            Outstanding amount for Deal. Constraints, requiredness and allowed
            values are defined by this schema.
        funded_at:
          type: string
          minLength: 1
          format: date-time
          description: >-
            Funded at for Deal. Constraints, requiredness and allowed values are
            defined by this schema.
        maturity_date:
          type: string
          minLength: 1
          format: date
          description: >-
            Maturity date for Deal. Constraints, requiredness and allowed values
            are defined by this schema.
        repayment_frequency:
          type: string
          enum:
            - daily
            - weekly
            - biweekly
            - monthly
            - at_maturity
            - variable
          description: >-
            Repayment frequency for Deal. Constraints, requiredness and allowed
            values are defined by this schema.
        terms_document_ids:
          type: array
          items:
            type: string
            minLength: 1
            description: >-
              Opaque identifier, authorized within the API key workspace and
              environment.
          uniqueItems: true
          description: >-
            Terms document ids for Deal. Constraints, requiredness and allowed
            values are defined by this schema.
      required:
        - institution_reference
        - funded_amount
        - outstanding_amount
        - funded_at
        - maturity_date
        - repayment_frequency
        - terms_document_ids
      additionalProperties: false
      description: >-
        Complete institution-supplied deal terms at one point in time. Initial
        input is captured during enrollment; later inputs are append-only deal
        snapshots.
    BaselineInput:
      oneOf:
        - type: object
          properties:
            risk_package_id:
              type: string
              minLength: 1
              description: Opaque identifier in the authorized workspace and environment.
          required:
            - risk_package_id
          additionalProperties: false
          title: Existing risk package
        - type: object
          properties:
            portfolio:
              type: object
              properties:
                lending_product_version_id:
                  type: string
                  minLength: 1
                  description: >-
                    Opaque identifier in the authorized workspace and
                    environment.
                application:
                  anyOf:
                    - $ref: '#/components/schemas/ApplicationInput'
                    - type: 'null'
                document_ids:
                  type: array
                  items:
                    type: string
                    minLength: 1
                    description: >-
                      Opaque identifier in the authorized workspace and
                      environment.
                  uniqueItems: true
                  description: Identifiers of the associated authorized records.
              required:
                - lending_product_version_id
                - application
                - document_ids
              additionalProperties: false
          required:
            - portfolio
          additionalProperties: false
          title: Explicit portfolio baseline
      description: >-
        Use an existing compatible risk package, or explicit portfolio inputs
        for Signal baseline preparation. Portfolio initialization is included in
        Signal; no separate Insights purchase or undocumented reference is
        needed.
    Requirement:
      type: object
      properties:
        id:
          type: string
          minLength: 1
          description: Opaque identifier in the authorized workspace and environment.
        code:
          type: string
          enum:
            - source_missing
            - source_reauthorization_required
            - document_required
            - contact_support
          description: >-
            Code for Requirement. Constraints, requiredness and allowed values
            are defined by this schema.
        message:
          type: string
          minLength: 1
          description: >-
            Human-readable explanation; automate using code/action and typed
            fields.
        action:
          type: string
          enum:
            - connect_source
            - reauthorize_source
            - upload_document
            - contact_support
          description: >-
            Action for Requirement. Constraints, requiredness and allowed values
            are defined by this schema.
        connection_id:
          anyOf:
            - type: string
              minLength: 1
              description: Opaque identifier in the authorized workspace and environment.
            - type: 'null'
          description: >-
            Connection id for Requirement. Constraints, requiredness and allowed
            values are defined by this schema.
        integration_id:
          anyOf:
            - type: string
              minLength: 1
              description: Opaque identifier in the authorized workspace and environment.
            - type: 'null'
          description: >-
            Integration id for Requirement. Constraints, requiredness and
            allowed values are defined by this schema.
        document_type:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          description: >-
            Document type for Requirement. Constraints, requiredness and allowed
            values are defined by this schema.
        accepted_mime_types:
          type: array
          items:
            type: string
            minLength: 1
          description: >-
            Accepted mime types for Requirement. Constraints, requiredness and
            allowed values are defined by this schema.
        consent_purposes:
          type: array
          items:
            type: string
            enum:
              - credit_assessment
              - continuous_monitoring
          uniqueItems: true
          description: >-
            Consent purposes for Requirement. Constraints, requiredness and
            allowed values are defined by this schema.
      required:
        - id
        - code
        - message
        - action
        - connection_id
        - integration_id
        - document_type
        - accepted_mime_types
        - consent_purposes
      additionalProperties: false
      allOf:
        - if:
            properties:
              action:
                const: reauthorize_source
          then:
            properties:
              code:
                const: source_reauthorization_required
              connection_id:
                type: string
                minLength: 1
                description: Opaque identifier in the authorized workspace and environment.
              consent_purposes:
                minItems: 1
        - if:
            properties:
              action:
                const: connect_source
          then:
            properties:
              code:
                const: source_missing
              integration_id:
                type: string
                minLength: 1
                description: Opaque identifier in the authorized workspace and environment.
              consent_purposes:
                minItems: 1
        - if:
            properties:
              action:
                const: upload_document
          then:
            properties:
              code:
                const: document_required
              document_type:
                type: string
                minLength: 1
              accepted_mime_types:
                minItems: 1
        - if:
            properties:
              action:
                const: contact_support
          then:
            properties:
              code:
                const: contact_support
    Money:
      type: object
      properties:
        amount:
          type: string
          minLength: 1
          pattern: ^(?:0|[1-9][0-9]*)\.[0-9]{2}$
          description: >-
            Amount for Money. Constraints, requiredness and allowed values are
            defined by this schema.
        currency:
          type: string
          minLength: 1
          pattern: ^[A-Z]{3}$
          description: >-
            Currency for Money. Constraints, requiredness and allowed values are
            defined by this schema.
      required:
        - amount
        - currency
      additionalProperties: false
    ApplicationInput:
      type: object
      properties:
        institution_reference:
          type: string
          minLength: 1
          description: >-
            Institution reference for ApplicationInput. Constraints,
            requiredness and allowed values are defined by this schema.
        requested_amount:
          $ref: '#/components/schemas/Money'
          description: >-
            Requested amount for ApplicationInput. Constraints, requiredness and
            allowed values are defined by this schema.
        requested_term_months:
          type: integer
          minimum: 1
          description: >-
            Requested term months for ApplicationInput. Constraints,
            requiredness and allowed values are defined by this schema.
        purpose:
          type: string
          minLength: 1
          description: >-
            Purpose for ApplicationInput. Constraints, requiredness and allowed
            values are defined by this schema.
        declared_data:
          type: object
          description: >-
            Institution-defined application fields validated against
            application_schema_id; additionalProperties here does not bypass
            that schema.
        application_schema_id:
          type: string
          minLength: 1
          description: >-
            Opaque identifier, authorized within the API key workspace and
            environment.
        related_borrower_ids:
          type: array
          items:
            type: string
            minLength: 1
            description: >-
              Opaque identifier, authorized within the API key workspace and
              environment.
          uniqueItems: true
          description: >-
            Related borrower ids for ApplicationInput. Constraints, requiredness
            and allowed values are defined by this schema.
      required:
        - institution_reference
        - requested_amount
        - requested_term_months
        - purpose
        - application_schema_id
        - declared_data
      additionalProperties: false
  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.