---
title: "Save a clinical route draft"
---

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

# Save a clinical route draft

Path: Ámbar API › Clinical routes

`POST /v1/clinical-routes/save`

Saves a new draft care route version (`version` `1`) for a contract with the next route number. Existing routes are never edited; a route takes effect only after proposeClinicalRoute and approveClinicalRoute.
Send the contract's current revision, its current highest route `number` (`0` when none) and a ready contract artifact with the authored document. Cohorts must be active; code bindings must match active approved study definitions (see previewClinicalRouteTemplate).
Returns the saved route.
Idempotency: the same `requestKey` with the same body returns the original result; a different body with that key fails with IDEMPOTENCY_CONFLICT.
Errors: CONFLICT when the contract revision or latest route number is stale (re-read with listClinicalRoutes), the contract is suspended, the id exists or a code binding no longer matches its source; INVALID_INPUT for an invalid definition or source reference.
ACCESS_DENIED without contract read and write access, when the artifact, a cohort or a study definition is not available, or as a non-human caller; COMMIT_UNCERTAIN: retry with the same `requestKey` before doing anything else.

## Authentication

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

## Request body

_Required._

- `contractId` (`saveClinicalRoute.contractId`; string, required) — Contract the route belongs to; it must not be suspended.
- `definition` (`saveClinicalRoute.definition`; object, required) — Route content.
  - `effectiveFrom` (`saveClinicalRoute.definition.effectiveFrom`; string, required) — First day the route applies (`YYYY-MM-DD`, in `timeZone`).
  - `name` (`saveClinicalRoute.definition.name`; string, required) — Route name (1-200 characters).
  - `requirements` (`saveClinicalRoute.definition.requirements`; array<object>, required) — 1-200 requirements; cohort, service, first-due rule and sex must not repeat together.
    - `closesWith` (`saveClinicalRoute.definition.requirements.closesWith`; array<ClosingEvidence>, required) — Up to 20 more kinds of evidence that close the requirement.
      - one of:
        - `object`
          - `codes` (`saveClinicalRoute.definition.requirements.closesWith.1.codes`; array<string>, required) — 1-50 selectors `SYSTEM:code` (`CUPS`, `LOINC`, `SCT`, `ORG` or `AMBAR`), each bound in `codeBindings`.
          - `kind` (`saveClinicalRoute.definition.requirements.closesWith.1.kind`; string, required)
            - one of `"intervention"`
        - `object`
          - `definition` (`saveClinicalRoute.definition.requirements.closesWith.2.definition`; string, required) — Identifier of the agent fact definition (1-100 characters).
          - `kind` (`saveClinicalRoute.definition.requirements.closesWith.2.kind`; string, required)
            - one of `"arbol_fact"`
    - `cohortKey` (`saveClinicalRoute.definition.requirements.cohortKey`; string, required) — Active cohort whose current members the requirement applies to (you need read access).
    - `firstDue` (`saveClinicalRoute.definition.requirements.firstDue`; FirstDue, required) — When the requirement first becomes due.
      - one of:
        - `object`
          - `kind` (`saveClinicalRoute.definition.requirements.firstDue.1.kind`; string, required)
            - one of `"immediate"`
        - `object`
          - `kind` (`saveClinicalRoute.definition.requirements.firstDue.2.kind`; string, required)
            - one of `"age_months"`
          - `months` (`saveClinicalRoute.definition.requirements.firstDue.2.months`; integer, required) — Age in months (0-1560).
            - format `int32`; min 0
        - `object`
          - `days` (`saveClinicalRoute.definition.requirements.firstDue.3.days`; integer, required) — Days after that diagnosis (0-3650).
            - format `int32`; min 0
          - `kind` (`saveClinicalRoute.definition.requirements.firstDue.3.kind`; string, required)
            - one of `"days_after_diagnosis"`
        - `object`
          - `code` (`saveClinicalRoute.definition.requirements.firstDue.4.code`; string, required) — Observation selector `SYSTEM:code` (1-40 characters), bound in `codeBindings`.
          - `days` (`saveClinicalRoute.definition.requirements.firstDue.4.days`; integer, required) — Days after that observation (0-365).
            - format `int32`; min 0
          - `kind` (`saveClinicalRoute.definition.requirements.firstDue.4.kind`; string, required)
            - one of `"after_observation"`
        - `object`
          - `actions` (`saveClinicalRoute.definition.requirements.firstDue.5.actions`; array<string>, required) — 1-3 change actions that trigger it.
            - one of `"start"`, `"restart"`, `"dose_change"`
          - `codes` (`saveClinicalRoute.definition.requirements.firstDue.5.codes`; array<string>, required) — 1-50 ATC codes or prefixes, optionally written `ATC:C09`; any of them qualifies.
          - `days` (`saveClinicalRoute.definition.requirements.firstDue.5.days`; integer, required) — Days after that change (0-365).
            - format `int32`; min 0
          - `kind` (`saveClinicalRoute.definition.requirements.firstDue.5.kind`; string, required)
            - one of `"after_medication_change"`
          - `source` (`saveClinicalRoute.definition.requirements.firstDue.5.source`; object, required) — Documentary source; unless approved before the evaluation, the requirement is `unknown`.
            - `document` (`saveClinicalRoute.definition.requirements.firstDue.5.source.document`; string, required) — Title of the source document (1-240 characters).
            - `locator` (`saveClinicalRoute.definition.requirements.firstDue.5.source.locator`; string, required) — Where the criterion is in the document, such as a section (1-240 characters).
            - `status` (`saveClinicalRoute.definition.requirements.firstDue.5.source.status`; string, required) — Review status of the source.
              - one of `"draft"`, `"approved"`
            - `version` (`saveClinicalRoute.definition.requirements.firstDue.5.source.version`; string, required) — Edition of the source document (1-120 characters).
            - `reviewedAt` (`saveClinicalRoute.definition.requirements.firstDue.5.source.reviewedAt`; string | null, optional) — When a person reviewed the source (RFC 3339); required when `approved`.
            - `reviewedBy` (`saveClinicalRoute.definition.requirements.firstDue.5.source.reviewedBy`; string | null, optional) — Who reviewed the source (1-120 characters); required when `approved`.
            - `sha256` (`saveClinicalRoute.definition.requirements.firstDue.5.source.sha256`; string | null, optional) — SHA-256 of the source document (64 lowercase hexadecimal characters); `null` if not given.
          - `sourceKinds` (`saveClinicalRoute.definition.requirements.firstDue.5.sourceKinds`; array<string>, required) — 1-4 record sources whose changes count; patient reports never count.
            - one of `"medical_record"`, `"prescription"`, `"discharge_report"`, `"patient_report"`
          - `observation` (`saveClinicalRoute.definition.requirements.firstDue.5.observation`; one of, optional)
            - one of: `RouteObservation`, `null`
    - `frequencyDays` (`saveClinicalRoute.definition.requirements.frequencyDays`; integer, required) — Days until the requirement is due again after it was closed (1-3650).
      - format `int32`; min 0
    - `graceDays` (`saveClinicalRoute.definition.requirements.graceDays`; integer, required) — Days after the due date before it counts as `overdue` (0-365).
      - format `int32`; min 0
    - `interventionCode` (`saveClinicalRoute.definition.requirements.interventionCode`; string, required) — Selector `SYSTEM:code` of the required service (1-80 characters), bound in `codeBindings`; a performed procedure with it closes the requirement.
    - `label` (`saveClinicalRoute.definition.requirements.label`; string, required) — Display label (1-200 characters).
    - `activity` (`saveClinicalRoute.definition.requirements.activity`; string, optional) — The activity this requirement is, as workflows name it in `activity_due` (for example `control-medicina-general`): a lowercase letter, then lowercase letters, digits, `_` or `-` (at most 128). It stays the same across route versions, and requirements of one activity (one per sex, for instance) share it. Omitted when no workflow manages the requirement.
    - `critical` (`saveClinicalRoute.definition.requirements.critical`; boolean, optional) — `true` marks the requirement as critical; omitted when not set.
    - `group` (`saveClinicalRoute.definition.requirements.group`; string, optional) — Display group (1-60 characters); omitted when not set.
    - `sex` (`saveClinicalRoute.definition.requirements.sex`; string, optional) — Only patients of this administrative sex; omitted means everyone. Patients without a recorded sex are `unknown`.
      - one of `"female"`, `"male"`
    - `technicalNoteLineKey` (`saveClinicalRoute.definition.requirements.technicalNoteLineKey`; string, optional) — Related contract technical note line (1-120 characters); omitted when not set.
  - `timeZone` (`saveClinicalRoute.definition.timeZone`; string, required) — Time zone of the route dates.
    - one of `"UTC"`, `"America/Bogota"`, `"America/Lima"`, `"America/Mexico_City"`, `"America/Santiago"`, `"America/Sao_Paulo"`
  - `codeBindings` (`saveClinicalRoute.definition.codeBindings`; array<object>, optional) — Up to 128 bindings, one per selector used; omitted when empty.
    - `coding` (`saveClinicalRoute.definition.codeBindings.coding`; object, required) — Exact coding: system, edition and code.
      - `code` (`saveClinicalRoute.definition.codeBindings.coding.code`; string, required) — Code within the system, 1 to 128 characters.
      - `display` (`saveClinicalRoute.definition.codeBindings.coding.display`; string, required) — Human-readable label, 1 to 200 characters; never used to identify the concept.
      - `system` (`saveClinicalRoute.definition.codeBindings.coding.system`; string, required) — Code system as a URI or URN: must contain `:` and no whitespace, 1 to 200 characters.
      - `version` (`saveClinicalRoute.definition.codeBindings.coding.version`; string, required) — Version of the code system, 1 to 64 characters.
    - `definitionId` (`saveClinicalRoute.definition.codeBindings.definitionId`; string, required) — Study definition the coding comes from; it must be readable and not retired.
    - `definitionVersion` (`saveClinicalRoute.definition.codeBindings.definitionVersion`; string, required) — Active approved revision of that definition.
    - `selector` (`saveClinicalRoute.definition.codeBindings.selector`; string, required) — `SYSTEM:code` built from `coding` (`CUPS`, `LOINC`, `SCT`, `ORG` or `AMBAR`); unique in the route.
    - `componentKey` (`saveClinicalRoute.definition.codeBindings.componentKey`; string, optional) — Component of the definition that holds the coding; omitted when the coding is the definition's main service.
- `expectedContractVersion` (`saveClinicalRoute.expectedContractVersion`; string, required) — The contract's current revision (decimal string, at least 1).
- `expectedLatestNumber` (`saveClinicalRoute.expectedLatestNumber`; string, required) — Highest route `number` of the contract now; `0` when it has none.
- `id` (`saveClinicalRoute.id`; string, required) — New route identifier (lowercase letters, digits, `_`, `-`; up to 128 characters).
- `requestKey` (`saveClinicalRoute.requestKey`; string, required) — 32 lowercase hexadecimal characters; reuse it only to retry this exact request.
- `source` (`saveClinicalRoute.source`; object, required) — Ready artifact of this contract (`artifact:art_` + 32 hex characters) with its SHA-256.
  - `reference` (`saveClinicalRoute.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` (`saveClinicalRoute.source.sha256`; string, required) — SHA-256 of the document bytes: 64 lowercase hexadecimal characters.

## Example request

```json
{
  "contractId": "contract_01",
  "definition": {
    "codeBindings": [
      {
        "coding": {
          "code": "example",
          "display": "example",
          "system": "example",
          "version": "1"
        },
        "componentKey": "0123456789abcdef0123456789abcdef",
        "definitionId": "definition_01",
        "definitionVersion": "1",
        "selector": "example"
      }
    ],
    "effectiveFrom": "example",
    "name": "example",
    "requirements": [
      {
        "activity": "example",
        "closesWith": [
          {
            "codes": [
              "example"
            ],
            "kind": "intervention"
          }
        ],
        "cohortKey": "0123456789abcdef0123456789abcdef",
        "critical": false,
        "firstDue": {
          "kind": "immediate"
        },
        "frequencyDays": 0,
        "graceDays": 0,
        "group": "example",
        "interventionCode": "example",
        "label": "example",
        "sex": "female",
        "technicalNoteLineKey": "0123456789abcdef0123456789abcdef"
      }
    ],
    "timeZone": "UTC"
  },
  "expectedContractVersion": "1",
  "expectedLatestNumber": "example",
  "id": "example_01",
  "requestKey": "0123456789abcdef0123456789abcdef",
  "source": {
    "reference": "example",
    "sha256": "0123456789abcdef0123456789abcdef"
  }
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://api-ambar.getarbol.com/v1/clinical-routes/save \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "contractId": "contract_01",
  "definition": {
    "codeBindings": [
      {
        "coding": {
          "code": "example",
          "display": "example",
          "system": "example",
          "version": "1"
        },
        "componentKey": "0123456789abcdef0123456789abcdef",
        "definitionId": "definition_01",
        "definitionVersion": "1",
        "selector": "example"
      }
    ],
    "effectiveFrom": "example",
    "name": "example",
    "requirements": [
      {
        "activity": "example",
        "closesWith": [
          {
            "codes": [
              "example"
            ],
            "kind": "intervention"
          }
        ],
        "cohortKey": "0123456789abcdef0123456789abcdef",
        "critical": false,
        "firstDue": {
          "kind": "immediate"
        },
        "frequencyDays": 0,
        "graceDays": 0,
        "group": "example",
        "interventionCode": "example",
        "label": "example",
        "sex": "female",
        "technicalNoteLineKey": "0123456789abcdef0123456789abcdef"
      }
    ],
    "timeZone": "UTC"
  },
  "expectedContractVersion": "1",
  "expectedLatestNumber": "example",
  "id": "example_01",
  "requestKey": "0123456789abcdef0123456789abcdef",
  "source": {
    "reference": "example",
    "sha256": "0123456789abcdef0123456789abcdef"
  }
}
'
```

### TypeScript

```typescript
const url = 'https://api-ambar.getarbol.com/v1/clinical-routes/save';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    contractId: 'contract_01',
    definition: {
      codeBindings: [
        {
          coding: {code: 'example', display: 'example', system: 'example', version: '1'},
          componentKey: '0123456789abcdef0123456789abcdef',
          definitionId: 'definition_01',
          definitionVersion: '1',
          selector: 'example'
        }
      ],
      effectiveFrom: 'example',
      name: 'example',
      requirements: [
        {
          activity: 'example',
          closesWith: [{codes: ['example'], kind: 'intervention'}],
          cohortKey: '0123456789abcdef0123456789abcdef',
          critical: false,
          firstDue: {kind: 'immediate'},
          frequencyDays: 0,
          graceDays: 0,
          group: 'example',
          interventionCode: 'example',
          label: 'example',
          sex: 'female',
          technicalNoteLineKey: '0123456789abcdef0123456789abcdef'
        }
      ],
      timeZone: 'UTC'
    },
    expectedContractVersion: '1',
    expectedLatestNumber: 'example',
    id: 'example_01',
    requestKey: '0123456789abcdef0123456789abcdef',
    source: {reference: 'example', sha256: '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/clinical-routes/save"

payload = {
    "contractId": "contract_01",
    "definition": {
        "codeBindings": [
            {
                "coding": {
                    "code": "example",
                    "display": "example",
                    "system": "example",
                    "version": "1"
                },
                "componentKey": "0123456789abcdef0123456789abcdef",
                "definitionId": "definition_01",
                "definitionVersion": "1",
                "selector": "example"
            }
        ],
        "effectiveFrom": "example",
        "name": "example",
        "requirements": [
            {
                "activity": "example",
                "closesWith": [
                    {
                        "codes": ["example"],
                        "kind": "intervention"
                    }
                ],
                "cohortKey": "0123456789abcdef0123456789abcdef",
                "critical": False,
                "firstDue": { "kind": "immediate" },
                "frequencyDays": 0,
                "graceDays": 0,
                "group": "example",
                "interventionCode": "example",
                "label": "example",
                "sex": "female",
                "technicalNoteLineKey": "0123456789abcdef0123456789abcdef"
            }
        ],
        "timeZone": "UTC"
    },
    "expectedContractVersion": "1",
    "expectedLatestNumber": "example",
    "id": "example_01",
    "requestKey": "0123456789abcdef0123456789abcdef",
    "source": {
        "reference": "example",
        "sha256": "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": {
    "route": {
      "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": {
        "codeBindings": [
          {
            "coding": {
              "code": "example",
              "display": "example",
              "system": "example",
              "version": "1"
            },
            "componentKey": "0123456789abcdef0123456789abcdef",
            "definitionId": "definition_01",
            "definitionVersion": "1",
            "selector": "example"
          }
        ],
        "effectiveFrom": "example",
        "name": "example",
        "requirements": [
          {
            "activity": "example",
            "closesWith": [
              {
                "codes": [
                  "example"
                ],
                "kind": "intervention"
              }
            ],
            "cohortKey": "0123456789abcdef0123456789abcdef",
            "critical": false,
            "firstDue": {
              "kind": "immediate"
            },
            "frequencyDays": 0,
            "graceDays": 0,
            "group": "example",
            "interventionCode": "example",
            "label": "example",
            "sex": "female",
            "technicalNoteLineKey": "0123456789abcdef0123456789abcdef"
          }
        ],
        "timeZone": "UTC"
      },
      "id": "example_01",
      "number": "example",
      "proposedAt": "2026-10-14T13:00:00Z",
      "proposedBy": "example",
      "source": {
        "reference": "example",
        "sha256": "0123456789abcdef0123456789abcdef"
      },
      "state": "draft",
      "version": "1"
    }
  },
  "metadata": {
    "requestId": "request_01"
  },
  "success": true
}
```

- `data` (`saveClinicalRoute.response.200.data`; object, required) — Result of a care route save, proposal or approval.
  - `route` (`saveClinicalRoute.response.200.data.route`; object, required) — The route after the command.
    - `approvalEvidence` (`saveClinicalRoute.response.200.data.route.approvalEvidence`; one of, required)
      - one of: `ContractArtifact`, `null`
    - `approvedAt` (`saveClinicalRoute.response.200.data.route.approvedAt`; string | null, required) — When it was approved (RFC 3339); `null` until approved.
    - `approvedBy` (`saveClinicalRoute.response.200.data.route.approvedBy`; string | null, required) — Actor that approved it; `null` until approved.
    - `contractId` (`saveClinicalRoute.response.200.data.route.contractId`; string, required) — Contract the route belongs to.
    - `createdAt` (`saveClinicalRoute.response.200.data.route.createdAt`; string, required) — When the route was saved (RFC 3339).
    - `createdBy` (`saveClinicalRoute.response.200.data.route.createdBy`; string, required) — Actor that saved the route.
    - `definition` (`saveClinicalRoute.response.200.data.route.definition`; object, required) — Authored route content.
      - `effectiveFrom` (`saveClinicalRoute.response.200.data.route.definition.effectiveFrom`; string, required) — First day the route applies (`YYYY-MM-DD`, in `timeZone`).
      - `name` (`saveClinicalRoute.response.200.data.route.definition.name`; string, required) — Route name (1-200 characters).
      - `requirements` (`saveClinicalRoute.response.200.data.route.definition.requirements`; array<object>, required) — 1-200 requirements; cohort, service, first-due rule and sex must not repeat together.
        - `closesWith` (`saveClinicalRoute.response.200.data.route.definition.requirements.closesWith`; array<ClosingEvidence>, required) — Up to 20 more kinds of evidence that close the requirement.
          - one of:
            - `object`
              - `codes` (`saveClinicalRoute.response.200.data.route.definition.requirements.closesWith.1.codes`; array<string>, required) — 1-50 selectors `SYSTEM:code` (`CUPS`, `LOINC`, `SCT`, `ORG` or `AMBAR`), each bound in `codeBindings`.
              - `kind` (`saveClinicalRoute.response.200.data.route.definition.requirements.closesWith.1.kind`; string, required)
                - one of `"intervention"`
            - `object`
              - `definition` (`saveClinicalRoute.response.200.data.route.definition.requirements.closesWith.2.definition`; string, required) — Identifier of the agent fact definition (1-100 characters).
              - `kind` (`saveClinicalRoute.response.200.data.route.definition.requirements.closesWith.2.kind`; string, required)
                - one of `"arbol_fact"`
        - `cohortKey` (`saveClinicalRoute.response.200.data.route.definition.requirements.cohortKey`; string, required) — Active cohort whose current members the requirement applies to (you need read access).
        - `firstDue` (`saveClinicalRoute.response.200.data.route.definition.requirements.firstDue`; FirstDue, required) — When the requirement first becomes due.
          - one of:
            - `object`
              - `kind` (`saveClinicalRoute.response.200.data.route.definition.requirements.firstDue.1.kind`; string, required)
                - one of `"immediate"`
            - `object`
              - `kind` (`saveClinicalRoute.response.200.data.route.definition.requirements.firstDue.2.kind`; string, required)
                - one of `"age_months"`
              - `months` (`saveClinicalRoute.response.200.data.route.definition.requirements.firstDue.2.months`; integer, required) — Age in months (0-1560).
                - format `int32`; min 0
            - `object`
              - `days` (`saveClinicalRoute.response.200.data.route.definition.requirements.firstDue.3.days`; integer, required) — Days after that diagnosis (0-3650).
                - format `int32`; min 0
              - `kind` (`saveClinicalRoute.response.200.data.route.definition.requirements.firstDue.3.kind`; string, required)
                - one of `"days_after_diagnosis"`
            - `object`
              - `code` (`saveClinicalRoute.response.200.data.route.definition.requirements.firstDue.4.code`; string, required) — Observation selector `SYSTEM:code` (1-40 characters), bound in `codeBindings`.
              - `days` (`saveClinicalRoute.response.200.data.route.definition.requirements.firstDue.4.days`; integer, required) — Days after that observation (0-365).
                - format `int32`; min 0
              - `kind` (`saveClinicalRoute.response.200.data.route.definition.requirements.firstDue.4.kind`; string, required)
                - one of `"after_observation"`
            - `object`
              - `actions` (`saveClinicalRoute.response.200.data.route.definition.requirements.firstDue.5.actions`; array<string>, required) — 1-3 change actions that trigger it.
                - one of `"start"`, `"restart"`, `"dose_change"`
              - `codes` (`saveClinicalRoute.response.200.data.route.definition.requirements.firstDue.5.codes`; array<string>, required) — 1-50 ATC codes or prefixes, optionally written `ATC:C09`; any of them qualifies.
              - `days` (`saveClinicalRoute.response.200.data.route.definition.requirements.firstDue.5.days`; integer, required) — Days after that change (0-365).
                - format `int32`; min 0
              - `kind` (`saveClinicalRoute.response.200.data.route.definition.requirements.firstDue.5.kind`; string, required)
                - one of `"after_medication_change"`
              - `source` (`saveClinicalRoute.response.200.data.route.definition.requirements.firstDue.5.source`; object, required) — Documentary source; unless approved before the evaluation, the requirement is `unknown`.
                - `document` (`saveClinicalRoute.response.200.data.route.definition.requirements.firstDue.5.source.document`; string, required) — Title of the source document (1-240 characters).
                - `locator` (`saveClinicalRoute.response.200.data.route.definition.requirements.firstDue.5.source.locator`; string, required) — Where the criterion is in the document, such as a section (1-240 characters).
                - `status` (`saveClinicalRoute.response.200.data.route.definition.requirements.firstDue.5.source.status`; string, required) — Review status of the source.
                  - one of `"draft"`, `"approved"`
                - `version` (`saveClinicalRoute.response.200.data.route.definition.requirements.firstDue.5.source.version`; string, required) — Edition of the source document (1-120 characters).
                - `reviewedAt` (`saveClinicalRoute.response.200.data.route.definition.requirements.firstDue.5.source.reviewedAt`; string | null, optional) — When a person reviewed the source (RFC 3339); required when `approved`.
                - `reviewedBy` (`saveClinicalRoute.response.200.data.route.definition.requirements.firstDue.5.source.reviewedBy`; string | null, optional) — Who reviewed the source (1-120 characters); required when `approved`.
                - `sha256` (`saveClinicalRoute.response.200.data.route.definition.requirements.firstDue.5.source.sha256`; string | null, optional) — SHA-256 of the source document (64 lowercase hexadecimal characters); `null` if not given.
              - `sourceKinds` (`saveClinicalRoute.response.200.data.route.definition.requirements.firstDue.5.sourceKinds`; array<string>, required) — 1-4 record sources whose changes count; patient reports never count.
                - one of `"medical_record"`, `"prescription"`, `"discharge_report"`, `"patient_report"`
              - `observation` (`saveClinicalRoute.response.200.data.route.definition.requirements.firstDue.5.observation`; one of, optional)
                - one of: `RouteObservation`, `null`
        - `frequencyDays` (`saveClinicalRoute.response.200.data.route.definition.requirements.frequencyDays`; integer, required) — Days until the requirement is due again after it was closed (1-3650).
          - format `int32`; min 0
        - `graceDays` (`saveClinicalRoute.response.200.data.route.definition.requirements.graceDays`; integer, required) — Days after the due date before it counts as `overdue` (0-365).
          - format `int32`; min 0
        - `interventionCode` (`saveClinicalRoute.response.200.data.route.definition.requirements.interventionCode`; string, required) — Selector `SYSTEM:code` of the required service (1-80 characters), bound in `codeBindings`; a performed procedure with it closes the requirement.
        - `label` (`saveClinicalRoute.response.200.data.route.definition.requirements.label`; string, required) — Display label (1-200 characters).
        - `activity` (`saveClinicalRoute.response.200.data.route.definition.requirements.activity`; string, optional) — The activity this requirement is, as workflows name it in `activity_due` (for example `control-medicina-general`): a lowercase letter, then lowercase letters, digits, `_` or `-` (at most 128). It stays the same across route versions, and requirements of one activity (one per sex, for instance) share it. Omitted when no workflow manages the requirement.
        - `critical` (`saveClinicalRoute.response.200.data.route.definition.requirements.critical`; boolean, optional) — `true` marks the requirement as critical; omitted when not set.
        - `group` (`saveClinicalRoute.response.200.data.route.definition.requirements.group`; string, optional) — Display group (1-60 characters); omitted when not set.
        - `sex` (`saveClinicalRoute.response.200.data.route.definition.requirements.sex`; string, optional) — Only patients of this administrative sex; omitted means everyone. Patients without a recorded sex are `unknown`.
          - one of `"female"`, `"male"`
        - `technicalNoteLineKey` (`saveClinicalRoute.response.200.data.route.definition.requirements.technicalNoteLineKey`; string, optional) — Related contract technical note line (1-120 characters); omitted when not set.
      - `timeZone` (`saveClinicalRoute.response.200.data.route.definition.timeZone`; string, required) — Time zone of the route dates.
        - one of `"UTC"`, `"America/Bogota"`, `"America/Lima"`, `"America/Mexico_City"`, `"America/Santiago"`, `"America/Sao_Paulo"`
      - `codeBindings` (`saveClinicalRoute.response.200.data.route.definition.codeBindings`; array<object>, optional) — Up to 128 bindings, one per selector used; omitted when empty.
        - `coding` (`saveClinicalRoute.response.200.data.route.definition.codeBindings.coding`; object, required) — Exact coding: system, edition and code.
          - `code` (`saveClinicalRoute.response.200.data.route.definition.codeBindings.coding.code`; string, required) — Code within the system, 1 to 128 characters.
          - `display` (`saveClinicalRoute.response.200.data.route.definition.codeBindings.coding.display`; string, required) — Human-readable label, 1 to 200 characters; never used to identify the concept.
          - `system` (`saveClinicalRoute.response.200.data.route.definition.codeBindings.coding.system`; string, required) — Code system as a URI or URN: must contain `:` and no whitespace, 1 to 200 characters.
          - `version` (`saveClinicalRoute.response.200.data.route.definition.codeBindings.coding.version`; string, required) — Version of the code system, 1 to 64 characters.
        - `definitionId` (`saveClinicalRoute.response.200.data.route.definition.codeBindings.definitionId`; string, required) — Study definition the coding comes from; it must be readable and not retired.
        - `definitionVersion` (`saveClinicalRoute.response.200.data.route.definition.codeBindings.definitionVersion`; string, required) — Active approved revision of that definition.
        - `selector` (`saveClinicalRoute.response.200.data.route.definition.codeBindings.selector`; string, required) — `SYSTEM:code` built from `coding` (`CUPS`, `LOINC`, `SCT`, `ORG` or `AMBAR`); unique in the route.
        - `componentKey` (`saveClinicalRoute.response.200.data.route.definition.codeBindings.componentKey`; string, optional) — Component of the definition that holds the coding; omitted when the coding is the definition's main service.
    - `id` (`saveClinicalRoute.response.200.data.route.id`; string, required) — Route identifier chosen when it was saved.
    - `number` (`saveClinicalRoute.response.200.data.route.number`; string, required) — Route number within the contract (decimal string); each save adds the next number.
    - `proposedAt` (`saveClinicalRoute.response.200.data.route.proposedAt`; string | null, required) — When it was proposed (RFC 3339); `null` until proposed.
    - `proposedBy` (`saveClinicalRoute.response.200.data.route.proposedBy`; string | null, required) — Actor that proposed it; `null` until proposed.
    - `source` (`saveClinicalRoute.response.200.data.route.source`; object, required) — Contract artifact that holds the authored route document.
      - `reference` (`saveClinicalRoute.response.200.data.route.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` (`saveClinicalRoute.response.200.data.route.source.sha256`; string, required) — SHA-256 of the document bytes: 64 lowercase hexadecimal characters.
    - `state` (`saveClinicalRoute.response.200.data.route.state`; string, required) — Approval state.
      - one of `"draft"`, `"proposed"`, `"approved"`
    - `version` (`saveClinicalRoute.response.200.data.route.version`; string, required) — State revision: `1` draft, `2` proposed, `3` approved. Send it as `expectedVersion`.
- `metadata` (`saveClinicalRoute.response.200.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`saveClinicalRoute.response.200.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`saveClinicalRoute.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` (`saveClinicalRoute.response.400.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`saveClinicalRoute.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` (`saveClinicalRoute.response.400.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`saveClinicalRoute.response.400.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`saveClinicalRoute.response.400.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`saveClinicalRoute.response.400.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`saveClinicalRoute.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` (`saveClinicalRoute.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` (`saveClinicalRoute.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` (`saveClinicalRoute.response.400.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`saveClinicalRoute.response.400.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`saveClinicalRoute.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` (`saveClinicalRoute.response.401.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`saveClinicalRoute.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` (`saveClinicalRoute.response.401.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`saveClinicalRoute.response.401.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`saveClinicalRoute.response.401.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`saveClinicalRoute.response.401.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`saveClinicalRoute.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` (`saveClinicalRoute.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` (`saveClinicalRoute.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` (`saveClinicalRoute.response.401.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`saveClinicalRoute.response.401.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`saveClinicalRoute.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` (`saveClinicalRoute.response.403.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`saveClinicalRoute.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` (`saveClinicalRoute.response.403.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`saveClinicalRoute.response.403.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`saveClinicalRoute.response.403.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`saveClinicalRoute.response.403.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`saveClinicalRoute.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` (`saveClinicalRoute.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` (`saveClinicalRoute.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` (`saveClinicalRoute.response.403.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`saveClinicalRoute.response.403.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`saveClinicalRoute.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` (`saveClinicalRoute.response.404.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`saveClinicalRoute.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` (`saveClinicalRoute.response.404.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`saveClinicalRoute.response.404.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`saveClinicalRoute.response.404.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`saveClinicalRoute.response.404.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`saveClinicalRoute.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` (`saveClinicalRoute.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` (`saveClinicalRoute.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` (`saveClinicalRoute.response.404.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`saveClinicalRoute.response.404.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`saveClinicalRoute.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` (`saveClinicalRoute.response.409.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`saveClinicalRoute.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` (`saveClinicalRoute.response.409.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`saveClinicalRoute.response.409.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`saveClinicalRoute.response.409.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`saveClinicalRoute.response.409.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`saveClinicalRoute.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` (`saveClinicalRoute.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` (`saveClinicalRoute.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` (`saveClinicalRoute.response.409.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`saveClinicalRoute.response.409.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`saveClinicalRoute.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` (`saveClinicalRoute.response.413.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`saveClinicalRoute.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` (`saveClinicalRoute.response.413.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`saveClinicalRoute.response.413.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`saveClinicalRoute.response.413.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`saveClinicalRoute.response.413.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`saveClinicalRoute.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` (`saveClinicalRoute.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` (`saveClinicalRoute.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` (`saveClinicalRoute.response.413.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`saveClinicalRoute.response.413.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`saveClinicalRoute.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` (`saveClinicalRoute.response.422.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`saveClinicalRoute.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` (`saveClinicalRoute.response.422.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`saveClinicalRoute.response.422.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`saveClinicalRoute.response.422.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`saveClinicalRoute.response.422.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`saveClinicalRoute.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` (`saveClinicalRoute.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` (`saveClinicalRoute.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` (`saveClinicalRoute.response.422.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`saveClinicalRoute.response.422.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`saveClinicalRoute.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` (`saveClinicalRoute.response.500.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`saveClinicalRoute.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` (`saveClinicalRoute.response.500.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`saveClinicalRoute.response.500.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`saveClinicalRoute.response.500.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`saveClinicalRoute.response.500.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`saveClinicalRoute.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` (`saveClinicalRoute.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` (`saveClinicalRoute.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` (`saveClinicalRoute.response.500.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`saveClinicalRoute.response.500.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`saveClinicalRoute.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` (`saveClinicalRoute.response.503.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`saveClinicalRoute.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` (`saveClinicalRoute.response.503.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`saveClinicalRoute.response.503.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`saveClinicalRoute.response.503.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`saveClinicalRoute.response.503.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`saveClinicalRoute.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` (`saveClinicalRoute.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` (`saveClinicalRoute.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` (`saveClinicalRoute.response.503.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`saveClinicalRoute.response.503.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`saveClinicalRoute.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` (`saveClinicalRoute.response.default.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`saveClinicalRoute.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` (`saveClinicalRoute.response.default.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`saveClinicalRoute.response.default.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`saveClinicalRoute.response.default.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`saveClinicalRoute.response.default.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`saveClinicalRoute.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` (`saveClinicalRoute.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` (`saveClinicalRoute.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` (`saveClinicalRoute.response.default.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`saveClinicalRoute.response.default.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`saveClinicalRoute.response.default.success`; boolean, required) — Always `false` in a failure envelope.
  - one of `false`


Source: https://docs.getarbol.com/api/ambar/save-clinical-route/index.md
