---
title: "Adopt note extraction candidates"
---

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

# Adopt note extraction candidates

Path: Ámbar API › Technical note extraction

`POST /v1/note-extractions/adopt`

Saves a technical note that a person reviewed against a `ready` extraction candidate, and records which candidate it came from. You send the full note (as for saveTechnicalNote); nothing from the candidate is saved automatically, and the note is not approved.
Send the extraction `version` and the `candidateSha256` you reviewed; the note `source` must reference the extracted document. Use two different request keys: `requestKey` for the adoption and `note.requestKey` for the note.
Returns the saved technical note.
Idempotency: the same `requestKey` with the same body returns the note saved the first time; a different body with that key fails with IDEMPOTENCY_CONFLICT. After COMMIT_UNCERTAIN, retry with the same key.
Failures: CONFLICT when the extraction is no longer `ready` at that version, the candidate digest or note source does not match, or the note itself conflicts (read again); EVIDENCE_NOT_READABLE when the candidate cannot be read or verified now; ACCESS_DENIED when the extraction is not yours or a scope or access is missing; INVALID_INPUT for malformed fields or `humanReviewed` not `true`.

## Authentication

- `bearer_auth`, http, header `Authorization`, format `JWT`

## Request body

_Required._

- `candidateSha256` (`adoptNoteExtraction.candidateSha256`; string, required) — The `candidateSha256` you reviewed (`v1.` + 16 hex + `.` + 64 hex).
- `expectedExtractionVersion` (`adoptNoteExtraction.expectedExtractionVersion`; string, required) — The extraction's current `version` (positive decimal string).
- `extractionId` (`adoptNoteExtraction.extractionId`; string, required) — Extraction identifier: `nex_` followed by 32 lowercase hex characters.
- `humanReviewed` (`adoptNoteExtraction.humanReviewed`; boolean, required) — Must be `true`: a person reviewed the candidate and the note.
- `note` (`adoptNoteExtraction.note`; object, required) — The technical note to save, as for saveTechnicalNote. Its `source` must reference the extracted document (`artifact:<artifactId>` and its SHA-256).
  - `contractId` (`adoptNoteExtraction.note.contractId`; string, required) — Contract the note belongs to; it must not be suspended.
  - `definition` (`adoptNoteExtraction.note.definition`; object, required) — Note content.
    - `assignedPopulation` (`adoptNoteExtraction.note.definition.assignedPopulation`; string, required) — People assigned to the note: integer string, up to 12 digits.
    - `bandUse` (`adoptNoteExtraction.note.definition.bandUse`; NoteBandUse, required) — What the bands are used for.
      - one of:
        - `object`
          - `kind` (`adoptNoteExtraction.note.definition.bandUse.1.kind`; string, required)
            - one of `"monitoring"`
        - `object`
          - `clauseReference` (`adoptNoteExtraction.note.definition.bandUse.2.clauseReference`; string, required) — Clause reference (1 to 512 characters); each bound component must have the same `clauseReference`.
          - `kind` (`adoptNoteExtraction.note.definition.bandUse.2.kind`; string, required)
            - one of `"economic_clause"`
    - `coverage` (`adoptNoteExtraction.note.definition.coverage`; object, required) — Coverage flags.
      - `dispensingIncluded` (`adoptNoteExtraction.note.definition.coverage.dispensingIncluded`; boolean, required) — `true` when the note includes dispensing.
      - `postDischargeManagement` (`adoptNoteExtraction.note.definition.coverage.postDischargeManagement`; boolean, required) — `true` when the note includes post-discharge management.
      - `renalReplacementModule` (`adoptNoteExtraction.note.definition.coverage.renalReplacementModule`; boolean, required) — `true` when the note includes the renal replacement therapy module.
    - `currency` (`adoptNoteExtraction.note.definition.currency`; string, required) — Currency of authored amounts.
      - one of `"COP"`, `"PEN"`, `"MXN"`, `"CLP"`, `"BRL"`
    - `executionSource` (`adoptNoteExtraction.note.definition.executionSource`; string, required) — Where executed services are counted from, as authored.
      - one of `"deliveries"`, `"clinical_facts"`
    - `financialBinding` (`adoptNoteExtraction.note.definition.financialBinding`; one of, required)
      - one of: `NoteFinancialBinding`, `null`
    - `lines` (`adoptNoteExtraction.note.definition.lines`; array<object>, required) — Service lines: up to 1000 with unique keys.
      - `chapter` (`adoptNoteExtraction.note.definition.lines.chapter`; string | null, required) — Chapter label (1 to 160 characters); `null` when not stated.
      - `codeRelease` (`adoptNoteExtraction.note.definition.lines.codeRelease`; string | null, required) — Release of the code system (1 to 128 characters); `null` when not stated.
      - `codeSystem` (`adoptNoteExtraction.note.definition.lines.codeSystem`; string, required) — Code system of `cups`, as written (1 to 128 characters).
      - `cups` (`adoptNoteExtraction.note.definition.lines.cups`; string, required) — Service code in `codeSystem`, as written (1 to 128 characters).
      - `eligiblePopulation` (`adoptNoteExtraction.note.definition.lines.eligiblePopulation`; string, required) — People eligible for the line: integer string, at most `assignedPopulation`.
      - `frequency` (`adoptNoteExtraction.note.definition.lines.frequency`; string, required) — Services per eligible person per `frequencyPeriod`, with up to 12 decimals: a rate per 100,000 people is written per person (3.75 per 100,000 is `0.0000375`).
      - `frequencyPeriod` (`adoptNoteExtraction.note.definition.lines.frequencyPeriod`; string, required) — Period that `frequency` refers to.
        - one of `"month"`, `"year"`, `"contract"`
      - `group` (`adoptNoteExtraction.note.definition.lines.group`; string | null, required) — Group label (1 to 160 characters); `null` when not stated.
      - `isTracer` (`adoptNoteExtraction.note.definition.lines.isTracer`; boolean, required) — `true` when the note marks the line as a tracer service.
      - `key` (`adoptNoteExtraction.note.definition.lines.key`; string, required) — Line key, unique within the note (1 to 120 characters).
      - `route` (`adoptNoteExtraction.note.definition.lines.route`; string, required) — Care route the line belongs to, as written (1 to 120 characters).
      - `scope` (`adoptNoteExtraction.note.definition.lines.scope`; string, required) — Role of the line.
        - one of `"included"`, `"sufficiency"`
      - `service` (`adoptNoteExtraction.note.definition.lines.service`; string, required) — Service description (1 to 240 characters).
      - `tracer` (`adoptNoteExtraction.note.definition.lines.tracer`; string | null, required) — Tracer label (1 to 160 characters); `null` when not stated.
      - `unit` (`adoptNoteExtraction.note.definition.lines.unit`; string | null, required) — Unit label (1 to 160 characters); `null` when not stated.
      - `unitPrice` (`adoptNoteExtraction.note.definition.lines.unitPrice`; one of, required)
        - one of: `NoteDecimal`, `null`
    - `lowerBand` (`adoptNoteExtraction.note.definition.lowerBand`; string, required) — Lower execution band in percent, from 0 to 100.
    - `modality` (`adoptNoteExtraction.note.definition.modality`; one of, required)
      - one of: `PaymentMode`, `null`
    - `name` (`adoptNoteExtraction.note.definition.name`; string, required) — Display name (1 to 200 characters).
    - `perCapitaMonth` (`adoptNoteExtraction.note.definition.perCapitaMonth`; one of, required)
      - one of: `NoteDecimal`, `null`
    - `proration` (`adoptNoteExtraction.note.definition.proration`; string, required) — How offered quantities are prorated.
      - one of `"calendar_days"`, `"none"`
    - `purposeRoutes` (`adoptNoteExtraction.note.definition.purposeRoutes`; map<string>, required) — Up to 100 authored entries mapping a purpose label (1 to 80 characters) to a route name (1 to 120 characters).
    - `requirements` (`adoptNoteExtraction.note.definition.requirements`; array<object>, required) — Clinical requirements: up to 200 with unique keys.
      - `acceptedEvidence` (`adoptNoteExtraction.note.definition.requirements.acceptedEvidence`; string, required) — Evidence that satisfies it.
        - one of `"performance"`, `"complete_result"`
      - `cadence` (`adoptNoteExtraction.note.definition.requirements.cadence`; object, required) — When the requirement is due.
        - `anchorDate` (`adoptNoteExtraction.note.definition.requirements.cadence.anchorDate`; string, required) — Date the cadence counts from (`YYYY-MM-DD`, not before 1970-01-01).
        - `every` (`adoptNoteExtraction.note.definition.requirements.cadence.every`; string, required) — Interval length in `unit`: integer string from 1 to 3660.
        - `graceDays` (`adoptNoteExtraction.note.definition.requirements.cadence.graceDays`; string, required) — Extra days allowed after a due date: integer string from 0 to 366, shorter than one interval (a month counts 28 days, a year 365).
        - `timeZone` (`adoptNoteExtraction.note.definition.requirements.cadence.timeZone`; string, required) — Time zone; must equal the note's `timeZone`.
        - `unit` (`adoptNoteExtraction.note.definition.requirements.cadence.unit`; string, required) — Unit of the interval.
          - one of `"day"`, `"month"`, `"year"`, `"once"`
      - `cohortId` (`adoptNoteExtraction.note.definition.requirements.cohortId`; string | null, required) — Active cohort whose current members the requirement selects; `null` if none.
      - `key` (`adoptNoteExtraction.note.definition.requirements.key`; string, required) — Requirement identifier, unique within the note (`^[a-z][a-z0-9_-]{0,127}$`).
      - `lineKey` (`adoptNoteExtraction.note.definition.requirements.lineKey`; string | null, required) — Key of the note line this requirement serves; `null` if none.
      - `programId` (`adoptNoteExtraction.note.definition.requirements.programId`; string | null, required) — Active program whose enrolled patients the requirement selects; `null` if none.
      - `service` (`adoptNoteExtraction.note.definition.requirements.service`; object, required) — Coded service that satisfies the requirement.
        - `code` (`adoptNoteExtraction.note.definition.requirements.service.code`; string, required) — Code within the system, 1 to 128 characters.
        - `display` (`adoptNoteExtraction.note.definition.requirements.service.display`; string, required) — Human-readable label, 1 to 200 characters; never used to identify the concept.
        - `system` (`adoptNoteExtraction.note.definition.requirements.service.system`; string, required) — Code system as a URI or URN: must contain `:` and no whitespace, 1 to 200 characters.
        - `version` (`adoptNoteExtraction.note.definition.requirements.service.version`; string, required) — Version of the code system, 1 to 64 characters.
      - `sourceReference` (`adoptNoteExtraction.note.definition.requirements.sourceReference`; string, required) — Where the requirement comes from in the source document (1 to 512 characters).
      - `studyDefinitionId` (`adoptNoteExtraction.note.definition.requirements.studyDefinitionId`; string | null, required) — Study definition that delivers the service; required before approval.
      - `studyDefinitionVersion` (`adoptNoteExtraction.note.definition.requirements.studyDefinitionVersion`; string | null, required) — Active approved revision of that definition, with the same `service`; set together with `studyDefinitionId`.
      - `title` (`adoptNoteExtraction.note.definition.requirements.title`; string, required) — Display title (1 to 200 characters).
    - `sourceLabel` (`adoptNoteExtraction.note.definition.sourceLabel`; string, required) — Label of the source the note comes from (1 to 240 characters).
    - `timeZone` (`adoptNoteExtraction.note.definition.timeZone`; string, required) — Note calendar: `UTC`, `America/Bogota`, `America/Lima`, `America/Mexico_City`, `America/Santiago` or `America/Sao_Paulo`.
    - `upperBand` (`adoptNoteExtraction.note.definition.upperBand`; string, required) — Upper execution band in percent, from 100 to 1000.
    - `validFrom` (`adoptNoteExtraction.note.definition.validFrom`; string, required) — First day the note applies (`YYYY-MM-DD`, inclusive, from 1970-01-01).
    - `validTo` (`adoptNoteExtraction.note.definition.validTo`; string, required) — Last day the note applies (`YYYY-MM-DD`, inclusive, up to 9998-12-31).
    - `agreedValue` (`adoptNoteExtraction.note.definition.agreedValue`; one of, optional)
      - one of: `NoteDecimal`, `null`
    - `monitoringPeriodicity` (`adoptNoteExtraction.note.definition.monitoringPeriodicity`; one of, optional)
      - one of: `MonitoringPeriodicity`, `null`
    - `paymentBasis` (`adoptNoteExtraction.note.definition.paymentBasis`; one of, optional)
      - one of: `NotePaymentBasis`, `null`
    - `riskCharacterization` (`adoptNoteExtraction.note.definition.riskCharacterization`; one of, optional)
      - one of: `RiskCharacterization`, `null`
  - `expectedContractVersion` (`adoptNoteExtraction.note.expectedContractVersion`; string, required) — Contract `version` you last read; saving increments it.
  - `expectedLatestNumber` (`adoptNoteExtraction.note.expectedLatestNumber`; string, required) — Highest note `number` of the contract you last read; `"0"` when it has none.
  - `id` (`adoptNoteExtraction.note.id`; string, required) — New note identifier (`^[a-z][a-z0-9_-]{0,127}$`); an existing id is rejected.
  - `requestKey` (`adoptNoteExtraction.note.requestKey`; string, required) — Idempotency key: 32 lowercase hexadecimal characters.
  - `source` (`adoptNoteExtraction.note.source`; object, required) — Note document: a `ready` uploaded file cited as `artifact:<id>` with its `sha256`.
    - `reference` (`adoptNoteExtraction.note.source.reference`; string, required) — `artifact:<id>` for a file uploaded with `reserveContractArtifact` (it must be `ready` and match `sha256`), or any other reference: 1 to 512 characters, trimmed, without control characters.
    - `sha256` (`adoptNoteExtraction.note.source.sha256`; string, required) — SHA-256 of the document bytes: 64 lowercase hexadecimal characters.
  - `variantOfId` (`adoptNoteExtraction.note.variantOfId`; string | null, required) — Earlier note of the same contract that this note is a variant of; `null` if none.
- `requestKey` (`adoptNoteExtraction.requestKey`; string, required) — Idempotency key: 32 lowercase hex characters, different from `note.requestKey`.

## Example request

```json
{
  "candidateSha256": "0123456789abcdef0123456789abcdef",
  "expectedExtractionVersion": "1",
  "extractionId": "extraction_01",
  "humanReviewed": false,
  "note": {
    "contractId": "contract_01",
    "definition": {
      "agreedValue": "example",
      "assignedPopulation": "example",
      "bandUse": {
        "kind": "monitoring"
      },
      "coverage": {
        "dispensingIncluded": false,
        "postDischargeManagement": false,
        "renalReplacementModule": false
      },
      "currency": "COP",
      "executionSource": "deliveries",
      "financialBinding": {
        "componentKeys": [
          "example"
        ],
        "versionId": "version_01"
      },
      "lines": [
        {
          "chapter": "example",
          "codeRelease": "example",
          "codeSystem": "example",
          "cups": "example",
          "eligiblePopulation": "example",
          "frequency": "example",
          "frequencyPeriod": "month",
          "group": "example",
          "isTracer": false,
          "key": "0123456789abcdef0123456789abcdef",
          "route": "example",
          "scope": "included",
          "service": "example",
          "tracer": "example",
          "unit": "example",
          "unitPrice": "example"
        }
      ],
      "lowerBand": "example",
      "modality": "pgp",
      "monitoringPeriodicity": {
        "every": "example",
        "unit": "day"
      },
      "name": "example",
      "paymentBasis": "fixed_value",
      "perCapitaMonth": "example",
      "proration": "calendar_days",
      "purposeRoutes": {
        "key": "0123456789abcdef0123456789abcdef"
      },
      "requirements": [
        {
          "acceptedEvidence": "performance",
          "cadence": {
            "anchorDate": "2026-10-14",
            "every": "example",
            "graceDays": "example",
            "timeZone": "example",
            "unit": "day"
          },
          "cohortId": "cohort_01",
          "key": "0123456789abcdef0123456789abcdef",
          "lineKey": "0123456789abcdef0123456789abcdef",
          "programId": "program_01",
          "service": {
            "code": "example",
            "display": "example",
            "system": "example",
            "version": "1"
          },
          "sourceReference": "example",
          "studyDefinitionId": "studydefinition_01",
          "studyDefinitionVersion": "1",
          "title": "example"
        }
      ],
      "riskCharacterization": {
        "description": "example",
        "groups": [
          {
            "label": "example",
            "people": "example"
          }
        ],
        "sourceReference": "example"
      },
      "sourceLabel": "example",
      "timeZone": "example",
      "upperBand": "example",
      "validFrom": "example",
      "validTo": "example"
    },
    "expectedContractVersion": "1",
    "expectedLatestNumber": "example",
    "id": "example_01",
    "requestKey": "0123456789abcdef0123456789abcdef",
    "source": {
      "reference": "example",
      "sha256": "0123456789abcdef0123456789abcdef"
    },
    "variantOfId": "variantof_01"
  },
  "requestKey": "0123456789abcdef0123456789abcdef"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://api-ambar.getarbol.com/v1/note-extractions/adopt \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "candidateSha256": "0123456789abcdef0123456789abcdef",
  "expectedExtractionVersion": "1",
  "extractionId": "extraction_01",
  "humanReviewed": false,
  "note": {
    "contractId": "contract_01",
    "definition": {
      "agreedValue": "example",
      "assignedPopulation": "example",
      "bandUse": {
        "kind": "monitoring"
      },
      "coverage": {
        "dispensingIncluded": false,
        "postDischargeManagement": false,
        "renalReplacementModule": false
      },
      "currency": "COP",
      "executionSource": "deliveries",
      "financialBinding": {
        "componentKeys": [
          "example"
        ],
        "versionId": "version_01"
      },
      "lines": [
        {
          "chapter": "example",
          "codeRelease": "example",
          "codeSystem": "example",
          "cups": "example",
          "eligiblePopulation": "example",
          "frequency": "example",
          "frequencyPeriod": "month",
          "group": "example",
          "isTracer": false,
          "key": "0123456789abcdef0123456789abcdef",
          "route": "example",
          "scope": "included",
          "service": "example",
          "tracer": "example",
          "unit": "example",
          "unitPrice": "example"
        }
      ],
      "lowerBand": "example",
      "modality": "pgp",
      "monitoringPeriodicity": {
        "every": "example",
        "unit": "day"
      },
      "name": "example",
      "paymentBasis": "fixed_value",
      "perCapitaMonth": "example",
      "proration": "calendar_days",
      "purposeRoutes": {
        "key": "0123456789abcdef0123456789abcdef"
      },
      "requirements": [
        {
          "acceptedEvidence": "performance",
          "cadence": {
            "anchorDate": "2026-10-14",
            "every": "example",
            "graceDays": "example",
            "timeZone": "example",
            "unit": "day"
          },
          "cohortId": "cohort_01",
          "key": "0123456789abcdef0123456789abcdef",
          "lineKey": "0123456789abcdef0123456789abcdef",
          "programId": "program_01",
          "service": {
            "code": "example",
            "display": "example",
            "system": "example",
            "version": "1"
          },
          "sourceReference": "example",
          "studyDefinitionId": "studydefinition_01",
          "studyDefinitionVersion": "1",
          "title": "example"
        }
      ],
      "riskCharacterization": {
        "description": "example",
        "groups": [
          {
            "label": "example",
            "people": "example"
          }
        ],
        "sourceReference": "example"
      },
      "sourceLabel": "example",
      "timeZone": "example",
      "upperBand": "example",
      "validFrom": "example",
      "validTo": "example"
    },
    "expectedContractVersion": "1",
    "expectedLatestNumber": "example",
    "id": "example_01",
    "requestKey": "0123456789abcdef0123456789abcdef",
    "source": {
      "reference": "example",
      "sha256": "0123456789abcdef0123456789abcdef"
    },
    "variantOfId": "variantof_01"
  },
  "requestKey": "0123456789abcdef0123456789abcdef"
}
'
```

### TypeScript

```typescript
const url = 'https://api-ambar.getarbol.com/v1/note-extractions/adopt';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    candidateSha256: '0123456789abcdef0123456789abcdef',
    expectedExtractionVersion: '1',
    extractionId: 'extraction_01',
    humanReviewed: false,
    note: {
      contractId: 'contract_01',
      definition: {
        agreedValue: 'example',
        assignedPopulation: 'example',
        bandUse: {kind: 'monitoring'},
        coverage: {
          dispensingIncluded: false,
          postDischargeManagement: false,
          renalReplacementModule: false
        },
        currency: 'COP',
        executionSource: 'deliveries',
        financialBinding: {componentKeys: ['example'], versionId: 'version_01'},
        lines: [
          {
            chapter: 'example',
            codeRelease: 'example',
            codeSystem: 'example',
            cups: 'example',
            eligiblePopulation: 'example',
            frequency: 'example',
            frequencyPeriod: 'month',
            group: 'example',
            isTracer: false,
            key: '0123456789abcdef0123456789abcdef',
            route: 'example',
            scope: 'included',
            service: 'example',
            tracer: 'example',
            unit: 'example',
            unitPrice: 'example'
          }
        ],
        lowerBand: 'example',
        modality: 'pgp',
        monitoringPeriodicity: {every: 'example', unit: 'day'},
        name: 'example',
        paymentBasis: 'fixed_value',
        perCapitaMonth: 'example',
        proration: 'calendar_days',
        purposeRoutes: {key: '0123456789abcdef0123456789abcdef'},
        requirements: [
          {
            acceptedEvidence: 'performance',
            cadence: {
              anchorDate: '2026-10-14',
              every: 'example',
              graceDays: 'example',
              timeZone: 'example',
              unit: 'day'
            },
            cohortId: 'cohort_01',
            key: '0123456789abcdef0123456789abcdef',
            lineKey: '0123456789abcdef0123456789abcdef',
            programId: 'program_01',
            service: {code: 'example', display: 'example', system: 'example', version: '1'},
            sourceReference: 'example',
            studyDefinitionId: 'studydefinition_01',
            studyDefinitionVersion: '1',
            title: 'example'
          }
        ],
        riskCharacterization: {
          description: 'example',
          groups: [{label: 'example', people: 'example'}],
          sourceReference: 'example'
        },
        sourceLabel: 'example',
        timeZone: 'example',
        upperBand: 'example',
        validFrom: 'example',
        validTo: 'example'
      },
      expectedContractVersion: '1',
      expectedLatestNumber: 'example',
      id: 'example_01',
      requestKey: '0123456789abcdef0123456789abcdef',
      source: {reference: 'example', sha256: '0123456789abcdef0123456789abcdef'},
      variantOfId: 'variantof_01'
    },
    requestKey: '0123456789abcdef0123456789abcdef'
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api-ambar.getarbol.com/v1/note-extractions/adopt"

payload = {
    "candidateSha256": "0123456789abcdef0123456789abcdef",
    "expectedExtractionVersion": "1",
    "extractionId": "extraction_01",
    "humanReviewed": False,
    "note": {
        "contractId": "contract_01",
        "definition": {
            "agreedValue": "example",
            "assignedPopulation": "example",
            "bandUse": { "kind": "monitoring" },
            "coverage": {
                "dispensingIncluded": False,
                "postDischargeManagement": False,
                "renalReplacementModule": False
            },
            "currency": "COP",
            "executionSource": "deliveries",
            "financialBinding": {
                "componentKeys": ["example"],
                "versionId": "version_01"
            },
            "lines": [
                {
                    "chapter": "example",
                    "codeRelease": "example",
                    "codeSystem": "example",
                    "cups": "example",
                    "eligiblePopulation": "example",
                    "frequency": "example",
                    "frequencyPeriod": "month",
                    "group": "example",
                    "isTracer": False,
                    "key": "0123456789abcdef0123456789abcdef",
                    "route": "example",
                    "scope": "included",
                    "service": "example",
                    "tracer": "example",
                    "unit": "example",
                    "unitPrice": "example"
                }
            ],
            "lowerBand": "example",
            "modality": "pgp",
            "monitoringPeriodicity": {
                "every": "example",
                "unit": "day"
            },
            "name": "example",
            "paymentBasis": "fixed_value",
            "perCapitaMonth": "example",
            "proration": "calendar_days",
            "purposeRoutes": { "key": "0123456789abcdef0123456789abcdef" },
            "requirements": [
                {
                    "acceptedEvidence": "performance",
                    "cadence": {
                        "anchorDate": "2026-10-14",
                        "every": "example",
                        "graceDays": "example",
                        "timeZone": "example",
                        "unit": "day"
                    },
                    "cohortId": "cohort_01",
                    "key": "0123456789abcdef0123456789abcdef",
                    "lineKey": "0123456789abcdef0123456789abcdef",
                    "programId": "program_01",
                    "service": {
                        "code": "example",
                        "display": "example",
                        "system": "example",
                        "version": "1"
                    },
                    "sourceReference": "example",
                    "studyDefinitionId": "studydefinition_01",
                    "studyDefinitionVersion": "1",
                    "title": "example"
                }
            ],
            "riskCharacterization": {
                "description": "example",
                "groups": [
                    {
                        "label": "example",
                        "people": "example"
                    }
                ],
                "sourceReference": "example"
            },
            "sourceLabel": "example",
            "timeZone": "example",
            "upperBand": "example",
            "validFrom": "example",
            "validTo": "example"
        },
        "expectedContractVersion": "1",
        "expectedLatestNumber": "example",
        "id": "example_01",
        "requestKey": "0123456789abcdef0123456789abcdef",
        "source": {
            "reference": "example",
            "sha256": "0123456789abcdef0123456789abcdef"
        },
        "variantOfId": "variantof_01"
    },
    "requestKey": "0123456789abcdef0123456789abcdef"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

#### Example

```json
{
  "data": {
    "approvalEvidence": {
      "reference": "example",
      "sha256": "0123456789abcdef0123456789abcdef"
    },
    "approvedAt": "2026-10-14T13:00:00Z",
    "approvedBy": "example",
    "contractId": "contract_01",
    "createdAt": "2026-10-14T13:00:00Z",
    "createdBy": "example",
    "definition": {
      "agreedValue": "example",
      "assignedPopulation": "example",
      "bandUse": {
        "kind": "monitoring"
      },
      "coverage": {
        "dispensingIncluded": false,
        "postDischargeManagement": false,
        "renalReplacementModule": false
      },
      "currency": "COP",
      "executionSource": "deliveries",
      "financialBinding": {
        "componentKeys": [
          "example"
        ],
        "versionId": "version_01"
      },
      "lines": [
        {
          "chapter": "example",
          "codeRelease": "example",
          "codeSystem": "example",
          "cups": "example",
          "eligiblePopulation": "example",
          "frequency": "example",
          "frequencyPeriod": "month",
          "group": "example",
          "isTracer": false,
          "key": "0123456789abcdef0123456789abcdef",
          "route": "example",
          "scope": "included",
          "service": "example",
          "tracer": "example",
          "unit": "example",
          "unitPrice": "example"
        }
      ],
      "lowerBand": "example",
      "modality": "pgp",
      "monitoringPeriodicity": {
        "every": "example",
        "unit": "day"
      },
      "name": "example",
      "paymentBasis": "fixed_value",
      "perCapitaMonth": "example",
      "proration": "calendar_days",
      "purposeRoutes": {
        "key": "0123456789abcdef0123456789abcdef"
      },
      "requirements": [
        {
          "acceptedEvidence": "performance",
          "cadence": {
            "anchorDate": "2026-10-14",
            "every": "example",
            "graceDays": "example",
            "timeZone": "example",
            "unit": "day"
          },
          "cohortId": "cohort_01",
          "key": "0123456789abcdef0123456789abcdef",
          "lineKey": "0123456789abcdef0123456789abcdef",
          "programId": "program_01",
          "service": {
            "code": "example",
            "display": "example",
            "system": "example",
            "version": "1"
          },
          "sourceReference": "example",
          "studyDefinitionId": "studydefinition_01",
          "studyDefinitionVersion": "1",
          "title": "example"
        }
      ],
      "riskCharacterization": {
        "description": "example",
        "groups": [
          {
            "label": "example",
            "people": "example"
          }
        ],
        "sourceReference": "example"
      },
      "sourceLabel": "example",
      "timeZone": "example",
      "upperBand": "example",
      "validFrom": "example",
      "validTo": "example"
    },
    "id": "example_01",
    "number": "example",
    "proposedAt": "2026-10-14T13:00:00Z",
    "proposedBy": "example",
    "reconciledExamples": {
      "reference": "example",
      "sha256": "0123456789abcdef0123456789abcdef"
    },
    "source": {
      "reference": "example",
      "sha256": "0123456789abcdef0123456789abcdef"
    },
    "state": "draft",
    "variantOfId": "variantof_01",
    "version": "1"
  },
  "metadata": {
    "requestId": "request_01"
  },
  "success": true
}
```

- `data` (`adoptNoteExtraction.response.200.data`; object, required) — An immutable technical note revision of a contract.
  - `approvalEvidence` (`adoptNoteExtraction.response.200.data.approvalEvidence`; one of, required)
    - one of: `ContractArtifact`, `null`
  - `approvedAt` (`adoptNoteExtraction.response.200.data.approvedAt`; string | null, required) — Approval time (RFC 3339, UTC); `null` until approved.
  - `approvedBy` (`adoptNoteExtraction.response.200.data.approvedBy`; string | null, required) — Actor who approved the note; `null` until approved.
  - `contractId` (`adoptNoteExtraction.response.200.data.contractId`; string, required) — Contract the note belongs to.
  - `createdAt` (`adoptNoteExtraction.response.200.data.createdAt`; string, required) — Save time (RFC 3339, UTC).
  - `createdBy` (`adoptNoteExtraction.response.200.data.createdBy`; string, required) — Actor who saved the note (opaque identifier).
  - `definition` (`adoptNoteExtraction.response.200.data.definition`; object, required) — Note content, exactly as saved.
    - `assignedPopulation` (`adoptNoteExtraction.response.200.data.definition.assignedPopulation`; string, required) — People assigned to the note: integer string, up to 12 digits.
    - `bandUse` (`adoptNoteExtraction.response.200.data.definition.bandUse`; NoteBandUse, required) — What the bands are used for.
      - one of:
        - `object`
          - `kind` (`adoptNoteExtraction.response.200.data.definition.bandUse.1.kind`; string, required)
            - one of `"monitoring"`
        - `object`
          - `clauseReference` (`adoptNoteExtraction.response.200.data.definition.bandUse.2.clauseReference`; string, required) — Clause reference (1 to 512 characters); each bound component must have the same `clauseReference`.
          - `kind` (`adoptNoteExtraction.response.200.data.definition.bandUse.2.kind`; string, required)
            - one of `"economic_clause"`
    - `coverage` (`adoptNoteExtraction.response.200.data.definition.coverage`; object, required) — Coverage flags.
      - `dispensingIncluded` (`adoptNoteExtraction.response.200.data.definition.coverage.dispensingIncluded`; boolean, required) — `true` when the note includes dispensing.
      - `postDischargeManagement` (`adoptNoteExtraction.response.200.data.definition.coverage.postDischargeManagement`; boolean, required) — `true` when the note includes post-discharge management.
      - `renalReplacementModule` (`adoptNoteExtraction.response.200.data.definition.coverage.renalReplacementModule`; boolean, required) — `true` when the note includes the renal replacement therapy module.
    - `currency` (`adoptNoteExtraction.response.200.data.definition.currency`; string, required) — Currency of authored amounts.
      - one of `"COP"`, `"PEN"`, `"MXN"`, `"CLP"`, `"BRL"`
    - `executionSource` (`adoptNoteExtraction.response.200.data.definition.executionSource`; string, required) — Where executed services are counted from, as authored.
      - one of `"deliveries"`, `"clinical_facts"`
    - `financialBinding` (`adoptNoteExtraction.response.200.data.definition.financialBinding`; one of, required)
      - one of: `NoteFinancialBinding`, `null`
    - `lines` (`adoptNoteExtraction.response.200.data.definition.lines`; array<object>, required) — Service lines: up to 1000 with unique keys.
      - `chapter` (`adoptNoteExtraction.response.200.data.definition.lines.chapter`; string | null, required) — Chapter label (1 to 160 characters); `null` when not stated.
      - `codeRelease` (`adoptNoteExtraction.response.200.data.definition.lines.codeRelease`; string | null, required) — Release of the code system (1 to 128 characters); `null` when not stated.
      - `codeSystem` (`adoptNoteExtraction.response.200.data.definition.lines.codeSystem`; string, required) — Code system of `cups`, as written (1 to 128 characters).
      - `cups` (`adoptNoteExtraction.response.200.data.definition.lines.cups`; string, required) — Service code in `codeSystem`, as written (1 to 128 characters).
      - `eligiblePopulation` (`adoptNoteExtraction.response.200.data.definition.lines.eligiblePopulation`; string, required) — People eligible for the line: integer string, at most `assignedPopulation`.
      - `frequency` (`adoptNoteExtraction.response.200.data.definition.lines.frequency`; string, required) — Services per eligible person per `frequencyPeriod`, with up to 12 decimals: a rate per 100,000 people is written per person (3.75 per 100,000 is `0.0000375`).
      - `frequencyPeriod` (`adoptNoteExtraction.response.200.data.definition.lines.frequencyPeriod`; string, required) — Period that `frequency` refers to.
        - one of `"month"`, `"year"`, `"contract"`
      - `group` (`adoptNoteExtraction.response.200.data.definition.lines.group`; string | null, required) — Group label (1 to 160 characters); `null` when not stated.
      - `isTracer` (`adoptNoteExtraction.response.200.data.definition.lines.isTracer`; boolean, required) — `true` when the note marks the line as a tracer service.
      - `key` (`adoptNoteExtraction.response.200.data.definition.lines.key`; string, required) — Line key, unique within the note (1 to 120 characters).
      - `route` (`adoptNoteExtraction.response.200.data.definition.lines.route`; string, required) — Care route the line belongs to, as written (1 to 120 characters).
      - `scope` (`adoptNoteExtraction.response.200.data.definition.lines.scope`; string, required) — Role of the line.
        - one of `"included"`, `"sufficiency"`
      - `service` (`adoptNoteExtraction.response.200.data.definition.lines.service`; string, required) — Service description (1 to 240 characters).
      - `tracer` (`adoptNoteExtraction.response.200.data.definition.lines.tracer`; string | null, required) — Tracer label (1 to 160 characters); `null` when not stated.
      - `unit` (`adoptNoteExtraction.response.200.data.definition.lines.unit`; string | null, required) — Unit label (1 to 160 characters); `null` when not stated.
      - `unitPrice` (`adoptNoteExtraction.response.200.data.definition.lines.unitPrice`; one of, required)
        - one of: `NoteDecimal`, `null`
    - `lowerBand` (`adoptNoteExtraction.response.200.data.definition.lowerBand`; string, required) — Lower execution band in percent, from 0 to 100.
    - `modality` (`adoptNoteExtraction.response.200.data.definition.modality`; one of, required)
      - one of: `PaymentMode`, `null`
    - `name` (`adoptNoteExtraction.response.200.data.definition.name`; string, required) — Display name (1 to 200 characters).
    - `perCapitaMonth` (`adoptNoteExtraction.response.200.data.definition.perCapitaMonth`; one of, required)
      - one of: `NoteDecimal`, `null`
    - `proration` (`adoptNoteExtraction.response.200.data.definition.proration`; string, required) — How offered quantities are prorated.
      - one of `"calendar_days"`, `"none"`
    - `purposeRoutes` (`adoptNoteExtraction.response.200.data.definition.purposeRoutes`; map<string>, required) — Up to 100 authored entries mapping a purpose label (1 to 80 characters) to a route name (1 to 120 characters).
    - `requirements` (`adoptNoteExtraction.response.200.data.definition.requirements`; array<object>, required) — Clinical requirements: up to 200 with unique keys.
      - `acceptedEvidence` (`adoptNoteExtraction.response.200.data.definition.requirements.acceptedEvidence`; string, required) — Evidence that satisfies it.
        - one of `"performance"`, `"complete_result"`
      - `cadence` (`adoptNoteExtraction.response.200.data.definition.requirements.cadence`; object, required) — When the requirement is due.
        - `anchorDate` (`adoptNoteExtraction.response.200.data.definition.requirements.cadence.anchorDate`; string, required) — Date the cadence counts from (`YYYY-MM-DD`, not before 1970-01-01).
        - `every` (`adoptNoteExtraction.response.200.data.definition.requirements.cadence.every`; string, required) — Interval length in `unit`: integer string from 1 to 3660.
        - `graceDays` (`adoptNoteExtraction.response.200.data.definition.requirements.cadence.graceDays`; string, required) — Extra days allowed after a due date: integer string from 0 to 366, shorter than one interval (a month counts 28 days, a year 365).
        - `timeZone` (`adoptNoteExtraction.response.200.data.definition.requirements.cadence.timeZone`; string, required) — Time zone; must equal the note's `timeZone`.
        - `unit` (`adoptNoteExtraction.response.200.data.definition.requirements.cadence.unit`; string, required) — Unit of the interval.
          - one of `"day"`, `"month"`, `"year"`, `"once"`
      - `cohortId` (`adoptNoteExtraction.response.200.data.definition.requirements.cohortId`; string | null, required) — Active cohort whose current members the requirement selects; `null` if none.
      - `key` (`adoptNoteExtraction.response.200.data.definition.requirements.key`; string, required) — Requirement identifier, unique within the note (`^[a-z][a-z0-9_-]{0,127}$`).
      - `lineKey` (`adoptNoteExtraction.response.200.data.definition.requirements.lineKey`; string | null, required) — Key of the note line this requirement serves; `null` if none.
      - `programId` (`adoptNoteExtraction.response.200.data.definition.requirements.programId`; string | null, required) — Active program whose enrolled patients the requirement selects; `null` if none.
      - `service` (`adoptNoteExtraction.response.200.data.definition.requirements.service`; object, required) — Coded service that satisfies the requirement.
        - `code` (`adoptNoteExtraction.response.200.data.definition.requirements.service.code`; string, required) — Code within the system, 1 to 128 characters.
        - `display` (`adoptNoteExtraction.response.200.data.definition.requirements.service.display`; string, required) — Human-readable label, 1 to 200 characters; never used to identify the concept.
        - `system` (`adoptNoteExtraction.response.200.data.definition.requirements.service.system`; string, required) — Code system as a URI or URN: must contain `:` and no whitespace, 1 to 200 characters.
        - `version` (`adoptNoteExtraction.response.200.data.definition.requirements.service.version`; string, required) — Version of the code system, 1 to 64 characters.
      - `sourceReference` (`adoptNoteExtraction.response.200.data.definition.requirements.sourceReference`; string, required) — Where the requirement comes from in the source document (1 to 512 characters).
      - `studyDefinitionId` (`adoptNoteExtraction.response.200.data.definition.requirements.studyDefinitionId`; string | null, required) — Study definition that delivers the service; required before approval.
      - `studyDefinitionVersion` (`adoptNoteExtraction.response.200.data.definition.requirements.studyDefinitionVersion`; string | null, required) — Active approved revision of that definition, with the same `service`; set together with `studyDefinitionId`.
      - `title` (`adoptNoteExtraction.response.200.data.definition.requirements.title`; string, required) — Display title (1 to 200 characters).
    - `sourceLabel` (`adoptNoteExtraction.response.200.data.definition.sourceLabel`; string, required) — Label of the source the note comes from (1 to 240 characters).
    - `timeZone` (`adoptNoteExtraction.response.200.data.definition.timeZone`; string, required) — Note calendar: `UTC`, `America/Bogota`, `America/Lima`, `America/Mexico_City`, `America/Santiago` or `America/Sao_Paulo`.
    - `upperBand` (`adoptNoteExtraction.response.200.data.definition.upperBand`; string, required) — Upper execution band in percent, from 100 to 1000.
    - `validFrom` (`adoptNoteExtraction.response.200.data.definition.validFrom`; string, required) — First day the note applies (`YYYY-MM-DD`, inclusive, from 1970-01-01).
    - `validTo` (`adoptNoteExtraction.response.200.data.definition.validTo`; string, required) — Last day the note applies (`YYYY-MM-DD`, inclusive, up to 9998-12-31).
    - `agreedValue` (`adoptNoteExtraction.response.200.data.definition.agreedValue`; one of, optional)
      - one of: `NoteDecimal`, `null`
    - `monitoringPeriodicity` (`adoptNoteExtraction.response.200.data.definition.monitoringPeriodicity`; one of, optional)
      - one of: `MonitoringPeriodicity`, `null`
    - `paymentBasis` (`adoptNoteExtraction.response.200.data.definition.paymentBasis`; one of, optional)
      - one of: `NotePaymentBasis`, `null`
    - `riskCharacterization` (`adoptNoteExtraction.response.200.data.definition.riskCharacterization`; one of, optional)
      - one of: `RiskCharacterization`, `null`
  - `id` (`adoptNoteExtraction.response.200.data.id`; string, required) — Note identifier.
  - `number` (`adoptNoteExtraction.response.200.data.number`; string, required) — Sequence number of the note within the contract (decimal string, from 1).
  - `proposedAt` (`adoptNoteExtraction.response.200.data.proposedAt`; string | null, required) — Proposal time (RFC 3339, UTC); `null` while draft.
  - `proposedBy` (`adoptNoteExtraction.response.200.data.proposedBy`; string | null, required) — Actor who proposed the note; `null` while draft.
  - `reconciledExamples` (`adoptNoteExtraction.response.200.data.reconciledExamples`; one of, required)
    - one of: `ContractArtifact`, `null`
  - `source` (`adoptNoteExtraction.response.200.data.source`; object, required) — Note document.
    - `reference` (`adoptNoteExtraction.response.200.data.source.reference`; string, required) — `artifact:<id>` for a file uploaded with `reserveContractArtifact` (it must be `ready` and match `sha256`), or any other reference: 1 to 512 characters, trimmed, without control characters.
    - `sha256` (`adoptNoteExtraction.response.200.data.source.sha256`; string, required) — SHA-256 of the document bytes: 64 lowercase hexadecimal characters.
  - `state` (`adoptNoteExtraction.response.200.data.state`; string, required) — Approval state.
    - one of `"draft"`, `"proposed"`, `"approved"`
  - `variantOfId` (`adoptNoteExtraction.response.200.data.variantOfId`; string | null, required) — Note this one is a variant of; `null` if none.
  - `version` (`adoptNoteExtraction.response.200.data.version`; string, required) — Revision: `1` draft, `2` proposed, `3` approved (decimal string).
- `metadata` (`adoptNoteExtraction.response.200.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`adoptNoteExtraction.response.200.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`adoptNoteExtraction.response.200.success`; boolean, required) — Always `true` in a success envelope.
  - one of `true`

### 400

Failure. The `error.code` is one of:
- `INVALID_INPUT`: Do not retry unchanged. Fix the request against the operation's schema.
- `USER_PAYMENT_REFUSED`: Check the collection basis and caps in details.paymentProblem before recording the payment.
- `INVALID_INVENTORY`: Do not retry unchanged. Fix the request against the operation's schema.
- `ANALYTICS_QUERY_REJECTED`: Rewrite the query as one read-only statement over the published catalog.
- `MINOR_UNIT_SCALE_MISMATCH`: Write each component's money in the minor units of its currency (minorUnitScale 2 for COP, PEN, MXN and BRL; 0 for CLP) and propose again.

#### Example

```json
{
  "error": {
    "code": "INVALID_INPUT",
    "message": "The request does not match the documented contract."
  },
  "metadata": {
    "requestId": "3f2b8c1e-5d4a-4b6f-9c2e-0a1b2c3d4e5f"
  },
  "success": false
}
```

- `error` (`adoptNoteExtraction.response.400.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`adoptNoteExtraction.response.400.error.code`; string, required) — Stable failure code. Branch on this value, never on `message`. - `UNAUTHORIZED` (HTTP 401): A valid access token is required. Obtain a fresh access token and repeat the request. - `AUTHENTICATION_UNAVAILABLE` (HTTP 503): Identity verification is temporarily unavailable. Retry later with backoff; for a write, reuse the same requestKey. - `ACCESS_DENIED` (HTTP 403): Access denied. Do not retry. The signed-in actor lacks this purpose or grant; ask an administrator. - `MODULE_DISABLED` (HTTP 403): This operation belongs to a module the organization does not use. Do not retry. The organization does not use the module in details.module (getSession lists the ones it uses); an administrator turns it on with setOrganizationModules. - `INVALID_INPUT` (HTTP 400): The request does not match the documented contract. Do not retry unchanged. Fix the request against the operation's schema. - `USER_PAYMENT_REFUSED` (HTTP 400): The collection exceeds the applicable payment rules. Check the collection basis and caps in details.paymentProblem before recording the payment. - `INVALID_INVENTORY` (HTTP 400): The content does not match the selected inventory contract. Do not retry unchanged. Fix the request against the operation's schema. - `ANALYTICS_QUERY_REJECTED` (HTTP 400): Use one read-only query over the admitted catalog and its supported functions. Rewrite the query as one read-only statement over the published catalog. - `BODY_TOO_LARGE` (HTTP 413): The request body exceeds the supported limit. Send a smaller body, or split the content into several requests. - `NOT_FOUND` (HTTP 404): The resource does not exist. Check the identifier. The record may not exist or may not be visible to this actor. - `METHOD_NOT_ALLOWED` (HTTP 405): The method is not supported for this resource. Use the HTTP method documented for this path. - `CONFLICT` (HTTP 409): The resource conflicts with its current state. Read the current state with the matching get operation, then decide again. - `IDEMPOTENCY_CONFLICT` (HTTP 409): The command key already identifies a different request. The requestKey was already used for a different request. Use a new key for a new action. - `TRANSACTION_ABORTED` (HTTP 409): The transaction rolled back without committing changes. Nothing was written. Retry the same request. - `INVENTORY_INTEGRITY_CONFLICT` (HTTP 409): The current build failed integrity verification. Do not retry. Report the integrity failure to an operator. - `TEAM_PRIOR_UNRESOLVED` (HTTP 409): Reconcile the existing team command before preparing another change. Reconcile the earlier team command (see details.commandId) before a new change. - `COHORT_ACTIVE_REQUIRED` (HTTP 409): Only an active cohort can create a new candidate snapshot. Read the current state with the matching get operation, then decide again. - `COHORT_CUT_CHANGED` (HTTP 409): The current cohort cut changed. Restart this read from the first page. Restart the paginated read from the first page. - `COHORT_READ_REQUIRES_ACTIVE` (HTTP 409): Only an active cohort has a current care-facts view. Read the current state with the matching get operation, then decide again. - `COHORT_CUT_NEEDS_RECONCILIATION` (HTTP 409): The cohort cut needs reconciliation before its care facts can be read. Read the current state with the matching get operation, then decide again. - `PROGRAM_NEW_ASSESSMENT_REQUIRED` (HTTP 409): Select a new eligible assessment recorded after the last participation change. Read the current state with the matching get operation, then decide again. - `CONTRACT_CLOSED_WINDOW_CHANGE_UNSUPPORTED` (HTTP 409): The proposed terms change component identities already fixed by an accepted close. Read the current state with the matching get operation, then decide again. - `MINOR_UNIT_SCALE_MISMATCH` (HTTP 400): A component's money is not in the minor units of its currency (ISO 4217). Write each component's money in the minor units of its currency (minorUnitScale 2 for COP, PEN, MXN and BRL; 0 for CLP) and propose again. - `INVOICE_COMPONENT_AMBIGUOUS` (HTTP 409): Invoice lines have no unique fee-for-service component. Route the lines in details.lineIds to their paying component, then request the proposal again. At most 100 identifiers are returned. - `SITE_SUBSTITUTION_REFUSED` (HTTP 409): The contract does not let this site serve for the contracted site as booked. Book at the contracted site, or at a site its contract lets serve for it on the appointment's day (listContractSites), recording what details.reason says is missing: the patient's acceptance or the payer's authorization. - `RESOURCE_LIMIT_EXCEEDED` (HTTP 422): This resource has reached its supported capacity. Do not retry. Reduce the request or archive records first. - `MODULE_NOT_CONTRACTED` (HTTP 422): The organization did not contract this module. Leave the module in details.module off: the organization did not contract it. Árbol adds it to the contract when the organization buys it. - `MODULE_REQUIREMENT_MISSING` (HTTP 422): This module needs one of the modules it requires to be on. Turn on, in the same request, one of the modules the module in details.module requires (getOrganizationModules lists them). - `CAPABILITY_NOT_CONFIGURED` (HTTP 422): This operation requires its governed native implementation before it can be activated. Do not retry. The capability is not enabled for this organization. - `INSTALLATION_NOT_READY` (HTTP 422): The installation cannot be activated: its app version is not certified or a credential its app declares is missing. Do not retry unchanged. Wait for a certified app version, record examples that cover every operation and change of a custom-http installation, or add the missing credentials to the deployment, then activate again. - `EVIDENCE_NOT_READABLE` (HTTP 422): Accepting evidence requires readable content and independent reporter provenance. Leave it pending until its source is readable. Leave the evidence pending until its source content is readable. - `ANALYTICS_QUERY_LIMIT` (HTTP 422): The query exceeded its bounded work, memory or output budget. Narrow the query. Narrow the query (filters, columns or range) and retry. - `COMMIT_UNCERTAIN` (HTTP 503): The commit outcome is unknown. Reconcile before retrying. The write may have happened. Repeat it with the same requestKey or read the record first. - `DATABASE_UNAVAILABLE` (HTTP 503): The database is unavailable. Retry later with backoff; for a write, reuse the same requestKey. - `PIPELINE_UNAVAILABLE` (HTTP 503): The pipeline is unavailable. Reconcile using the same request key. The write may have happened. Repeat it with the same requestKey or read the record first. - `ASSISTANT_UNAVAILABLE` (HTTP 503): The assistant is not available for this workspace. Do not retry. The capability is not enabled for this organization. - `SERVICE_BUSY` (HTTP 503): The service is handling its current request limit. Retry later with backoff; for a write, reuse the same requestKey. - `INVALID_CONFIGURATION` (HTTP 500): The request could not be completed. Retry once later; if it persists, report the requestId to support. - `INTERNAL` (HTTP 500): The request could not be completed. Retry once later; if it persists, report the requestId to support.
    - one of `"UNAUTHORIZED"`, `"AUTHENTICATION_UNAVAILABLE"`, `"ACCESS_DENIED"`, `"MODULE_DISABLED"`, `"INVALID_INPUT"`, `"USER_PAYMENT_REFUSED"`, `"INVALID_INVENTORY"`, `"ANALYTICS_QUERY_REJECTED"`, `"BODY_TOO_LARGE"`, `"NOT_FOUND"`, `"METHOD_NOT_ALLOWED"`, `"CONFLICT"`, `"IDEMPOTENCY_CONFLICT"`, `"TRANSACTION_ABORTED"`, `"INVENTORY_INTEGRITY_CONFLICT"`, `"TEAM_PRIOR_UNRESOLVED"`, `"COHORT_ACTIVE_REQUIRED"`, `"COHORT_CUT_CHANGED"`, `"COHORT_READ_REQUIRES_ACTIVE"`, `"COHORT_CUT_NEEDS_RECONCILIATION"`, `"PROGRAM_NEW_ASSESSMENT_REQUIRED"`, `"CONTRACT_CLOSED_WINDOW_CHANGE_UNSUPPORTED"`, `"MINOR_UNIT_SCALE_MISMATCH"`, `"INVOICE_COMPONENT_AMBIGUOUS"`, `"SITE_SUBSTITUTION_REFUSED"`, `"RESOURCE_LIMIT_EXCEEDED"`, `"MODULE_NOT_CONTRACTED"`, `"MODULE_REQUIREMENT_MISSING"`, `"CAPABILITY_NOT_CONFIGURED"`, `"INSTALLATION_NOT_READY"`, `"EVIDENCE_NOT_READABLE"`, `"ANALYTICS_QUERY_LIMIT"`, `"COMMIT_UNCERTAIN"`, `"DATABASE_UNAVAILABLE"`, `"PIPELINE_UNAVAILABLE"`, `"ASSISTANT_UNAVAILABLE"`, `"SERVICE_BUSY"`, `"INVALID_CONFIGURATION"`, `"INTERNAL"`; example `"INVALID_INPUT"`
  - `message` (`adoptNoteExtraction.response.400.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`adoptNoteExtraction.response.400.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`adoptNoteExtraction.response.400.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`adoptNoteExtraction.response.400.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`adoptNoteExtraction.response.400.error.details.module`; string, optional) — The module the failure is about, for example `agenda`.
      - one of `"pgp"`, `"capitation"`, `"fee_for_service"`, `"results_payment"`, `"service_record"`, `"cac"`, `"cohorts"`, `"studies"`, `"agenda"`, `"voice"`, `"whatsapp"`, `"sms"`, `"email"`, `"arbi"`, `"ai_documents"`, `"ai_care"`, `"analytics"`
    - `paymentProblem` (`adoptNoteExtraction.response.400.error.details.paymentProblem`; string, optional) — Why the collection was refused.
      - one of `"rules_unavailable"`, `"not_collectable"`, `"not_for_this_person"`, `"basis_incomplete"`, `"moderator_fee_value"`, `"service_value_unavailable"`, `"above_share"`, `"above_event_cap"`, `"above_year_cap"`
    - `reason` (`adoptNoteExtraction.response.400.error.details.reason`; string, optional) — Why the booking's site was refused: `not_contracted` (the contracted site is not one of the contract that day), `not_a_substitute` (no substitution in force that day lets the site serve for it), `patient_acceptance_missing` or `payer_authorization_missing` (the substitution asks for them).
      - one of `"not_contracted"`, `"not_a_substitute"`, `"patient_acceptance_missing"`, `"payer_authorization_missing"`
- `metadata` (`adoptNoteExtraction.response.400.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`adoptNoteExtraction.response.400.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`adoptNoteExtraction.response.400.success`; boolean, required) — Always `false` in a failure envelope.
  - one of `false`

### 401

Failure. The `error.code` is one of:
- `UNAUTHORIZED`: Obtain a fresh access token and repeat the request.

#### Example

```json
{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "A valid access token is required."
  },
  "metadata": {
    "requestId": "3f2b8c1e-5d4a-4b6f-9c2e-0a1b2c3d4e5f"
  },
  "success": false
}
```

- `error` (`adoptNoteExtraction.response.401.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`adoptNoteExtraction.response.401.error.code`; string, required) — Stable failure code. Branch on this value, never on `message`. - `UNAUTHORIZED` (HTTP 401): A valid access token is required. Obtain a fresh access token and repeat the request. - `AUTHENTICATION_UNAVAILABLE` (HTTP 503): Identity verification is temporarily unavailable. Retry later with backoff; for a write, reuse the same requestKey. - `ACCESS_DENIED` (HTTP 403): Access denied. Do not retry. The signed-in actor lacks this purpose or grant; ask an administrator. - `MODULE_DISABLED` (HTTP 403): This operation belongs to a module the organization does not use. Do not retry. The organization does not use the module in details.module (getSession lists the ones it uses); an administrator turns it on with setOrganizationModules. - `INVALID_INPUT` (HTTP 400): The request does not match the documented contract. Do not retry unchanged. Fix the request against the operation's schema. - `USER_PAYMENT_REFUSED` (HTTP 400): The collection exceeds the applicable payment rules. Check the collection basis and caps in details.paymentProblem before recording the payment. - `INVALID_INVENTORY` (HTTP 400): The content does not match the selected inventory contract. Do not retry unchanged. Fix the request against the operation's schema. - `ANALYTICS_QUERY_REJECTED` (HTTP 400): Use one read-only query over the admitted catalog and its supported functions. Rewrite the query as one read-only statement over the published catalog. - `BODY_TOO_LARGE` (HTTP 413): The request body exceeds the supported limit. Send a smaller body, or split the content into several requests. - `NOT_FOUND` (HTTP 404): The resource does not exist. Check the identifier. The record may not exist or may not be visible to this actor. - `METHOD_NOT_ALLOWED` (HTTP 405): The method is not supported for this resource. Use the HTTP method documented for this path. - `CONFLICT` (HTTP 409): The resource conflicts with its current state. Read the current state with the matching get operation, then decide again. - `IDEMPOTENCY_CONFLICT` (HTTP 409): The command key already identifies a different request. The requestKey was already used for a different request. Use a new key for a new action. - `TRANSACTION_ABORTED` (HTTP 409): The transaction rolled back without committing changes. Nothing was written. Retry the same request. - `INVENTORY_INTEGRITY_CONFLICT` (HTTP 409): The current build failed integrity verification. Do not retry. Report the integrity failure to an operator. - `TEAM_PRIOR_UNRESOLVED` (HTTP 409): Reconcile the existing team command before preparing another change. Reconcile the earlier team command (see details.commandId) before a new change. - `COHORT_ACTIVE_REQUIRED` (HTTP 409): Only an active cohort can create a new candidate snapshot. Read the current state with the matching get operation, then decide again. - `COHORT_CUT_CHANGED` (HTTP 409): The current cohort cut changed. Restart this read from the first page. Restart the paginated read from the first page. - `COHORT_READ_REQUIRES_ACTIVE` (HTTP 409): Only an active cohort has a current care-facts view. Read the current state with the matching get operation, then decide again. - `COHORT_CUT_NEEDS_RECONCILIATION` (HTTP 409): The cohort cut needs reconciliation before its care facts can be read. Read the current state with the matching get operation, then decide again. - `PROGRAM_NEW_ASSESSMENT_REQUIRED` (HTTP 409): Select a new eligible assessment recorded after the last participation change. Read the current state with the matching get operation, then decide again. - `CONTRACT_CLOSED_WINDOW_CHANGE_UNSUPPORTED` (HTTP 409): The proposed terms change component identities already fixed by an accepted close. Read the current state with the matching get operation, then decide again. - `MINOR_UNIT_SCALE_MISMATCH` (HTTP 400): A component's money is not in the minor units of its currency (ISO 4217). Write each component's money in the minor units of its currency (minorUnitScale 2 for COP, PEN, MXN and BRL; 0 for CLP) and propose again. - `INVOICE_COMPONENT_AMBIGUOUS` (HTTP 409): Invoice lines have no unique fee-for-service component. Route the lines in details.lineIds to their paying component, then request the proposal again. At most 100 identifiers are returned. - `SITE_SUBSTITUTION_REFUSED` (HTTP 409): The contract does not let this site serve for the contracted site as booked. Book at the contracted site, or at a site its contract lets serve for it on the appointment's day (listContractSites), recording what details.reason says is missing: the patient's acceptance or the payer's authorization. - `RESOURCE_LIMIT_EXCEEDED` (HTTP 422): This resource has reached its supported capacity. Do not retry. Reduce the request or archive records first. - `MODULE_NOT_CONTRACTED` (HTTP 422): The organization did not contract this module. Leave the module in details.module off: the organization did not contract it. Árbol adds it to the contract when the organization buys it. - `MODULE_REQUIREMENT_MISSING` (HTTP 422): This module needs one of the modules it requires to be on. Turn on, in the same request, one of the modules the module in details.module requires (getOrganizationModules lists them). - `CAPABILITY_NOT_CONFIGURED` (HTTP 422): This operation requires its governed native implementation before it can be activated. Do not retry. The capability is not enabled for this organization. - `INSTALLATION_NOT_READY` (HTTP 422): The installation cannot be activated: its app version is not certified or a credential its app declares is missing. Do not retry unchanged. Wait for a certified app version, record examples that cover every operation and change of a custom-http installation, or add the missing credentials to the deployment, then activate again. - `EVIDENCE_NOT_READABLE` (HTTP 422): Accepting evidence requires readable content and independent reporter provenance. Leave it pending until its source is readable. Leave the evidence pending until its source content is readable. - `ANALYTICS_QUERY_LIMIT` (HTTP 422): The query exceeded its bounded work, memory or output budget. Narrow the query. Narrow the query (filters, columns or range) and retry. - `COMMIT_UNCERTAIN` (HTTP 503): The commit outcome is unknown. Reconcile before retrying. The write may have happened. Repeat it with the same requestKey or read the record first. - `DATABASE_UNAVAILABLE` (HTTP 503): The database is unavailable. Retry later with backoff; for a write, reuse the same requestKey. - `PIPELINE_UNAVAILABLE` (HTTP 503): The pipeline is unavailable. Reconcile using the same request key. The write may have happened. Repeat it with the same requestKey or read the record first. - `ASSISTANT_UNAVAILABLE` (HTTP 503): The assistant is not available for this workspace. Do not retry. The capability is not enabled for this organization. - `SERVICE_BUSY` (HTTP 503): The service is handling its current request limit. Retry later with backoff; for a write, reuse the same requestKey. - `INVALID_CONFIGURATION` (HTTP 500): The request could not be completed. Retry once later; if it persists, report the requestId to support. - `INTERNAL` (HTTP 500): The request could not be completed. Retry once later; if it persists, report the requestId to support.
    - one of `"UNAUTHORIZED"`, `"AUTHENTICATION_UNAVAILABLE"`, `"ACCESS_DENIED"`, `"MODULE_DISABLED"`, `"INVALID_INPUT"`, `"USER_PAYMENT_REFUSED"`, `"INVALID_INVENTORY"`, `"ANALYTICS_QUERY_REJECTED"`, `"BODY_TOO_LARGE"`, `"NOT_FOUND"`, `"METHOD_NOT_ALLOWED"`, `"CONFLICT"`, `"IDEMPOTENCY_CONFLICT"`, `"TRANSACTION_ABORTED"`, `"INVENTORY_INTEGRITY_CONFLICT"`, `"TEAM_PRIOR_UNRESOLVED"`, `"COHORT_ACTIVE_REQUIRED"`, `"COHORT_CUT_CHANGED"`, `"COHORT_READ_REQUIRES_ACTIVE"`, `"COHORT_CUT_NEEDS_RECONCILIATION"`, `"PROGRAM_NEW_ASSESSMENT_REQUIRED"`, `"CONTRACT_CLOSED_WINDOW_CHANGE_UNSUPPORTED"`, `"MINOR_UNIT_SCALE_MISMATCH"`, `"INVOICE_COMPONENT_AMBIGUOUS"`, `"SITE_SUBSTITUTION_REFUSED"`, `"RESOURCE_LIMIT_EXCEEDED"`, `"MODULE_NOT_CONTRACTED"`, `"MODULE_REQUIREMENT_MISSING"`, `"CAPABILITY_NOT_CONFIGURED"`, `"INSTALLATION_NOT_READY"`, `"EVIDENCE_NOT_READABLE"`, `"ANALYTICS_QUERY_LIMIT"`, `"COMMIT_UNCERTAIN"`, `"DATABASE_UNAVAILABLE"`, `"PIPELINE_UNAVAILABLE"`, `"ASSISTANT_UNAVAILABLE"`, `"SERVICE_BUSY"`, `"INVALID_CONFIGURATION"`, `"INTERNAL"`; example `"INVALID_INPUT"`
  - `message` (`adoptNoteExtraction.response.401.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`adoptNoteExtraction.response.401.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`adoptNoteExtraction.response.401.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`adoptNoteExtraction.response.401.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`adoptNoteExtraction.response.401.error.details.module`; string, optional) — The module the failure is about, for example `agenda`.
      - one of `"pgp"`, `"capitation"`, `"fee_for_service"`, `"results_payment"`, `"service_record"`, `"cac"`, `"cohorts"`, `"studies"`, `"agenda"`, `"voice"`, `"whatsapp"`, `"sms"`, `"email"`, `"arbi"`, `"ai_documents"`, `"ai_care"`, `"analytics"`
    - `paymentProblem` (`adoptNoteExtraction.response.401.error.details.paymentProblem`; string, optional) — Why the collection was refused.
      - one of `"rules_unavailable"`, `"not_collectable"`, `"not_for_this_person"`, `"basis_incomplete"`, `"moderator_fee_value"`, `"service_value_unavailable"`, `"above_share"`, `"above_event_cap"`, `"above_year_cap"`
    - `reason` (`adoptNoteExtraction.response.401.error.details.reason`; string, optional) — Why the booking's site was refused: `not_contracted` (the contracted site is not one of the contract that day), `not_a_substitute` (no substitution in force that day lets the site serve for it), `patient_acceptance_missing` or `payer_authorization_missing` (the substitution asks for them).
      - one of `"not_contracted"`, `"not_a_substitute"`, `"patient_acceptance_missing"`, `"payer_authorization_missing"`
- `metadata` (`adoptNoteExtraction.response.401.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`adoptNoteExtraction.response.401.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`adoptNoteExtraction.response.401.success`; boolean, required) — Always `false` in a failure envelope.
  - one of `false`

### 403

Failure. The `error.code` is one of:
- `ACCESS_DENIED`: Do not retry. The signed-in actor lacks this purpose or grant; ask an administrator.
- `MODULE_DISABLED`: Do not retry. The organization does not use the module in details.module (getSession lists the ones it uses); an administrator turns it on with setOrganizationModules.

#### Example

```json
{
  "error": {
    "code": "ACCESS_DENIED",
    "message": "Access denied."
  },
  "metadata": {
    "requestId": "3f2b8c1e-5d4a-4b6f-9c2e-0a1b2c3d4e5f"
  },
  "success": false
}
```

- `error` (`adoptNoteExtraction.response.403.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`adoptNoteExtraction.response.403.error.code`; string, required) — Stable failure code. Branch on this value, never on `message`. - `UNAUTHORIZED` (HTTP 401): A valid access token is required. Obtain a fresh access token and repeat the request. - `AUTHENTICATION_UNAVAILABLE` (HTTP 503): Identity verification is temporarily unavailable. Retry later with backoff; for a write, reuse the same requestKey. - `ACCESS_DENIED` (HTTP 403): Access denied. Do not retry. The signed-in actor lacks this purpose or grant; ask an administrator. - `MODULE_DISABLED` (HTTP 403): This operation belongs to a module the organization does not use. Do not retry. The organization does not use the module in details.module (getSession lists the ones it uses); an administrator turns it on with setOrganizationModules. - `INVALID_INPUT` (HTTP 400): The request does not match the documented contract. Do not retry unchanged. Fix the request against the operation's schema. - `USER_PAYMENT_REFUSED` (HTTP 400): The collection exceeds the applicable payment rules. Check the collection basis and caps in details.paymentProblem before recording the payment. - `INVALID_INVENTORY` (HTTP 400): The content does not match the selected inventory contract. Do not retry unchanged. Fix the request against the operation's schema. - `ANALYTICS_QUERY_REJECTED` (HTTP 400): Use one read-only query over the admitted catalog and its supported functions. Rewrite the query as one read-only statement over the published catalog. - `BODY_TOO_LARGE` (HTTP 413): The request body exceeds the supported limit. Send a smaller body, or split the content into several requests. - `NOT_FOUND` (HTTP 404): The resource does not exist. Check the identifier. The record may not exist or may not be visible to this actor. - `METHOD_NOT_ALLOWED` (HTTP 405): The method is not supported for this resource. Use the HTTP method documented for this path. - `CONFLICT` (HTTP 409): The resource conflicts with its current state. Read the current state with the matching get operation, then decide again. - `IDEMPOTENCY_CONFLICT` (HTTP 409): The command key already identifies a different request. The requestKey was already used for a different request. Use a new key for a new action. - `TRANSACTION_ABORTED` (HTTP 409): The transaction rolled back without committing changes. Nothing was written. Retry the same request. - `INVENTORY_INTEGRITY_CONFLICT` (HTTP 409): The current build failed integrity verification. Do not retry. Report the integrity failure to an operator. - `TEAM_PRIOR_UNRESOLVED` (HTTP 409): Reconcile the existing team command before preparing another change. Reconcile the earlier team command (see details.commandId) before a new change. - `COHORT_ACTIVE_REQUIRED` (HTTP 409): Only an active cohort can create a new candidate snapshot. Read the current state with the matching get operation, then decide again. - `COHORT_CUT_CHANGED` (HTTP 409): The current cohort cut changed. Restart this read from the first page. Restart the paginated read from the first page. - `COHORT_READ_REQUIRES_ACTIVE` (HTTP 409): Only an active cohort has a current care-facts view. Read the current state with the matching get operation, then decide again. - `COHORT_CUT_NEEDS_RECONCILIATION` (HTTP 409): The cohort cut needs reconciliation before its care facts can be read. Read the current state with the matching get operation, then decide again. - `PROGRAM_NEW_ASSESSMENT_REQUIRED` (HTTP 409): Select a new eligible assessment recorded after the last participation change. Read the current state with the matching get operation, then decide again. - `CONTRACT_CLOSED_WINDOW_CHANGE_UNSUPPORTED` (HTTP 409): The proposed terms change component identities already fixed by an accepted close. Read the current state with the matching get operation, then decide again. - `MINOR_UNIT_SCALE_MISMATCH` (HTTP 400): A component's money is not in the minor units of its currency (ISO 4217). Write each component's money in the minor units of its currency (minorUnitScale 2 for COP, PEN, MXN and BRL; 0 for CLP) and propose again. - `INVOICE_COMPONENT_AMBIGUOUS` (HTTP 409): Invoice lines have no unique fee-for-service component. Route the lines in details.lineIds to their paying component, then request the proposal again. At most 100 identifiers are returned. - `SITE_SUBSTITUTION_REFUSED` (HTTP 409): The contract does not let this site serve for the contracted site as booked. Book at the contracted site, or at a site its contract lets serve for it on the appointment's day (listContractSites), recording what details.reason says is missing: the patient's acceptance or the payer's authorization. - `RESOURCE_LIMIT_EXCEEDED` (HTTP 422): This resource has reached its supported capacity. Do not retry. Reduce the request or archive records first. - `MODULE_NOT_CONTRACTED` (HTTP 422): The organization did not contract this module. Leave the module in details.module off: the organization did not contract it. Árbol adds it to the contract when the organization buys it. - `MODULE_REQUIREMENT_MISSING` (HTTP 422): This module needs one of the modules it requires to be on. Turn on, in the same request, one of the modules the module in details.module requires (getOrganizationModules lists them). - `CAPABILITY_NOT_CONFIGURED` (HTTP 422): This operation requires its governed native implementation before it can be activated. Do not retry. The capability is not enabled for this organization. - `INSTALLATION_NOT_READY` (HTTP 422): The installation cannot be activated: its app version is not certified or a credential its app declares is missing. Do not retry unchanged. Wait for a certified app version, record examples that cover every operation and change of a custom-http installation, or add the missing credentials to the deployment, then activate again. - `EVIDENCE_NOT_READABLE` (HTTP 422): Accepting evidence requires readable content and independent reporter provenance. Leave it pending until its source is readable. Leave the evidence pending until its source content is readable. - `ANALYTICS_QUERY_LIMIT` (HTTP 422): The query exceeded its bounded work, memory or output budget. Narrow the query. Narrow the query (filters, columns or range) and retry. - `COMMIT_UNCERTAIN` (HTTP 503): The commit outcome is unknown. Reconcile before retrying. The write may have happened. Repeat it with the same requestKey or read the record first. - `DATABASE_UNAVAILABLE` (HTTP 503): The database is unavailable. Retry later with backoff; for a write, reuse the same requestKey. - `PIPELINE_UNAVAILABLE` (HTTP 503): The pipeline is unavailable. Reconcile using the same request key. The write may have happened. Repeat it with the same requestKey or read the record first. - `ASSISTANT_UNAVAILABLE` (HTTP 503): The assistant is not available for this workspace. Do not retry. The capability is not enabled for this organization. - `SERVICE_BUSY` (HTTP 503): The service is handling its current request limit. Retry later with backoff; for a write, reuse the same requestKey. - `INVALID_CONFIGURATION` (HTTP 500): The request could not be completed. Retry once later; if it persists, report the requestId to support. - `INTERNAL` (HTTP 500): The request could not be completed. Retry once later; if it persists, report the requestId to support.
    - one of `"UNAUTHORIZED"`, `"AUTHENTICATION_UNAVAILABLE"`, `"ACCESS_DENIED"`, `"MODULE_DISABLED"`, `"INVALID_INPUT"`, `"USER_PAYMENT_REFUSED"`, `"INVALID_INVENTORY"`, `"ANALYTICS_QUERY_REJECTED"`, `"BODY_TOO_LARGE"`, `"NOT_FOUND"`, `"METHOD_NOT_ALLOWED"`, `"CONFLICT"`, `"IDEMPOTENCY_CONFLICT"`, `"TRANSACTION_ABORTED"`, `"INVENTORY_INTEGRITY_CONFLICT"`, `"TEAM_PRIOR_UNRESOLVED"`, `"COHORT_ACTIVE_REQUIRED"`, `"COHORT_CUT_CHANGED"`, `"COHORT_READ_REQUIRES_ACTIVE"`, `"COHORT_CUT_NEEDS_RECONCILIATION"`, `"PROGRAM_NEW_ASSESSMENT_REQUIRED"`, `"CONTRACT_CLOSED_WINDOW_CHANGE_UNSUPPORTED"`, `"MINOR_UNIT_SCALE_MISMATCH"`, `"INVOICE_COMPONENT_AMBIGUOUS"`, `"SITE_SUBSTITUTION_REFUSED"`, `"RESOURCE_LIMIT_EXCEEDED"`, `"MODULE_NOT_CONTRACTED"`, `"MODULE_REQUIREMENT_MISSING"`, `"CAPABILITY_NOT_CONFIGURED"`, `"INSTALLATION_NOT_READY"`, `"EVIDENCE_NOT_READABLE"`, `"ANALYTICS_QUERY_LIMIT"`, `"COMMIT_UNCERTAIN"`, `"DATABASE_UNAVAILABLE"`, `"PIPELINE_UNAVAILABLE"`, `"ASSISTANT_UNAVAILABLE"`, `"SERVICE_BUSY"`, `"INVALID_CONFIGURATION"`, `"INTERNAL"`; example `"INVALID_INPUT"`
  - `message` (`adoptNoteExtraction.response.403.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`adoptNoteExtraction.response.403.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`adoptNoteExtraction.response.403.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`adoptNoteExtraction.response.403.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`adoptNoteExtraction.response.403.error.details.module`; string, optional) — The module the failure is about, for example `agenda`.
      - one of `"pgp"`, `"capitation"`, `"fee_for_service"`, `"results_payment"`, `"service_record"`, `"cac"`, `"cohorts"`, `"studies"`, `"agenda"`, `"voice"`, `"whatsapp"`, `"sms"`, `"email"`, `"arbi"`, `"ai_documents"`, `"ai_care"`, `"analytics"`
    - `paymentProblem` (`adoptNoteExtraction.response.403.error.details.paymentProblem`; string, optional) — Why the collection was refused.
      - one of `"rules_unavailable"`, `"not_collectable"`, `"not_for_this_person"`, `"basis_incomplete"`, `"moderator_fee_value"`, `"service_value_unavailable"`, `"above_share"`, `"above_event_cap"`, `"above_year_cap"`
    - `reason` (`adoptNoteExtraction.response.403.error.details.reason`; string, optional) — Why the booking's site was refused: `not_contracted` (the contracted site is not one of the contract that day), `not_a_substitute` (no substitution in force that day lets the site serve for it), `patient_acceptance_missing` or `payer_authorization_missing` (the substitution asks for them).
      - one of `"not_contracted"`, `"not_a_substitute"`, `"patient_acceptance_missing"`, `"payer_authorization_missing"`
- `metadata` (`adoptNoteExtraction.response.403.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`adoptNoteExtraction.response.403.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`adoptNoteExtraction.response.403.success`; boolean, required) — Always `false` in a failure envelope.
  - one of `false`

### 404

Failure. The `error.code` is one of:
- `NOT_FOUND`: Check the identifier. The record may not exist or may not be visible to this actor.

#### Example

```json
{
  "error": {
    "code": "NOT_FOUND",
    "message": "The resource does not exist."
  },
  "metadata": {
    "requestId": "3f2b8c1e-5d4a-4b6f-9c2e-0a1b2c3d4e5f"
  },
  "success": false
}
```

- `error` (`adoptNoteExtraction.response.404.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`adoptNoteExtraction.response.404.error.code`; string, required) — Stable failure code. Branch on this value, never on `message`. - `UNAUTHORIZED` (HTTP 401): A valid access token is required. Obtain a fresh access token and repeat the request. - `AUTHENTICATION_UNAVAILABLE` (HTTP 503): Identity verification is temporarily unavailable. Retry later with backoff; for a write, reuse the same requestKey. - `ACCESS_DENIED` (HTTP 403): Access denied. Do not retry. The signed-in actor lacks this purpose or grant; ask an administrator. - `MODULE_DISABLED` (HTTP 403): This operation belongs to a module the organization does not use. Do not retry. The organization does not use the module in details.module (getSession lists the ones it uses); an administrator turns it on with setOrganizationModules. - `INVALID_INPUT` (HTTP 400): The request does not match the documented contract. Do not retry unchanged. Fix the request against the operation's schema. - `USER_PAYMENT_REFUSED` (HTTP 400): The collection exceeds the applicable payment rules. Check the collection basis and caps in details.paymentProblem before recording the payment. - `INVALID_INVENTORY` (HTTP 400): The content does not match the selected inventory contract. Do not retry unchanged. Fix the request against the operation's schema. - `ANALYTICS_QUERY_REJECTED` (HTTP 400): Use one read-only query over the admitted catalog and its supported functions. Rewrite the query as one read-only statement over the published catalog. - `BODY_TOO_LARGE` (HTTP 413): The request body exceeds the supported limit. Send a smaller body, or split the content into several requests. - `NOT_FOUND` (HTTP 404): The resource does not exist. Check the identifier. The record may not exist or may not be visible to this actor. - `METHOD_NOT_ALLOWED` (HTTP 405): The method is not supported for this resource. Use the HTTP method documented for this path. - `CONFLICT` (HTTP 409): The resource conflicts with its current state. Read the current state with the matching get operation, then decide again. - `IDEMPOTENCY_CONFLICT` (HTTP 409): The command key already identifies a different request. The requestKey was already used for a different request. Use a new key for a new action. - `TRANSACTION_ABORTED` (HTTP 409): The transaction rolled back without committing changes. Nothing was written. Retry the same request. - `INVENTORY_INTEGRITY_CONFLICT` (HTTP 409): The current build failed integrity verification. Do not retry. Report the integrity failure to an operator. - `TEAM_PRIOR_UNRESOLVED` (HTTP 409): Reconcile the existing team command before preparing another change. Reconcile the earlier team command (see details.commandId) before a new change. - `COHORT_ACTIVE_REQUIRED` (HTTP 409): Only an active cohort can create a new candidate snapshot. Read the current state with the matching get operation, then decide again. - `COHORT_CUT_CHANGED` (HTTP 409): The current cohort cut changed. Restart this read from the first page. Restart the paginated read from the first page. - `COHORT_READ_REQUIRES_ACTIVE` (HTTP 409): Only an active cohort has a current care-facts view. Read the current state with the matching get operation, then decide again. - `COHORT_CUT_NEEDS_RECONCILIATION` (HTTP 409): The cohort cut needs reconciliation before its care facts can be read. Read the current state with the matching get operation, then decide again. - `PROGRAM_NEW_ASSESSMENT_REQUIRED` (HTTP 409): Select a new eligible assessment recorded after the last participation change. Read the current state with the matching get operation, then decide again. - `CONTRACT_CLOSED_WINDOW_CHANGE_UNSUPPORTED` (HTTP 409): The proposed terms change component identities already fixed by an accepted close. Read the current state with the matching get operation, then decide again. - `MINOR_UNIT_SCALE_MISMATCH` (HTTP 400): A component's money is not in the minor units of its currency (ISO 4217). Write each component's money in the minor units of its currency (minorUnitScale 2 for COP, PEN, MXN and BRL; 0 for CLP) and propose again. - `INVOICE_COMPONENT_AMBIGUOUS` (HTTP 409): Invoice lines have no unique fee-for-service component. Route the lines in details.lineIds to their paying component, then request the proposal again. At most 100 identifiers are returned. - `SITE_SUBSTITUTION_REFUSED` (HTTP 409): The contract does not let this site serve for the contracted site as booked. Book at the contracted site, or at a site its contract lets serve for it on the appointment's day (listContractSites), recording what details.reason says is missing: the patient's acceptance or the payer's authorization. - `RESOURCE_LIMIT_EXCEEDED` (HTTP 422): This resource has reached its supported capacity. Do not retry. Reduce the request or archive records first. - `MODULE_NOT_CONTRACTED` (HTTP 422): The organization did not contract this module. Leave the module in details.module off: the organization did not contract it. Árbol adds it to the contract when the organization buys it. - `MODULE_REQUIREMENT_MISSING` (HTTP 422): This module needs one of the modules it requires to be on. Turn on, in the same request, one of the modules the module in details.module requires (getOrganizationModules lists them). - `CAPABILITY_NOT_CONFIGURED` (HTTP 422): This operation requires its governed native implementation before it can be activated. Do not retry. The capability is not enabled for this organization. - `INSTALLATION_NOT_READY` (HTTP 422): The installation cannot be activated: its app version is not certified or a credential its app declares is missing. Do not retry unchanged. Wait for a certified app version, record examples that cover every operation and change of a custom-http installation, or add the missing credentials to the deployment, then activate again. - `EVIDENCE_NOT_READABLE` (HTTP 422): Accepting evidence requires readable content and independent reporter provenance. Leave it pending until its source is readable. Leave the evidence pending until its source content is readable. - `ANALYTICS_QUERY_LIMIT` (HTTP 422): The query exceeded its bounded work, memory or output budget. Narrow the query. Narrow the query (filters, columns or range) and retry. - `COMMIT_UNCERTAIN` (HTTP 503): The commit outcome is unknown. Reconcile before retrying. The write may have happened. Repeat it with the same requestKey or read the record first. - `DATABASE_UNAVAILABLE` (HTTP 503): The database is unavailable. Retry later with backoff; for a write, reuse the same requestKey. - `PIPELINE_UNAVAILABLE` (HTTP 503): The pipeline is unavailable. Reconcile using the same request key. The write may have happened. Repeat it with the same requestKey or read the record first. - `ASSISTANT_UNAVAILABLE` (HTTP 503): The assistant is not available for this workspace. Do not retry. The capability is not enabled for this organization. - `SERVICE_BUSY` (HTTP 503): The service is handling its current request limit. Retry later with backoff; for a write, reuse the same requestKey. - `INVALID_CONFIGURATION` (HTTP 500): The request could not be completed. Retry once later; if it persists, report the requestId to support. - `INTERNAL` (HTTP 500): The request could not be completed. Retry once later; if it persists, report the requestId to support.
    - one of `"UNAUTHORIZED"`, `"AUTHENTICATION_UNAVAILABLE"`, `"ACCESS_DENIED"`, `"MODULE_DISABLED"`, `"INVALID_INPUT"`, `"USER_PAYMENT_REFUSED"`, `"INVALID_INVENTORY"`, `"ANALYTICS_QUERY_REJECTED"`, `"BODY_TOO_LARGE"`, `"NOT_FOUND"`, `"METHOD_NOT_ALLOWED"`, `"CONFLICT"`, `"IDEMPOTENCY_CONFLICT"`, `"TRANSACTION_ABORTED"`, `"INVENTORY_INTEGRITY_CONFLICT"`, `"TEAM_PRIOR_UNRESOLVED"`, `"COHORT_ACTIVE_REQUIRED"`, `"COHORT_CUT_CHANGED"`, `"COHORT_READ_REQUIRES_ACTIVE"`, `"COHORT_CUT_NEEDS_RECONCILIATION"`, `"PROGRAM_NEW_ASSESSMENT_REQUIRED"`, `"CONTRACT_CLOSED_WINDOW_CHANGE_UNSUPPORTED"`, `"MINOR_UNIT_SCALE_MISMATCH"`, `"INVOICE_COMPONENT_AMBIGUOUS"`, `"SITE_SUBSTITUTION_REFUSED"`, `"RESOURCE_LIMIT_EXCEEDED"`, `"MODULE_NOT_CONTRACTED"`, `"MODULE_REQUIREMENT_MISSING"`, `"CAPABILITY_NOT_CONFIGURED"`, `"INSTALLATION_NOT_READY"`, `"EVIDENCE_NOT_READABLE"`, `"ANALYTICS_QUERY_LIMIT"`, `"COMMIT_UNCERTAIN"`, `"DATABASE_UNAVAILABLE"`, `"PIPELINE_UNAVAILABLE"`, `"ASSISTANT_UNAVAILABLE"`, `"SERVICE_BUSY"`, `"INVALID_CONFIGURATION"`, `"INTERNAL"`; example `"INVALID_INPUT"`
  - `message` (`adoptNoteExtraction.response.404.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`adoptNoteExtraction.response.404.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`adoptNoteExtraction.response.404.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`adoptNoteExtraction.response.404.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`adoptNoteExtraction.response.404.error.details.module`; string, optional) — The module the failure is about, for example `agenda`.
      - one of `"pgp"`, `"capitation"`, `"fee_for_service"`, `"results_payment"`, `"service_record"`, `"cac"`, `"cohorts"`, `"studies"`, `"agenda"`, `"voice"`, `"whatsapp"`, `"sms"`, `"email"`, `"arbi"`, `"ai_documents"`, `"ai_care"`, `"analytics"`
    - `paymentProblem` (`adoptNoteExtraction.response.404.error.details.paymentProblem`; string, optional) — Why the collection was refused.
      - one of `"rules_unavailable"`, `"not_collectable"`, `"not_for_this_person"`, `"basis_incomplete"`, `"moderator_fee_value"`, `"service_value_unavailable"`, `"above_share"`, `"above_event_cap"`, `"above_year_cap"`
    - `reason` (`adoptNoteExtraction.response.404.error.details.reason`; string, optional) — Why the booking's site was refused: `not_contracted` (the contracted site is not one of the contract that day), `not_a_substitute` (no substitution in force that day lets the site serve for it), `patient_acceptance_missing` or `payer_authorization_missing` (the substitution asks for them).
      - one of `"not_contracted"`, `"not_a_substitute"`, `"patient_acceptance_missing"`, `"payer_authorization_missing"`
- `metadata` (`adoptNoteExtraction.response.404.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`adoptNoteExtraction.response.404.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`adoptNoteExtraction.response.404.success`; boolean, required) — Always `false` in a failure envelope.
  - one of `false`

### 409

Failure. The `error.code` is one of:
- `CONFLICT`: Read the current state with the matching get operation, then decide again.
- `IDEMPOTENCY_CONFLICT`: The requestKey was already used for a different request. Use a new key for a new action.
- `TRANSACTION_ABORTED`: Nothing was written. Retry the same request.
- `INVENTORY_INTEGRITY_CONFLICT`: Do not retry. Report the integrity failure to an operator.
- `TEAM_PRIOR_UNRESOLVED`: Reconcile the earlier team command (see details.commandId) before a new change.
- `COHORT_ACTIVE_REQUIRED`: Read the current state with the matching get operation, then decide again.
- `COHORT_CUT_CHANGED`: Restart the paginated read from the first page.
- `COHORT_READ_REQUIRES_ACTIVE`: Read the current state with the matching get operation, then decide again.
- `COHORT_CUT_NEEDS_RECONCILIATION`: Read the current state with the matching get operation, then decide again.
- `PROGRAM_NEW_ASSESSMENT_REQUIRED`: Read the current state with the matching get operation, then decide again.
- `CONTRACT_CLOSED_WINDOW_CHANGE_UNSUPPORTED`: Read the current state with the matching get operation, then decide again.
- `INVOICE_COMPONENT_AMBIGUOUS`: Route the lines in details.lineIds to their paying component, then request the proposal again. At most 100 identifiers are returned.
- `SITE_SUBSTITUTION_REFUSED`: Book at the contracted site, or at a site its contract lets serve for it on the appointment's day (listContractSites), recording what details.reason says is missing: the patient's acceptance or the payer's authorization.

#### Example

```json
{
  "error": {
    "code": "CONFLICT",
    "message": "The resource conflicts with its current state."
  },
  "metadata": {
    "requestId": "3f2b8c1e-5d4a-4b6f-9c2e-0a1b2c3d4e5f"
  },
  "success": false
}
```

- `error` (`adoptNoteExtraction.response.409.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`adoptNoteExtraction.response.409.error.code`; string, required) — Stable failure code. Branch on this value, never on `message`. - `UNAUTHORIZED` (HTTP 401): A valid access token is required. Obtain a fresh access token and repeat the request. - `AUTHENTICATION_UNAVAILABLE` (HTTP 503): Identity verification is temporarily unavailable. Retry later with backoff; for a write, reuse the same requestKey. - `ACCESS_DENIED` (HTTP 403): Access denied. Do not retry. The signed-in actor lacks this purpose or grant; ask an administrator. - `MODULE_DISABLED` (HTTP 403): This operation belongs to a module the organization does not use. Do not retry. The organization does not use the module in details.module (getSession lists the ones it uses); an administrator turns it on with setOrganizationModules. - `INVALID_INPUT` (HTTP 400): The request does not match the documented contract. Do not retry unchanged. Fix the request against the operation's schema. - `USER_PAYMENT_REFUSED` (HTTP 400): The collection exceeds the applicable payment rules. Check the collection basis and caps in details.paymentProblem before recording the payment. - `INVALID_INVENTORY` (HTTP 400): The content does not match the selected inventory contract. Do not retry unchanged. Fix the request against the operation's schema. - `ANALYTICS_QUERY_REJECTED` (HTTP 400): Use one read-only query over the admitted catalog and its supported functions. Rewrite the query as one read-only statement over the published catalog. - `BODY_TOO_LARGE` (HTTP 413): The request body exceeds the supported limit. Send a smaller body, or split the content into several requests. - `NOT_FOUND` (HTTP 404): The resource does not exist. Check the identifier. The record may not exist or may not be visible to this actor. - `METHOD_NOT_ALLOWED` (HTTP 405): The method is not supported for this resource. Use the HTTP method documented for this path. - `CONFLICT` (HTTP 409): The resource conflicts with its current state. Read the current state with the matching get operation, then decide again. - `IDEMPOTENCY_CONFLICT` (HTTP 409): The command key already identifies a different request. The requestKey was already used for a different request. Use a new key for a new action. - `TRANSACTION_ABORTED` (HTTP 409): The transaction rolled back without committing changes. Nothing was written. Retry the same request. - `INVENTORY_INTEGRITY_CONFLICT` (HTTP 409): The current build failed integrity verification. Do not retry. Report the integrity failure to an operator. - `TEAM_PRIOR_UNRESOLVED` (HTTP 409): Reconcile the existing team command before preparing another change. Reconcile the earlier team command (see details.commandId) before a new change. - `COHORT_ACTIVE_REQUIRED` (HTTP 409): Only an active cohort can create a new candidate snapshot. Read the current state with the matching get operation, then decide again. - `COHORT_CUT_CHANGED` (HTTP 409): The current cohort cut changed. Restart this read from the first page. Restart the paginated read from the first page. - `COHORT_READ_REQUIRES_ACTIVE` (HTTP 409): Only an active cohort has a current care-facts view. Read the current state with the matching get operation, then decide again. - `COHORT_CUT_NEEDS_RECONCILIATION` (HTTP 409): The cohort cut needs reconciliation before its care facts can be read. Read the current state with the matching get operation, then decide again. - `PROGRAM_NEW_ASSESSMENT_REQUIRED` (HTTP 409): Select a new eligible assessment recorded after the last participation change. Read the current state with the matching get operation, then decide again. - `CONTRACT_CLOSED_WINDOW_CHANGE_UNSUPPORTED` (HTTP 409): The proposed terms change component identities already fixed by an accepted close. Read the current state with the matching get operation, then decide again. - `MINOR_UNIT_SCALE_MISMATCH` (HTTP 400): A component's money is not in the minor units of its currency (ISO 4217). Write each component's money in the minor units of its currency (minorUnitScale 2 for COP, PEN, MXN and BRL; 0 for CLP) and propose again. - `INVOICE_COMPONENT_AMBIGUOUS` (HTTP 409): Invoice lines have no unique fee-for-service component. Route the lines in details.lineIds to their paying component, then request the proposal again. At most 100 identifiers are returned. - `SITE_SUBSTITUTION_REFUSED` (HTTP 409): The contract does not let this site serve for the contracted site as booked. Book at the contracted site, or at a site its contract lets serve for it on the appointment's day (listContractSites), recording what details.reason says is missing: the patient's acceptance or the payer's authorization. - `RESOURCE_LIMIT_EXCEEDED` (HTTP 422): This resource has reached its supported capacity. Do not retry. Reduce the request or archive records first. - `MODULE_NOT_CONTRACTED` (HTTP 422): The organization did not contract this module. Leave the module in details.module off: the organization did not contract it. Árbol adds it to the contract when the organization buys it. - `MODULE_REQUIREMENT_MISSING` (HTTP 422): This module needs one of the modules it requires to be on. Turn on, in the same request, one of the modules the module in details.module requires (getOrganizationModules lists them). - `CAPABILITY_NOT_CONFIGURED` (HTTP 422): This operation requires its governed native implementation before it can be activated. Do not retry. The capability is not enabled for this organization. - `INSTALLATION_NOT_READY` (HTTP 422): The installation cannot be activated: its app version is not certified or a credential its app declares is missing. Do not retry unchanged. Wait for a certified app version, record examples that cover every operation and change of a custom-http installation, or add the missing credentials to the deployment, then activate again. - `EVIDENCE_NOT_READABLE` (HTTP 422): Accepting evidence requires readable content and independent reporter provenance. Leave it pending until its source is readable. Leave the evidence pending until its source content is readable. - `ANALYTICS_QUERY_LIMIT` (HTTP 422): The query exceeded its bounded work, memory or output budget. Narrow the query. Narrow the query (filters, columns or range) and retry. - `COMMIT_UNCERTAIN` (HTTP 503): The commit outcome is unknown. Reconcile before retrying. The write may have happened. Repeat it with the same requestKey or read the record first. - `DATABASE_UNAVAILABLE` (HTTP 503): The database is unavailable. Retry later with backoff; for a write, reuse the same requestKey. - `PIPELINE_UNAVAILABLE` (HTTP 503): The pipeline is unavailable. Reconcile using the same request key. The write may have happened. Repeat it with the same requestKey or read the record first. - `ASSISTANT_UNAVAILABLE` (HTTP 503): The assistant is not available for this workspace. Do not retry. The capability is not enabled for this organization. - `SERVICE_BUSY` (HTTP 503): The service is handling its current request limit. Retry later with backoff; for a write, reuse the same requestKey. - `INVALID_CONFIGURATION` (HTTP 500): The request could not be completed. Retry once later; if it persists, report the requestId to support. - `INTERNAL` (HTTP 500): The request could not be completed. Retry once later; if it persists, report the requestId to support.
    - one of `"UNAUTHORIZED"`, `"AUTHENTICATION_UNAVAILABLE"`, `"ACCESS_DENIED"`, `"MODULE_DISABLED"`, `"INVALID_INPUT"`, `"USER_PAYMENT_REFUSED"`, `"INVALID_INVENTORY"`, `"ANALYTICS_QUERY_REJECTED"`, `"BODY_TOO_LARGE"`, `"NOT_FOUND"`, `"METHOD_NOT_ALLOWED"`, `"CONFLICT"`, `"IDEMPOTENCY_CONFLICT"`, `"TRANSACTION_ABORTED"`, `"INVENTORY_INTEGRITY_CONFLICT"`, `"TEAM_PRIOR_UNRESOLVED"`, `"COHORT_ACTIVE_REQUIRED"`, `"COHORT_CUT_CHANGED"`, `"COHORT_READ_REQUIRES_ACTIVE"`, `"COHORT_CUT_NEEDS_RECONCILIATION"`, `"PROGRAM_NEW_ASSESSMENT_REQUIRED"`, `"CONTRACT_CLOSED_WINDOW_CHANGE_UNSUPPORTED"`, `"MINOR_UNIT_SCALE_MISMATCH"`, `"INVOICE_COMPONENT_AMBIGUOUS"`, `"SITE_SUBSTITUTION_REFUSED"`, `"RESOURCE_LIMIT_EXCEEDED"`, `"MODULE_NOT_CONTRACTED"`, `"MODULE_REQUIREMENT_MISSING"`, `"CAPABILITY_NOT_CONFIGURED"`, `"INSTALLATION_NOT_READY"`, `"EVIDENCE_NOT_READABLE"`, `"ANALYTICS_QUERY_LIMIT"`, `"COMMIT_UNCERTAIN"`, `"DATABASE_UNAVAILABLE"`, `"PIPELINE_UNAVAILABLE"`, `"ASSISTANT_UNAVAILABLE"`, `"SERVICE_BUSY"`, `"INVALID_CONFIGURATION"`, `"INTERNAL"`; example `"INVALID_INPUT"`
  - `message` (`adoptNoteExtraction.response.409.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`adoptNoteExtraction.response.409.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`adoptNoteExtraction.response.409.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`adoptNoteExtraction.response.409.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`adoptNoteExtraction.response.409.error.details.module`; string, optional) — The module the failure is about, for example `agenda`.
      - one of `"pgp"`, `"capitation"`, `"fee_for_service"`, `"results_payment"`, `"service_record"`, `"cac"`, `"cohorts"`, `"studies"`, `"agenda"`, `"voice"`, `"whatsapp"`, `"sms"`, `"email"`, `"arbi"`, `"ai_documents"`, `"ai_care"`, `"analytics"`
    - `paymentProblem` (`adoptNoteExtraction.response.409.error.details.paymentProblem`; string, optional) — Why the collection was refused.
      - one of `"rules_unavailable"`, `"not_collectable"`, `"not_for_this_person"`, `"basis_incomplete"`, `"moderator_fee_value"`, `"service_value_unavailable"`, `"above_share"`, `"above_event_cap"`, `"above_year_cap"`
    - `reason` (`adoptNoteExtraction.response.409.error.details.reason`; string, optional) — Why the booking's site was refused: `not_contracted` (the contracted site is not one of the contract that day), `not_a_substitute` (no substitution in force that day lets the site serve for it), `patient_acceptance_missing` or `payer_authorization_missing` (the substitution asks for them).
      - one of `"not_contracted"`, `"not_a_substitute"`, `"patient_acceptance_missing"`, `"payer_authorization_missing"`
- `metadata` (`adoptNoteExtraction.response.409.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`adoptNoteExtraction.response.409.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`adoptNoteExtraction.response.409.success`; boolean, required) — Always `false` in a failure envelope.
  - one of `false`

### 413

Failure. The `error.code` is one of:
- `BODY_TOO_LARGE`: Send a smaller body, or split the content into several requests.

#### Example

```json
{
  "error": {
    "code": "BODY_TOO_LARGE",
    "message": "The request body exceeds the supported limit."
  },
  "metadata": {
    "requestId": "3f2b8c1e-5d4a-4b6f-9c2e-0a1b2c3d4e5f"
  },
  "success": false
}
```

- `error` (`adoptNoteExtraction.response.413.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`adoptNoteExtraction.response.413.error.code`; string, required) — Stable failure code. Branch on this value, never on `message`. - `UNAUTHORIZED` (HTTP 401): A valid access token is required. Obtain a fresh access token and repeat the request. - `AUTHENTICATION_UNAVAILABLE` (HTTP 503): Identity verification is temporarily unavailable. Retry later with backoff; for a write, reuse the same requestKey. - `ACCESS_DENIED` (HTTP 403): Access denied. Do not retry. The signed-in actor lacks this purpose or grant; ask an administrator. - `MODULE_DISABLED` (HTTP 403): This operation belongs to a module the organization does not use. Do not retry. The organization does not use the module in details.module (getSession lists the ones it uses); an administrator turns it on with setOrganizationModules. - `INVALID_INPUT` (HTTP 400): The request does not match the documented contract. Do not retry unchanged. Fix the request against the operation's schema. - `USER_PAYMENT_REFUSED` (HTTP 400): The collection exceeds the applicable payment rules. Check the collection basis and caps in details.paymentProblem before recording the payment. - `INVALID_INVENTORY` (HTTP 400): The content does not match the selected inventory contract. Do not retry unchanged. Fix the request against the operation's schema. - `ANALYTICS_QUERY_REJECTED` (HTTP 400): Use one read-only query over the admitted catalog and its supported functions. Rewrite the query as one read-only statement over the published catalog. - `BODY_TOO_LARGE` (HTTP 413): The request body exceeds the supported limit. Send a smaller body, or split the content into several requests. - `NOT_FOUND` (HTTP 404): The resource does not exist. Check the identifier. The record may not exist or may not be visible to this actor. - `METHOD_NOT_ALLOWED` (HTTP 405): The method is not supported for this resource. Use the HTTP method documented for this path. - `CONFLICT` (HTTP 409): The resource conflicts with its current state. Read the current state with the matching get operation, then decide again. - `IDEMPOTENCY_CONFLICT` (HTTP 409): The command key already identifies a different request. The requestKey was already used for a different request. Use a new key for a new action. - `TRANSACTION_ABORTED` (HTTP 409): The transaction rolled back without committing changes. Nothing was written. Retry the same request. - `INVENTORY_INTEGRITY_CONFLICT` (HTTP 409): The current build failed integrity verification. Do not retry. Report the integrity failure to an operator. - `TEAM_PRIOR_UNRESOLVED` (HTTP 409): Reconcile the existing team command before preparing another change. Reconcile the earlier team command (see details.commandId) before a new change. - `COHORT_ACTIVE_REQUIRED` (HTTP 409): Only an active cohort can create a new candidate snapshot. Read the current state with the matching get operation, then decide again. - `COHORT_CUT_CHANGED` (HTTP 409): The current cohort cut changed. Restart this read from the first page. Restart the paginated read from the first page. - `COHORT_READ_REQUIRES_ACTIVE` (HTTP 409): Only an active cohort has a current care-facts view. Read the current state with the matching get operation, then decide again. - `COHORT_CUT_NEEDS_RECONCILIATION` (HTTP 409): The cohort cut needs reconciliation before its care facts can be read. Read the current state with the matching get operation, then decide again. - `PROGRAM_NEW_ASSESSMENT_REQUIRED` (HTTP 409): Select a new eligible assessment recorded after the last participation change. Read the current state with the matching get operation, then decide again. - `CONTRACT_CLOSED_WINDOW_CHANGE_UNSUPPORTED` (HTTP 409): The proposed terms change component identities already fixed by an accepted close. Read the current state with the matching get operation, then decide again. - `MINOR_UNIT_SCALE_MISMATCH` (HTTP 400): A component's money is not in the minor units of its currency (ISO 4217). Write each component's money in the minor units of its currency (minorUnitScale 2 for COP, PEN, MXN and BRL; 0 for CLP) and propose again. - `INVOICE_COMPONENT_AMBIGUOUS` (HTTP 409): Invoice lines have no unique fee-for-service component. Route the lines in details.lineIds to their paying component, then request the proposal again. At most 100 identifiers are returned. - `SITE_SUBSTITUTION_REFUSED` (HTTP 409): The contract does not let this site serve for the contracted site as booked. Book at the contracted site, or at a site its contract lets serve for it on the appointment's day (listContractSites), recording what details.reason says is missing: the patient's acceptance or the payer's authorization. - `RESOURCE_LIMIT_EXCEEDED` (HTTP 422): This resource has reached its supported capacity. Do not retry. Reduce the request or archive records first. - `MODULE_NOT_CONTRACTED` (HTTP 422): The organization did not contract this module. Leave the module in details.module off: the organization did not contract it. Árbol adds it to the contract when the organization buys it. - `MODULE_REQUIREMENT_MISSING` (HTTP 422): This module needs one of the modules it requires to be on. Turn on, in the same request, one of the modules the module in details.module requires (getOrganizationModules lists them). - `CAPABILITY_NOT_CONFIGURED` (HTTP 422): This operation requires its governed native implementation before it can be activated. Do not retry. The capability is not enabled for this organization. - `INSTALLATION_NOT_READY` (HTTP 422): The installation cannot be activated: its app version is not certified or a credential its app declares is missing. Do not retry unchanged. Wait for a certified app version, record examples that cover every operation and change of a custom-http installation, or add the missing credentials to the deployment, then activate again. - `EVIDENCE_NOT_READABLE` (HTTP 422): Accepting evidence requires readable content and independent reporter provenance. Leave it pending until its source is readable. Leave the evidence pending until its source content is readable. - `ANALYTICS_QUERY_LIMIT` (HTTP 422): The query exceeded its bounded work, memory or output budget. Narrow the query. Narrow the query (filters, columns or range) and retry. - `COMMIT_UNCERTAIN` (HTTP 503): The commit outcome is unknown. Reconcile before retrying. The write may have happened. Repeat it with the same requestKey or read the record first. - `DATABASE_UNAVAILABLE` (HTTP 503): The database is unavailable. Retry later with backoff; for a write, reuse the same requestKey. - `PIPELINE_UNAVAILABLE` (HTTP 503): The pipeline is unavailable. Reconcile using the same request key. The write may have happened. Repeat it with the same requestKey or read the record first. - `ASSISTANT_UNAVAILABLE` (HTTP 503): The assistant is not available for this workspace. Do not retry. The capability is not enabled for this organization. - `SERVICE_BUSY` (HTTP 503): The service is handling its current request limit. Retry later with backoff; for a write, reuse the same requestKey. - `INVALID_CONFIGURATION` (HTTP 500): The request could not be completed. Retry once later; if it persists, report the requestId to support. - `INTERNAL` (HTTP 500): The request could not be completed. Retry once later; if it persists, report the requestId to support.
    - one of `"UNAUTHORIZED"`, `"AUTHENTICATION_UNAVAILABLE"`, `"ACCESS_DENIED"`, `"MODULE_DISABLED"`, `"INVALID_INPUT"`, `"USER_PAYMENT_REFUSED"`, `"INVALID_INVENTORY"`, `"ANALYTICS_QUERY_REJECTED"`, `"BODY_TOO_LARGE"`, `"NOT_FOUND"`, `"METHOD_NOT_ALLOWED"`, `"CONFLICT"`, `"IDEMPOTENCY_CONFLICT"`, `"TRANSACTION_ABORTED"`, `"INVENTORY_INTEGRITY_CONFLICT"`, `"TEAM_PRIOR_UNRESOLVED"`, `"COHORT_ACTIVE_REQUIRED"`, `"COHORT_CUT_CHANGED"`, `"COHORT_READ_REQUIRES_ACTIVE"`, `"COHORT_CUT_NEEDS_RECONCILIATION"`, `"PROGRAM_NEW_ASSESSMENT_REQUIRED"`, `"CONTRACT_CLOSED_WINDOW_CHANGE_UNSUPPORTED"`, `"MINOR_UNIT_SCALE_MISMATCH"`, `"INVOICE_COMPONENT_AMBIGUOUS"`, `"SITE_SUBSTITUTION_REFUSED"`, `"RESOURCE_LIMIT_EXCEEDED"`, `"MODULE_NOT_CONTRACTED"`, `"MODULE_REQUIREMENT_MISSING"`, `"CAPABILITY_NOT_CONFIGURED"`, `"INSTALLATION_NOT_READY"`, `"EVIDENCE_NOT_READABLE"`, `"ANALYTICS_QUERY_LIMIT"`, `"COMMIT_UNCERTAIN"`, `"DATABASE_UNAVAILABLE"`, `"PIPELINE_UNAVAILABLE"`, `"ASSISTANT_UNAVAILABLE"`, `"SERVICE_BUSY"`, `"INVALID_CONFIGURATION"`, `"INTERNAL"`; example `"INVALID_INPUT"`
  - `message` (`adoptNoteExtraction.response.413.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`adoptNoteExtraction.response.413.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`adoptNoteExtraction.response.413.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`adoptNoteExtraction.response.413.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`adoptNoteExtraction.response.413.error.details.module`; string, optional) — The module the failure is about, for example `agenda`.
      - one of `"pgp"`, `"capitation"`, `"fee_for_service"`, `"results_payment"`, `"service_record"`, `"cac"`, `"cohorts"`, `"studies"`, `"agenda"`, `"voice"`, `"whatsapp"`, `"sms"`, `"email"`, `"arbi"`, `"ai_documents"`, `"ai_care"`, `"analytics"`
    - `paymentProblem` (`adoptNoteExtraction.response.413.error.details.paymentProblem`; string, optional) — Why the collection was refused.
      - one of `"rules_unavailable"`, `"not_collectable"`, `"not_for_this_person"`, `"basis_incomplete"`, `"moderator_fee_value"`, `"service_value_unavailable"`, `"above_share"`, `"above_event_cap"`, `"above_year_cap"`
    - `reason` (`adoptNoteExtraction.response.413.error.details.reason`; string, optional) — Why the booking's site was refused: `not_contracted` (the contracted site is not one of the contract that day), `not_a_substitute` (no substitution in force that day lets the site serve for it), `patient_acceptance_missing` or `payer_authorization_missing` (the substitution asks for them).
      - one of `"not_contracted"`, `"not_a_substitute"`, `"patient_acceptance_missing"`, `"payer_authorization_missing"`
- `metadata` (`adoptNoteExtraction.response.413.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`adoptNoteExtraction.response.413.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`adoptNoteExtraction.response.413.success`; boolean, required) — Always `false` in a failure envelope.
  - one of `false`

### 422

Failure. The `error.code` is one of:
- `RESOURCE_LIMIT_EXCEEDED`: Do not retry. Reduce the request or archive records first.
- `MODULE_NOT_CONTRACTED`: Leave the module in details.module off: the organization did not contract it. Árbol adds it to the contract when the organization buys it.
- `MODULE_REQUIREMENT_MISSING`: Turn on, in the same request, one of the modules the module in details.module requires (getOrganizationModules lists them).
- `CAPABILITY_NOT_CONFIGURED`: Do not retry. The capability is not enabled for this organization.
- `INSTALLATION_NOT_READY`: Do not retry unchanged. Wait for a certified app version, record examples that cover every operation and change of a custom-http installation, or add the missing credentials to the deployment, then activate again.
- `EVIDENCE_NOT_READABLE`: Leave the evidence pending until its source content is readable.
- `ANALYTICS_QUERY_LIMIT`: Narrow the query (filters, columns or range) and retry.

#### Example

```json
{
  "error": {
    "code": "RESOURCE_LIMIT_EXCEEDED",
    "message": "This resource has reached its supported capacity."
  },
  "metadata": {
    "requestId": "3f2b8c1e-5d4a-4b6f-9c2e-0a1b2c3d4e5f"
  },
  "success": false
}
```

- `error` (`adoptNoteExtraction.response.422.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`adoptNoteExtraction.response.422.error.code`; string, required) — Stable failure code. Branch on this value, never on `message`. - `UNAUTHORIZED` (HTTP 401): A valid access token is required. Obtain a fresh access token and repeat the request. - `AUTHENTICATION_UNAVAILABLE` (HTTP 503): Identity verification is temporarily unavailable. Retry later with backoff; for a write, reuse the same requestKey. - `ACCESS_DENIED` (HTTP 403): Access denied. Do not retry. The signed-in actor lacks this purpose or grant; ask an administrator. - `MODULE_DISABLED` (HTTP 403): This operation belongs to a module the organization does not use. Do not retry. The organization does not use the module in details.module (getSession lists the ones it uses); an administrator turns it on with setOrganizationModules. - `INVALID_INPUT` (HTTP 400): The request does not match the documented contract. Do not retry unchanged. Fix the request against the operation's schema. - `USER_PAYMENT_REFUSED` (HTTP 400): The collection exceeds the applicable payment rules. Check the collection basis and caps in details.paymentProblem before recording the payment. - `INVALID_INVENTORY` (HTTP 400): The content does not match the selected inventory contract. Do not retry unchanged. Fix the request against the operation's schema. - `ANALYTICS_QUERY_REJECTED` (HTTP 400): Use one read-only query over the admitted catalog and its supported functions. Rewrite the query as one read-only statement over the published catalog. - `BODY_TOO_LARGE` (HTTP 413): The request body exceeds the supported limit. Send a smaller body, or split the content into several requests. - `NOT_FOUND` (HTTP 404): The resource does not exist. Check the identifier. The record may not exist or may not be visible to this actor. - `METHOD_NOT_ALLOWED` (HTTP 405): The method is not supported for this resource. Use the HTTP method documented for this path. - `CONFLICT` (HTTP 409): The resource conflicts with its current state. Read the current state with the matching get operation, then decide again. - `IDEMPOTENCY_CONFLICT` (HTTP 409): The command key already identifies a different request. The requestKey was already used for a different request. Use a new key for a new action. - `TRANSACTION_ABORTED` (HTTP 409): The transaction rolled back without committing changes. Nothing was written. Retry the same request. - `INVENTORY_INTEGRITY_CONFLICT` (HTTP 409): The current build failed integrity verification. Do not retry. Report the integrity failure to an operator. - `TEAM_PRIOR_UNRESOLVED` (HTTP 409): Reconcile the existing team command before preparing another change. Reconcile the earlier team command (see details.commandId) before a new change. - `COHORT_ACTIVE_REQUIRED` (HTTP 409): Only an active cohort can create a new candidate snapshot. Read the current state with the matching get operation, then decide again. - `COHORT_CUT_CHANGED` (HTTP 409): The current cohort cut changed. Restart this read from the first page. Restart the paginated read from the first page. - `COHORT_READ_REQUIRES_ACTIVE` (HTTP 409): Only an active cohort has a current care-facts view. Read the current state with the matching get operation, then decide again. - `COHORT_CUT_NEEDS_RECONCILIATION` (HTTP 409): The cohort cut needs reconciliation before its care facts can be read. Read the current state with the matching get operation, then decide again. - `PROGRAM_NEW_ASSESSMENT_REQUIRED` (HTTP 409): Select a new eligible assessment recorded after the last participation change. Read the current state with the matching get operation, then decide again. - `CONTRACT_CLOSED_WINDOW_CHANGE_UNSUPPORTED` (HTTP 409): The proposed terms change component identities already fixed by an accepted close. Read the current state with the matching get operation, then decide again. - `MINOR_UNIT_SCALE_MISMATCH` (HTTP 400): A component's money is not in the minor units of its currency (ISO 4217). Write each component's money in the minor units of its currency (minorUnitScale 2 for COP, PEN, MXN and BRL; 0 for CLP) and propose again. - `INVOICE_COMPONENT_AMBIGUOUS` (HTTP 409): Invoice lines have no unique fee-for-service component. Route the lines in details.lineIds to their paying component, then request the proposal again. At most 100 identifiers are returned. - `SITE_SUBSTITUTION_REFUSED` (HTTP 409): The contract does not let this site serve for the contracted site as booked. Book at the contracted site, or at a site its contract lets serve for it on the appointment's day (listContractSites), recording what details.reason says is missing: the patient's acceptance or the payer's authorization. - `RESOURCE_LIMIT_EXCEEDED` (HTTP 422): This resource has reached its supported capacity. Do not retry. Reduce the request or archive records first. - `MODULE_NOT_CONTRACTED` (HTTP 422): The organization did not contract this module. Leave the module in details.module off: the organization did not contract it. Árbol adds it to the contract when the organization buys it. - `MODULE_REQUIREMENT_MISSING` (HTTP 422): This module needs one of the modules it requires to be on. Turn on, in the same request, one of the modules the module in details.module requires (getOrganizationModules lists them). - `CAPABILITY_NOT_CONFIGURED` (HTTP 422): This operation requires its governed native implementation before it can be activated. Do not retry. The capability is not enabled for this organization. - `INSTALLATION_NOT_READY` (HTTP 422): The installation cannot be activated: its app version is not certified or a credential its app declares is missing. Do not retry unchanged. Wait for a certified app version, record examples that cover every operation and change of a custom-http installation, or add the missing credentials to the deployment, then activate again. - `EVIDENCE_NOT_READABLE` (HTTP 422): Accepting evidence requires readable content and independent reporter provenance. Leave it pending until its source is readable. Leave the evidence pending until its source content is readable. - `ANALYTICS_QUERY_LIMIT` (HTTP 422): The query exceeded its bounded work, memory or output budget. Narrow the query. Narrow the query (filters, columns or range) and retry. - `COMMIT_UNCERTAIN` (HTTP 503): The commit outcome is unknown. Reconcile before retrying. The write may have happened. Repeat it with the same requestKey or read the record first. - `DATABASE_UNAVAILABLE` (HTTP 503): The database is unavailable. Retry later with backoff; for a write, reuse the same requestKey. - `PIPELINE_UNAVAILABLE` (HTTP 503): The pipeline is unavailable. Reconcile using the same request key. The write may have happened. Repeat it with the same requestKey or read the record first. - `ASSISTANT_UNAVAILABLE` (HTTP 503): The assistant is not available for this workspace. Do not retry. The capability is not enabled for this organization. - `SERVICE_BUSY` (HTTP 503): The service is handling its current request limit. Retry later with backoff; for a write, reuse the same requestKey. - `INVALID_CONFIGURATION` (HTTP 500): The request could not be completed. Retry once later; if it persists, report the requestId to support. - `INTERNAL` (HTTP 500): The request could not be completed. Retry once later; if it persists, report the requestId to support.
    - one of `"UNAUTHORIZED"`, `"AUTHENTICATION_UNAVAILABLE"`, `"ACCESS_DENIED"`, `"MODULE_DISABLED"`, `"INVALID_INPUT"`, `"USER_PAYMENT_REFUSED"`, `"INVALID_INVENTORY"`, `"ANALYTICS_QUERY_REJECTED"`, `"BODY_TOO_LARGE"`, `"NOT_FOUND"`, `"METHOD_NOT_ALLOWED"`, `"CONFLICT"`, `"IDEMPOTENCY_CONFLICT"`, `"TRANSACTION_ABORTED"`, `"INVENTORY_INTEGRITY_CONFLICT"`, `"TEAM_PRIOR_UNRESOLVED"`, `"COHORT_ACTIVE_REQUIRED"`, `"COHORT_CUT_CHANGED"`, `"COHORT_READ_REQUIRES_ACTIVE"`, `"COHORT_CUT_NEEDS_RECONCILIATION"`, `"PROGRAM_NEW_ASSESSMENT_REQUIRED"`, `"CONTRACT_CLOSED_WINDOW_CHANGE_UNSUPPORTED"`, `"MINOR_UNIT_SCALE_MISMATCH"`, `"INVOICE_COMPONENT_AMBIGUOUS"`, `"SITE_SUBSTITUTION_REFUSED"`, `"RESOURCE_LIMIT_EXCEEDED"`, `"MODULE_NOT_CONTRACTED"`, `"MODULE_REQUIREMENT_MISSING"`, `"CAPABILITY_NOT_CONFIGURED"`, `"INSTALLATION_NOT_READY"`, `"EVIDENCE_NOT_READABLE"`, `"ANALYTICS_QUERY_LIMIT"`, `"COMMIT_UNCERTAIN"`, `"DATABASE_UNAVAILABLE"`, `"PIPELINE_UNAVAILABLE"`, `"ASSISTANT_UNAVAILABLE"`, `"SERVICE_BUSY"`, `"INVALID_CONFIGURATION"`, `"INTERNAL"`; example `"INVALID_INPUT"`
  - `message` (`adoptNoteExtraction.response.422.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`adoptNoteExtraction.response.422.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`adoptNoteExtraction.response.422.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`adoptNoteExtraction.response.422.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`adoptNoteExtraction.response.422.error.details.module`; string, optional) — The module the failure is about, for example `agenda`.
      - one of `"pgp"`, `"capitation"`, `"fee_for_service"`, `"results_payment"`, `"service_record"`, `"cac"`, `"cohorts"`, `"studies"`, `"agenda"`, `"voice"`, `"whatsapp"`, `"sms"`, `"email"`, `"arbi"`, `"ai_documents"`, `"ai_care"`, `"analytics"`
    - `paymentProblem` (`adoptNoteExtraction.response.422.error.details.paymentProblem`; string, optional) — Why the collection was refused.
      - one of `"rules_unavailable"`, `"not_collectable"`, `"not_for_this_person"`, `"basis_incomplete"`, `"moderator_fee_value"`, `"service_value_unavailable"`, `"above_share"`, `"above_event_cap"`, `"above_year_cap"`
    - `reason` (`adoptNoteExtraction.response.422.error.details.reason`; string, optional) — Why the booking's site was refused: `not_contracted` (the contracted site is not one of the contract that day), `not_a_substitute` (no substitution in force that day lets the site serve for it), `patient_acceptance_missing` or `payer_authorization_missing` (the substitution asks for them).
      - one of `"not_contracted"`, `"not_a_substitute"`, `"patient_acceptance_missing"`, `"payer_authorization_missing"`
- `metadata` (`adoptNoteExtraction.response.422.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`adoptNoteExtraction.response.422.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`adoptNoteExtraction.response.422.success`; boolean, required) — Always `false` in a failure envelope.
  - one of `false`

### 500

Failure. The `error.code` is one of:
- `INVALID_CONFIGURATION`: Retry once later; if it persists, report the requestId to support.
- `INTERNAL`: Retry once later; if it persists, report the requestId to support.

#### Example

```json
{
  "error": {
    "code": "INVALID_CONFIGURATION",
    "message": "The request could not be completed."
  },
  "metadata": {
    "requestId": "3f2b8c1e-5d4a-4b6f-9c2e-0a1b2c3d4e5f"
  },
  "success": false
}
```

- `error` (`adoptNoteExtraction.response.500.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`adoptNoteExtraction.response.500.error.code`; string, required) — Stable failure code. Branch on this value, never on `message`. - `UNAUTHORIZED` (HTTP 401): A valid access token is required. Obtain a fresh access token and repeat the request. - `AUTHENTICATION_UNAVAILABLE` (HTTP 503): Identity verification is temporarily unavailable. Retry later with backoff; for a write, reuse the same requestKey. - `ACCESS_DENIED` (HTTP 403): Access denied. Do not retry. The signed-in actor lacks this purpose or grant; ask an administrator. - `MODULE_DISABLED` (HTTP 403): This operation belongs to a module the organization does not use. Do not retry. The organization does not use the module in details.module (getSession lists the ones it uses); an administrator turns it on with setOrganizationModules. - `INVALID_INPUT` (HTTP 400): The request does not match the documented contract. Do not retry unchanged. Fix the request against the operation's schema. - `USER_PAYMENT_REFUSED` (HTTP 400): The collection exceeds the applicable payment rules. Check the collection basis and caps in details.paymentProblem before recording the payment. - `INVALID_INVENTORY` (HTTP 400): The content does not match the selected inventory contract. Do not retry unchanged. Fix the request against the operation's schema. - `ANALYTICS_QUERY_REJECTED` (HTTP 400): Use one read-only query over the admitted catalog and its supported functions. Rewrite the query as one read-only statement over the published catalog. - `BODY_TOO_LARGE` (HTTP 413): The request body exceeds the supported limit. Send a smaller body, or split the content into several requests. - `NOT_FOUND` (HTTP 404): The resource does not exist. Check the identifier. The record may not exist or may not be visible to this actor. - `METHOD_NOT_ALLOWED` (HTTP 405): The method is not supported for this resource. Use the HTTP method documented for this path. - `CONFLICT` (HTTP 409): The resource conflicts with its current state. Read the current state with the matching get operation, then decide again. - `IDEMPOTENCY_CONFLICT` (HTTP 409): The command key already identifies a different request. The requestKey was already used for a different request. Use a new key for a new action. - `TRANSACTION_ABORTED` (HTTP 409): The transaction rolled back without committing changes. Nothing was written. Retry the same request. - `INVENTORY_INTEGRITY_CONFLICT` (HTTP 409): The current build failed integrity verification. Do not retry. Report the integrity failure to an operator. - `TEAM_PRIOR_UNRESOLVED` (HTTP 409): Reconcile the existing team command before preparing another change. Reconcile the earlier team command (see details.commandId) before a new change. - `COHORT_ACTIVE_REQUIRED` (HTTP 409): Only an active cohort can create a new candidate snapshot. Read the current state with the matching get operation, then decide again. - `COHORT_CUT_CHANGED` (HTTP 409): The current cohort cut changed. Restart this read from the first page. Restart the paginated read from the first page. - `COHORT_READ_REQUIRES_ACTIVE` (HTTP 409): Only an active cohort has a current care-facts view. Read the current state with the matching get operation, then decide again. - `COHORT_CUT_NEEDS_RECONCILIATION` (HTTP 409): The cohort cut needs reconciliation before its care facts can be read. Read the current state with the matching get operation, then decide again. - `PROGRAM_NEW_ASSESSMENT_REQUIRED` (HTTP 409): Select a new eligible assessment recorded after the last participation change. Read the current state with the matching get operation, then decide again. - `CONTRACT_CLOSED_WINDOW_CHANGE_UNSUPPORTED` (HTTP 409): The proposed terms change component identities already fixed by an accepted close. Read the current state with the matching get operation, then decide again. - `MINOR_UNIT_SCALE_MISMATCH` (HTTP 400): A component's money is not in the minor units of its currency (ISO 4217). Write each component's money in the minor units of its currency (minorUnitScale 2 for COP, PEN, MXN and BRL; 0 for CLP) and propose again. - `INVOICE_COMPONENT_AMBIGUOUS` (HTTP 409): Invoice lines have no unique fee-for-service component. Route the lines in details.lineIds to their paying component, then request the proposal again. At most 100 identifiers are returned. - `SITE_SUBSTITUTION_REFUSED` (HTTP 409): The contract does not let this site serve for the contracted site as booked. Book at the contracted site, or at a site its contract lets serve for it on the appointment's day (listContractSites), recording what details.reason says is missing: the patient's acceptance or the payer's authorization. - `RESOURCE_LIMIT_EXCEEDED` (HTTP 422): This resource has reached its supported capacity. Do not retry. Reduce the request or archive records first. - `MODULE_NOT_CONTRACTED` (HTTP 422): The organization did not contract this module. Leave the module in details.module off: the organization did not contract it. Árbol adds it to the contract when the organization buys it. - `MODULE_REQUIREMENT_MISSING` (HTTP 422): This module needs one of the modules it requires to be on. Turn on, in the same request, one of the modules the module in details.module requires (getOrganizationModules lists them). - `CAPABILITY_NOT_CONFIGURED` (HTTP 422): This operation requires its governed native implementation before it can be activated. Do not retry. The capability is not enabled for this organization. - `INSTALLATION_NOT_READY` (HTTP 422): The installation cannot be activated: its app version is not certified or a credential its app declares is missing. Do not retry unchanged. Wait for a certified app version, record examples that cover every operation and change of a custom-http installation, or add the missing credentials to the deployment, then activate again. - `EVIDENCE_NOT_READABLE` (HTTP 422): Accepting evidence requires readable content and independent reporter provenance. Leave it pending until its source is readable. Leave the evidence pending until its source content is readable. - `ANALYTICS_QUERY_LIMIT` (HTTP 422): The query exceeded its bounded work, memory or output budget. Narrow the query. Narrow the query (filters, columns or range) and retry. - `COMMIT_UNCERTAIN` (HTTP 503): The commit outcome is unknown. Reconcile before retrying. The write may have happened. Repeat it with the same requestKey or read the record first. - `DATABASE_UNAVAILABLE` (HTTP 503): The database is unavailable. Retry later with backoff; for a write, reuse the same requestKey. - `PIPELINE_UNAVAILABLE` (HTTP 503): The pipeline is unavailable. Reconcile using the same request key. The write may have happened. Repeat it with the same requestKey or read the record first. - `ASSISTANT_UNAVAILABLE` (HTTP 503): The assistant is not available for this workspace. Do not retry. The capability is not enabled for this organization. - `SERVICE_BUSY` (HTTP 503): The service is handling its current request limit. Retry later with backoff; for a write, reuse the same requestKey. - `INVALID_CONFIGURATION` (HTTP 500): The request could not be completed. Retry once later; if it persists, report the requestId to support. - `INTERNAL` (HTTP 500): The request could not be completed. Retry once later; if it persists, report the requestId to support.
    - one of `"UNAUTHORIZED"`, `"AUTHENTICATION_UNAVAILABLE"`, `"ACCESS_DENIED"`, `"MODULE_DISABLED"`, `"INVALID_INPUT"`, `"USER_PAYMENT_REFUSED"`, `"INVALID_INVENTORY"`, `"ANALYTICS_QUERY_REJECTED"`, `"BODY_TOO_LARGE"`, `"NOT_FOUND"`, `"METHOD_NOT_ALLOWED"`, `"CONFLICT"`, `"IDEMPOTENCY_CONFLICT"`, `"TRANSACTION_ABORTED"`, `"INVENTORY_INTEGRITY_CONFLICT"`, `"TEAM_PRIOR_UNRESOLVED"`, `"COHORT_ACTIVE_REQUIRED"`, `"COHORT_CUT_CHANGED"`, `"COHORT_READ_REQUIRES_ACTIVE"`, `"COHORT_CUT_NEEDS_RECONCILIATION"`, `"PROGRAM_NEW_ASSESSMENT_REQUIRED"`, `"CONTRACT_CLOSED_WINDOW_CHANGE_UNSUPPORTED"`, `"MINOR_UNIT_SCALE_MISMATCH"`, `"INVOICE_COMPONENT_AMBIGUOUS"`, `"SITE_SUBSTITUTION_REFUSED"`, `"RESOURCE_LIMIT_EXCEEDED"`, `"MODULE_NOT_CONTRACTED"`, `"MODULE_REQUIREMENT_MISSING"`, `"CAPABILITY_NOT_CONFIGURED"`, `"INSTALLATION_NOT_READY"`, `"EVIDENCE_NOT_READABLE"`, `"ANALYTICS_QUERY_LIMIT"`, `"COMMIT_UNCERTAIN"`, `"DATABASE_UNAVAILABLE"`, `"PIPELINE_UNAVAILABLE"`, `"ASSISTANT_UNAVAILABLE"`, `"SERVICE_BUSY"`, `"INVALID_CONFIGURATION"`, `"INTERNAL"`; example `"INVALID_INPUT"`
  - `message` (`adoptNoteExtraction.response.500.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`adoptNoteExtraction.response.500.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`adoptNoteExtraction.response.500.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`adoptNoteExtraction.response.500.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`adoptNoteExtraction.response.500.error.details.module`; string, optional) — The module the failure is about, for example `agenda`.
      - one of `"pgp"`, `"capitation"`, `"fee_for_service"`, `"results_payment"`, `"service_record"`, `"cac"`, `"cohorts"`, `"studies"`, `"agenda"`, `"voice"`, `"whatsapp"`, `"sms"`, `"email"`, `"arbi"`, `"ai_documents"`, `"ai_care"`, `"analytics"`
    - `paymentProblem` (`adoptNoteExtraction.response.500.error.details.paymentProblem`; string, optional) — Why the collection was refused.
      - one of `"rules_unavailable"`, `"not_collectable"`, `"not_for_this_person"`, `"basis_incomplete"`, `"moderator_fee_value"`, `"service_value_unavailable"`, `"above_share"`, `"above_event_cap"`, `"above_year_cap"`
    - `reason` (`adoptNoteExtraction.response.500.error.details.reason`; string, optional) — Why the booking's site was refused: `not_contracted` (the contracted site is not one of the contract that day), `not_a_substitute` (no substitution in force that day lets the site serve for it), `patient_acceptance_missing` or `payer_authorization_missing` (the substitution asks for them).
      - one of `"not_contracted"`, `"not_a_substitute"`, `"patient_acceptance_missing"`, `"payer_authorization_missing"`
- `metadata` (`adoptNoteExtraction.response.500.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`adoptNoteExtraction.response.500.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`adoptNoteExtraction.response.500.success`; boolean, required) — Always `false` in a failure envelope.
  - one of `false`

### 503

Failure. The `error.code` is one of:
- `AUTHENTICATION_UNAVAILABLE`: Retry later with backoff; for a write, reuse the same requestKey.
- `COMMIT_UNCERTAIN`: The write may have happened. Repeat it with the same requestKey or read the record first.
- `DATABASE_UNAVAILABLE`: Retry later with backoff; for a write, reuse the same requestKey.
- `PIPELINE_UNAVAILABLE`: The write may have happened. Repeat it with the same requestKey or read the record first.
- `ASSISTANT_UNAVAILABLE`: Do not retry. The capability is not enabled for this organization.
- `SERVICE_BUSY`: Retry later with backoff; for a write, reuse the same requestKey.

#### Example

```json
{
  "error": {
    "code": "AUTHENTICATION_UNAVAILABLE",
    "message": "Identity verification is temporarily unavailable."
  },
  "metadata": {
    "requestId": "3f2b8c1e-5d4a-4b6f-9c2e-0a1b2c3d4e5f"
  },
  "success": false
}
```

- `error` (`adoptNoteExtraction.response.503.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`adoptNoteExtraction.response.503.error.code`; string, required) — Stable failure code. Branch on this value, never on `message`. - `UNAUTHORIZED` (HTTP 401): A valid access token is required. Obtain a fresh access token and repeat the request. - `AUTHENTICATION_UNAVAILABLE` (HTTP 503): Identity verification is temporarily unavailable. Retry later with backoff; for a write, reuse the same requestKey. - `ACCESS_DENIED` (HTTP 403): Access denied. Do not retry. The signed-in actor lacks this purpose or grant; ask an administrator. - `MODULE_DISABLED` (HTTP 403): This operation belongs to a module the organization does not use. Do not retry. The organization does not use the module in details.module (getSession lists the ones it uses); an administrator turns it on with setOrganizationModules. - `INVALID_INPUT` (HTTP 400): The request does not match the documented contract. Do not retry unchanged. Fix the request against the operation's schema. - `USER_PAYMENT_REFUSED` (HTTP 400): The collection exceeds the applicable payment rules. Check the collection basis and caps in details.paymentProblem before recording the payment. - `INVALID_INVENTORY` (HTTP 400): The content does not match the selected inventory contract. Do not retry unchanged. Fix the request against the operation's schema. - `ANALYTICS_QUERY_REJECTED` (HTTP 400): Use one read-only query over the admitted catalog and its supported functions. Rewrite the query as one read-only statement over the published catalog. - `BODY_TOO_LARGE` (HTTP 413): The request body exceeds the supported limit. Send a smaller body, or split the content into several requests. - `NOT_FOUND` (HTTP 404): The resource does not exist. Check the identifier. The record may not exist or may not be visible to this actor. - `METHOD_NOT_ALLOWED` (HTTP 405): The method is not supported for this resource. Use the HTTP method documented for this path. - `CONFLICT` (HTTP 409): The resource conflicts with its current state. Read the current state with the matching get operation, then decide again. - `IDEMPOTENCY_CONFLICT` (HTTP 409): The command key already identifies a different request. The requestKey was already used for a different request. Use a new key for a new action. - `TRANSACTION_ABORTED` (HTTP 409): The transaction rolled back without committing changes. Nothing was written. Retry the same request. - `INVENTORY_INTEGRITY_CONFLICT` (HTTP 409): The current build failed integrity verification. Do not retry. Report the integrity failure to an operator. - `TEAM_PRIOR_UNRESOLVED` (HTTP 409): Reconcile the existing team command before preparing another change. Reconcile the earlier team command (see details.commandId) before a new change. - `COHORT_ACTIVE_REQUIRED` (HTTP 409): Only an active cohort can create a new candidate snapshot. Read the current state with the matching get operation, then decide again. - `COHORT_CUT_CHANGED` (HTTP 409): The current cohort cut changed. Restart this read from the first page. Restart the paginated read from the first page. - `COHORT_READ_REQUIRES_ACTIVE` (HTTP 409): Only an active cohort has a current care-facts view. Read the current state with the matching get operation, then decide again. - `COHORT_CUT_NEEDS_RECONCILIATION` (HTTP 409): The cohort cut needs reconciliation before its care facts can be read. Read the current state with the matching get operation, then decide again. - `PROGRAM_NEW_ASSESSMENT_REQUIRED` (HTTP 409): Select a new eligible assessment recorded after the last participation change. Read the current state with the matching get operation, then decide again. - `CONTRACT_CLOSED_WINDOW_CHANGE_UNSUPPORTED` (HTTP 409): The proposed terms change component identities already fixed by an accepted close. Read the current state with the matching get operation, then decide again. - `MINOR_UNIT_SCALE_MISMATCH` (HTTP 400): A component's money is not in the minor units of its currency (ISO 4217). Write each component's money in the minor units of its currency (minorUnitScale 2 for COP, PEN, MXN and BRL; 0 for CLP) and propose again. - `INVOICE_COMPONENT_AMBIGUOUS` (HTTP 409): Invoice lines have no unique fee-for-service component. Route the lines in details.lineIds to their paying component, then request the proposal again. At most 100 identifiers are returned. - `SITE_SUBSTITUTION_REFUSED` (HTTP 409): The contract does not let this site serve for the contracted site as booked. Book at the contracted site, or at a site its contract lets serve for it on the appointment's day (listContractSites), recording what details.reason says is missing: the patient's acceptance or the payer's authorization. - `RESOURCE_LIMIT_EXCEEDED` (HTTP 422): This resource has reached its supported capacity. Do not retry. Reduce the request or archive records first. - `MODULE_NOT_CONTRACTED` (HTTP 422): The organization did not contract this module. Leave the module in details.module off: the organization did not contract it. Árbol adds it to the contract when the organization buys it. - `MODULE_REQUIREMENT_MISSING` (HTTP 422): This module needs one of the modules it requires to be on. Turn on, in the same request, one of the modules the module in details.module requires (getOrganizationModules lists them). - `CAPABILITY_NOT_CONFIGURED` (HTTP 422): This operation requires its governed native implementation before it can be activated. Do not retry. The capability is not enabled for this organization. - `INSTALLATION_NOT_READY` (HTTP 422): The installation cannot be activated: its app version is not certified or a credential its app declares is missing. Do not retry unchanged. Wait for a certified app version, record examples that cover every operation and change of a custom-http installation, or add the missing credentials to the deployment, then activate again. - `EVIDENCE_NOT_READABLE` (HTTP 422): Accepting evidence requires readable content and independent reporter provenance. Leave it pending until its source is readable. Leave the evidence pending until its source content is readable. - `ANALYTICS_QUERY_LIMIT` (HTTP 422): The query exceeded its bounded work, memory or output budget. Narrow the query. Narrow the query (filters, columns or range) and retry. - `COMMIT_UNCERTAIN` (HTTP 503): The commit outcome is unknown. Reconcile before retrying. The write may have happened. Repeat it with the same requestKey or read the record first. - `DATABASE_UNAVAILABLE` (HTTP 503): The database is unavailable. Retry later with backoff; for a write, reuse the same requestKey. - `PIPELINE_UNAVAILABLE` (HTTP 503): The pipeline is unavailable. Reconcile using the same request key. The write may have happened. Repeat it with the same requestKey or read the record first. - `ASSISTANT_UNAVAILABLE` (HTTP 503): The assistant is not available for this workspace. Do not retry. The capability is not enabled for this organization. - `SERVICE_BUSY` (HTTP 503): The service is handling its current request limit. Retry later with backoff; for a write, reuse the same requestKey. - `INVALID_CONFIGURATION` (HTTP 500): The request could not be completed. Retry once later; if it persists, report the requestId to support. - `INTERNAL` (HTTP 500): The request could not be completed. Retry once later; if it persists, report the requestId to support.
    - one of `"UNAUTHORIZED"`, `"AUTHENTICATION_UNAVAILABLE"`, `"ACCESS_DENIED"`, `"MODULE_DISABLED"`, `"INVALID_INPUT"`, `"USER_PAYMENT_REFUSED"`, `"INVALID_INVENTORY"`, `"ANALYTICS_QUERY_REJECTED"`, `"BODY_TOO_LARGE"`, `"NOT_FOUND"`, `"METHOD_NOT_ALLOWED"`, `"CONFLICT"`, `"IDEMPOTENCY_CONFLICT"`, `"TRANSACTION_ABORTED"`, `"INVENTORY_INTEGRITY_CONFLICT"`, `"TEAM_PRIOR_UNRESOLVED"`, `"COHORT_ACTIVE_REQUIRED"`, `"COHORT_CUT_CHANGED"`, `"COHORT_READ_REQUIRES_ACTIVE"`, `"COHORT_CUT_NEEDS_RECONCILIATION"`, `"PROGRAM_NEW_ASSESSMENT_REQUIRED"`, `"CONTRACT_CLOSED_WINDOW_CHANGE_UNSUPPORTED"`, `"MINOR_UNIT_SCALE_MISMATCH"`, `"INVOICE_COMPONENT_AMBIGUOUS"`, `"SITE_SUBSTITUTION_REFUSED"`, `"RESOURCE_LIMIT_EXCEEDED"`, `"MODULE_NOT_CONTRACTED"`, `"MODULE_REQUIREMENT_MISSING"`, `"CAPABILITY_NOT_CONFIGURED"`, `"INSTALLATION_NOT_READY"`, `"EVIDENCE_NOT_READABLE"`, `"ANALYTICS_QUERY_LIMIT"`, `"COMMIT_UNCERTAIN"`, `"DATABASE_UNAVAILABLE"`, `"PIPELINE_UNAVAILABLE"`, `"ASSISTANT_UNAVAILABLE"`, `"SERVICE_BUSY"`, `"INVALID_CONFIGURATION"`, `"INTERNAL"`; example `"INVALID_INPUT"`
  - `message` (`adoptNoteExtraction.response.503.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`adoptNoteExtraction.response.503.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`adoptNoteExtraction.response.503.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`adoptNoteExtraction.response.503.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`adoptNoteExtraction.response.503.error.details.module`; string, optional) — The module the failure is about, for example `agenda`.
      - one of `"pgp"`, `"capitation"`, `"fee_for_service"`, `"results_payment"`, `"service_record"`, `"cac"`, `"cohorts"`, `"studies"`, `"agenda"`, `"voice"`, `"whatsapp"`, `"sms"`, `"email"`, `"arbi"`, `"ai_documents"`, `"ai_care"`, `"analytics"`
    - `paymentProblem` (`adoptNoteExtraction.response.503.error.details.paymentProblem`; string, optional) — Why the collection was refused.
      - one of `"rules_unavailable"`, `"not_collectable"`, `"not_for_this_person"`, `"basis_incomplete"`, `"moderator_fee_value"`, `"service_value_unavailable"`, `"above_share"`, `"above_event_cap"`, `"above_year_cap"`
    - `reason` (`adoptNoteExtraction.response.503.error.details.reason`; string, optional) — Why the booking's site was refused: `not_contracted` (the contracted site is not one of the contract that day), `not_a_substitute` (no substitution in force that day lets the site serve for it), `patient_acceptance_missing` or `payer_authorization_missing` (the substitution asks for them).
      - one of `"not_contracted"`, `"not_a_substitute"`, `"patient_acceptance_missing"`, `"payer_authorization_missing"`
- `metadata` (`adoptNoteExtraction.response.503.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`adoptNoteExtraction.response.503.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`adoptNoteExtraction.response.503.success`; boolean, required) — Always `false` in a failure envelope.
  - one of `false`

### default

#### Example

```json
{
  "error": {
    "code": "INVALID_INPUT",
    "details": {
      "commandId": "string",
      "lineIds": [
        "string"
      ],
      "module": "pgp",
      "paymentProblem": "rules_unavailable",
      "reason": "not_contracted"
    },
    "message": "string"
  },
  "metadata": {
    "requestId": "string"
  },
  "success": false
}
```

- `error` (`adoptNoteExtraction.response.default.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`adoptNoteExtraction.response.default.error.code`; string, required) — Stable failure code. Branch on this value, never on `message`. - `UNAUTHORIZED` (HTTP 401): A valid access token is required. Obtain a fresh access token and repeat the request. - `AUTHENTICATION_UNAVAILABLE` (HTTP 503): Identity verification is temporarily unavailable. Retry later with backoff; for a write, reuse the same requestKey. - `ACCESS_DENIED` (HTTP 403): Access denied. Do not retry. The signed-in actor lacks this purpose or grant; ask an administrator. - `MODULE_DISABLED` (HTTP 403): This operation belongs to a module the organization does not use. Do not retry. The organization does not use the module in details.module (getSession lists the ones it uses); an administrator turns it on with setOrganizationModules. - `INVALID_INPUT` (HTTP 400): The request does not match the documented contract. Do not retry unchanged. Fix the request against the operation's schema. - `USER_PAYMENT_REFUSED` (HTTP 400): The collection exceeds the applicable payment rules. Check the collection basis and caps in details.paymentProblem before recording the payment. - `INVALID_INVENTORY` (HTTP 400): The content does not match the selected inventory contract. Do not retry unchanged. Fix the request against the operation's schema. - `ANALYTICS_QUERY_REJECTED` (HTTP 400): Use one read-only query over the admitted catalog and its supported functions. Rewrite the query as one read-only statement over the published catalog. - `BODY_TOO_LARGE` (HTTP 413): The request body exceeds the supported limit. Send a smaller body, or split the content into several requests. - `NOT_FOUND` (HTTP 404): The resource does not exist. Check the identifier. The record may not exist or may not be visible to this actor. - `METHOD_NOT_ALLOWED` (HTTP 405): The method is not supported for this resource. Use the HTTP method documented for this path. - `CONFLICT` (HTTP 409): The resource conflicts with its current state. Read the current state with the matching get operation, then decide again. - `IDEMPOTENCY_CONFLICT` (HTTP 409): The command key already identifies a different request. The requestKey was already used for a different request. Use a new key for a new action. - `TRANSACTION_ABORTED` (HTTP 409): The transaction rolled back without committing changes. Nothing was written. Retry the same request. - `INVENTORY_INTEGRITY_CONFLICT` (HTTP 409): The current build failed integrity verification. Do not retry. Report the integrity failure to an operator. - `TEAM_PRIOR_UNRESOLVED` (HTTP 409): Reconcile the existing team command before preparing another change. Reconcile the earlier team command (see details.commandId) before a new change. - `COHORT_ACTIVE_REQUIRED` (HTTP 409): Only an active cohort can create a new candidate snapshot. Read the current state with the matching get operation, then decide again. - `COHORT_CUT_CHANGED` (HTTP 409): The current cohort cut changed. Restart this read from the first page. Restart the paginated read from the first page. - `COHORT_READ_REQUIRES_ACTIVE` (HTTP 409): Only an active cohort has a current care-facts view. Read the current state with the matching get operation, then decide again. - `COHORT_CUT_NEEDS_RECONCILIATION` (HTTP 409): The cohort cut needs reconciliation before its care facts can be read. Read the current state with the matching get operation, then decide again. - `PROGRAM_NEW_ASSESSMENT_REQUIRED` (HTTP 409): Select a new eligible assessment recorded after the last participation change. Read the current state with the matching get operation, then decide again. - `CONTRACT_CLOSED_WINDOW_CHANGE_UNSUPPORTED` (HTTP 409): The proposed terms change component identities already fixed by an accepted close. Read the current state with the matching get operation, then decide again. - `MINOR_UNIT_SCALE_MISMATCH` (HTTP 400): A component's money is not in the minor units of its currency (ISO 4217). Write each component's money in the minor units of its currency (minorUnitScale 2 for COP, PEN, MXN and BRL; 0 for CLP) and propose again. - `INVOICE_COMPONENT_AMBIGUOUS` (HTTP 409): Invoice lines have no unique fee-for-service component. Route the lines in details.lineIds to their paying component, then request the proposal again. At most 100 identifiers are returned. - `SITE_SUBSTITUTION_REFUSED` (HTTP 409): The contract does not let this site serve for the contracted site as booked. Book at the contracted site, or at a site its contract lets serve for it on the appointment's day (listContractSites), recording what details.reason says is missing: the patient's acceptance or the payer's authorization. - `RESOURCE_LIMIT_EXCEEDED` (HTTP 422): This resource has reached its supported capacity. Do not retry. Reduce the request or archive records first. - `MODULE_NOT_CONTRACTED` (HTTP 422): The organization did not contract this module. Leave the module in details.module off: the organization did not contract it. Árbol adds it to the contract when the organization buys it. - `MODULE_REQUIREMENT_MISSING` (HTTP 422): This module needs one of the modules it requires to be on. Turn on, in the same request, one of the modules the module in details.module requires (getOrganizationModules lists them). - `CAPABILITY_NOT_CONFIGURED` (HTTP 422): This operation requires its governed native implementation before it can be activated. Do not retry. The capability is not enabled for this organization. - `INSTALLATION_NOT_READY` (HTTP 422): The installation cannot be activated: its app version is not certified or a credential its app declares is missing. Do not retry unchanged. Wait for a certified app version, record examples that cover every operation and change of a custom-http installation, or add the missing credentials to the deployment, then activate again. - `EVIDENCE_NOT_READABLE` (HTTP 422): Accepting evidence requires readable content and independent reporter provenance. Leave it pending until its source is readable. Leave the evidence pending until its source content is readable. - `ANALYTICS_QUERY_LIMIT` (HTTP 422): The query exceeded its bounded work, memory or output budget. Narrow the query. Narrow the query (filters, columns or range) and retry. - `COMMIT_UNCERTAIN` (HTTP 503): The commit outcome is unknown. Reconcile before retrying. The write may have happened. Repeat it with the same requestKey or read the record first. - `DATABASE_UNAVAILABLE` (HTTP 503): The database is unavailable. Retry later with backoff; for a write, reuse the same requestKey. - `PIPELINE_UNAVAILABLE` (HTTP 503): The pipeline is unavailable. Reconcile using the same request key. The write may have happened. Repeat it with the same requestKey or read the record first. - `ASSISTANT_UNAVAILABLE` (HTTP 503): The assistant is not available for this workspace. Do not retry. The capability is not enabled for this organization. - `SERVICE_BUSY` (HTTP 503): The service is handling its current request limit. Retry later with backoff; for a write, reuse the same requestKey. - `INVALID_CONFIGURATION` (HTTP 500): The request could not be completed. Retry once later; if it persists, report the requestId to support. - `INTERNAL` (HTTP 500): The request could not be completed. Retry once later; if it persists, report the requestId to support.
    - one of `"UNAUTHORIZED"`, `"AUTHENTICATION_UNAVAILABLE"`, `"ACCESS_DENIED"`, `"MODULE_DISABLED"`, `"INVALID_INPUT"`, `"USER_PAYMENT_REFUSED"`, `"INVALID_INVENTORY"`, `"ANALYTICS_QUERY_REJECTED"`, `"BODY_TOO_LARGE"`, `"NOT_FOUND"`, `"METHOD_NOT_ALLOWED"`, `"CONFLICT"`, `"IDEMPOTENCY_CONFLICT"`, `"TRANSACTION_ABORTED"`, `"INVENTORY_INTEGRITY_CONFLICT"`, `"TEAM_PRIOR_UNRESOLVED"`, `"COHORT_ACTIVE_REQUIRED"`, `"COHORT_CUT_CHANGED"`, `"COHORT_READ_REQUIRES_ACTIVE"`, `"COHORT_CUT_NEEDS_RECONCILIATION"`, `"PROGRAM_NEW_ASSESSMENT_REQUIRED"`, `"CONTRACT_CLOSED_WINDOW_CHANGE_UNSUPPORTED"`, `"MINOR_UNIT_SCALE_MISMATCH"`, `"INVOICE_COMPONENT_AMBIGUOUS"`, `"SITE_SUBSTITUTION_REFUSED"`, `"RESOURCE_LIMIT_EXCEEDED"`, `"MODULE_NOT_CONTRACTED"`, `"MODULE_REQUIREMENT_MISSING"`, `"CAPABILITY_NOT_CONFIGURED"`, `"INSTALLATION_NOT_READY"`, `"EVIDENCE_NOT_READABLE"`, `"ANALYTICS_QUERY_LIMIT"`, `"COMMIT_UNCERTAIN"`, `"DATABASE_UNAVAILABLE"`, `"PIPELINE_UNAVAILABLE"`, `"ASSISTANT_UNAVAILABLE"`, `"SERVICE_BUSY"`, `"INVALID_CONFIGURATION"`, `"INTERNAL"`; example `"INVALID_INPUT"`
  - `message` (`adoptNoteExtraction.response.default.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`adoptNoteExtraction.response.default.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`adoptNoteExtraction.response.default.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`adoptNoteExtraction.response.default.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`adoptNoteExtraction.response.default.error.details.module`; string, optional) — The module the failure is about, for example `agenda`.
      - one of `"pgp"`, `"capitation"`, `"fee_for_service"`, `"results_payment"`, `"service_record"`, `"cac"`, `"cohorts"`, `"studies"`, `"agenda"`, `"voice"`, `"whatsapp"`, `"sms"`, `"email"`, `"arbi"`, `"ai_documents"`, `"ai_care"`, `"analytics"`
    - `paymentProblem` (`adoptNoteExtraction.response.default.error.details.paymentProblem`; string, optional) — Why the collection was refused.
      - one of `"rules_unavailable"`, `"not_collectable"`, `"not_for_this_person"`, `"basis_incomplete"`, `"moderator_fee_value"`, `"service_value_unavailable"`, `"above_share"`, `"above_event_cap"`, `"above_year_cap"`
    - `reason` (`adoptNoteExtraction.response.default.error.details.reason`; string, optional) — Why the booking's site was refused: `not_contracted` (the contracted site is not one of the contract that day), `not_a_substitute` (no substitution in force that day lets the site serve for it), `patient_acceptance_missing` or `payer_authorization_missing` (the substitution asks for them).
      - one of `"not_contracted"`, `"not_a_substitute"`, `"patient_acceptance_missing"`, `"payer_authorization_missing"`
- `metadata` (`adoptNoteExtraction.response.default.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`adoptNoteExtraction.response.default.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`adoptNoteExtraction.response.default.success`; boolean, required) — Always `false` in a failure envelope.
  - one of `false`


Source: https://docs.getarbol.com/api/ambar/adopt-note-extraction/index.md
