---
title: "Write how an indicator that moves money is measured, and its target"
---

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

# Write how an indicator that moves money is measured, and its target

Path: Ámbar API › Contract clauses

`POST /v1/contract-indicators/define-measure`

Writes the formula of one of a contract version's weighed indicators over the quantities Ámbar counts for a contract's month, whether more or less is better, the target that decides whether a month met it, and the passage of the execution guide or annex that sets them. An indicator is configuration: a ratio of two counts (the execution rate is `services` over `expected_services`; a complaint rate, `complaints` over `people_served` per thousand), the `average` or the `share_within` some days of the `order_to_service` span, or a plain `count`, each count narrowed by note line, procedure, complaint reason or channel. With it comes the indicator's technical sheet (Res. 2335 de 2023): its definition, numerator and denominator in words and their source, periodicity, baseline, goals, thresholds and who reports it, and the population it measures (members of cohorts, enrolled of programs; an age range or a sex is a cohort's criteria), which narrows every count of people of the measure. Until another person confirms it with `confirmContractIndicatorMeasure` the result is shown and moves no money (no retention released, no penalty escalated); until then you may write it again. A confirmed measure never changes: propose a new contract version.
Use it after `setContractIndicators`, with the guide at hand: an indicator the guide does not define yet is better left without a measure. `dryRun: true` checks everything and keeps nothing.
Changed on 22 October 2026: `sheet` is required (Res. 2335 de 2023 and Res. 256 de 2016 ask for the technical sheet), so a body that was accepted without it now fails with `INVALID_INPUT`; send the sheet with the measure.
Returns the measure, with its unit, and the `requestKey`.
Requires `ambar:contracts:read` and `ambar:contracts:write` and a write grant on the contract.
`INVALID_INPUT`: a malformed body, a filter that does not apply to its quantity or lists a value twice, a window outside 1 to 365 days, a target out of range, a missing source, or a sheet that is incomplete, states a denominator for a measure that is no ratio (or none for a ratio), has goals out of order or thresholds that repeat a label, is evaluated less often than the version lasts, or narrows to a population a measure that counts what the lines expect or complaints, which name nobody; fix it. `NOT_FOUND`: the version does not weigh the indicator. `CONFLICT`: the measure is confirmed with other terms. `ACCESS_DENIED`: missing scope or grant; do not retry.

## Authentication

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

## Request body

_Required._

- `contractId` (`defineContractIndicatorMeasure.contractId`; string, required) — The contract.
- `direction` (`defineContractIndicatorMeasure.direction`; string, required) — Whether a result above the target (`higher_is_better`) or below it (`lower_is_better`) meets it; a result on the target meets it.
  - one of `"higher_is_better"`, `"lower_is_better"`
- `indicatorId` (`defineContractIndicatorMeasure.indicatorId`; string, required) — One of the version's weighed indicators (`listContractIndicators`).
- `measure` (`defineContractIndicatorMeasure.measure`; IndicatorMeasure, required) — The formula, by `statistic`: `ratio` (a `numerator` count over a `denominator` count, `per` `percent` or `per_thousand`), `average` (of a `span`, in days), `share_within` (the percent of services whose `span` is within `days`, 1 to 365) or `count` (a `counted` count). A count names its `quantity` (`services`, `expected_services`, `people_served`, `population`, `complaints`) and may narrow it: `lines` and `procedures` for services and people served (`lines` alone for expected services), `reasons` and `channels` for complaints. Complaints count those that name the contract; `includeUnattributed: true` also counts those that name no contract by people it covered that day, when the guide counts every complaint of the contract's users. The only span is `order_to_service` (the days from the order the encounter names to the service; a service without one is set apart), narrowed by `services` (`lines`, `procedures`).
  - one of:
    - `object`
      - `denominator` (`defineContractIndicatorMeasure.measure.1.denominator`; object, required) — What it is counted against.
        - `quantity` (`defineContractIndicatorMeasure.measure.1.denominator.quantity`; string, required) — What is counted.
          - one of `"services"`, `"expected_services"`, `"people_served"`, `"population"`, `"complaints"`
        - `channels` (`defineContractIndicatorMeasure.measure.1.denominator.channels`; array<string>, optional) — Only complaints filed by these channels.
          - one of `"in_person"`, `"suggestion_box"`, `"phone"`, `"whatsapp"`, `"email"`, `"web"`, `"payer"`, `"regulator"`, `"other"`
        - `includeUnattributed` (`defineContractIndicatorMeasure.measure.1.denominator.includeUnattributed`; boolean, optional) — For complaints: also those that name no contract, by people the contract covered the day they filed them, as the execution guide counts "the complaints of the contract's users"; `false` counts only those that name the contract.
        - `lines` (`defineContractIndicatorMeasure.measure.1.denominator.lines`; array<string>, optional) — Only these technical-note lines: for services, expected services and people served.
        - `procedures` (`defineContractIndicatorMeasure.measure.1.denominator.procedures`; array<string>, optional) — Only these procedures: for services and people served.
        - `reasons` (`defineContractIndicatorMeasure.measure.1.denominator.reasons`; array<string>, optional) — Only complaints for these reasons.
          - one of `"waiting_time"`, `"access_denied"`, `"scheduling"`, `"staff_treatment"`, `"care_quality"`, `"information"`, `"facilities"`, `"medication"`, `"charges"`, `"privacy"`, `"other"`
      - `numerator` (`defineContractIndicatorMeasure.measure.1.numerator`; object, required) — What is counted above.
        - `quantity` (`defineContractIndicatorMeasure.measure.1.numerator.quantity`; string, required) — What is counted.
          - one of `"services"`, `"expected_services"`, `"people_served"`, `"population"`, `"complaints"`
        - `channels` (`defineContractIndicatorMeasure.measure.1.numerator.channels`; array<string>, optional) — Only complaints filed by these channels.
          - one of `"in_person"`, `"suggestion_box"`, `"phone"`, `"whatsapp"`, `"email"`, `"web"`, `"payer"`, `"regulator"`, `"other"`
        - `includeUnattributed` (`defineContractIndicatorMeasure.measure.1.numerator.includeUnattributed`; boolean, optional) — For complaints: also those that name no contract, by people the contract covered the day they filed them, as the execution guide counts "the complaints of the contract's users"; `false` counts only those that name the contract.
        - `lines` (`defineContractIndicatorMeasure.measure.1.numerator.lines`; array<string>, optional) — Only these technical-note lines: for services, expected services and people served.
        - `procedures` (`defineContractIndicatorMeasure.measure.1.numerator.procedures`; array<string>, optional) — Only these procedures: for services and people served.
        - `reasons` (`defineContractIndicatorMeasure.measure.1.numerator.reasons`; array<string>, optional) — Only complaints for these reasons.
          - one of `"waiting_time"`, `"access_denied"`, `"scheduling"`, `"staff_treatment"`, `"care_quality"`, `"information"`, `"facilities"`, `"medication"`, `"charges"`, `"privacy"`, `"other"`
      - `per` (`defineContractIndicatorMeasure.measure.1.per`; string, required) — Per hundred (a percent) or per thousand.
        - one of `"percent"`, `"per_thousand"`
      - `statistic` (`defineContractIndicatorMeasure.measure.1.statistic`; string, required)
        - one of `"ratio"`
    - `object`
      - `span` (`defineContractIndicatorMeasure.measure.2.span`; string, required) — The span measured.
        - one of `"order_to_service"`
      - `statistic` (`defineContractIndicatorMeasure.measure.2.statistic`; string, required)
        - one of `"average"`
      - `services` (`defineContractIndicatorMeasure.measure.2.services`; object, optional) — The services it is measured on.
        - `lines` (`defineContractIndicatorMeasure.measure.2.services.lines`; array<string>, optional) — Only these technical-note lines.
        - `procedures` (`defineContractIndicatorMeasure.measure.2.services.procedures`; array<string>, optional) — Only these procedures.
    - `object`
      - `days` (`defineContractIndicatorMeasure.measure.3.days`; integer, required) — The days allowed, 1 to 365.
        - format `int32`; min 0
      - `span` (`defineContractIndicatorMeasure.measure.3.span`; string, required) — The span measured.
        - one of `"order_to_service"`
      - `statistic` (`defineContractIndicatorMeasure.measure.3.statistic`; string, required)
        - one of `"share_within"`
      - `services` (`defineContractIndicatorMeasure.measure.3.services`; object, optional) — The services it is measured on.
        - `lines` (`defineContractIndicatorMeasure.measure.3.services.lines`; array<string>, optional) — Only these technical-note lines.
        - `procedures` (`defineContractIndicatorMeasure.measure.3.services.procedures`; array<string>, optional) — Only these procedures.
    - `object`
      - `counted` (`defineContractIndicatorMeasure.measure.4.counted`; object, required) — What is counted.
        - `quantity` (`defineContractIndicatorMeasure.measure.4.counted.quantity`; string, required) — What is counted.
          - one of `"services"`, `"expected_services"`, `"people_served"`, `"population"`, `"complaints"`
        - `channels` (`defineContractIndicatorMeasure.measure.4.counted.channels`; array<string>, optional) — Only complaints filed by these channels.
          - one of `"in_person"`, `"suggestion_box"`, `"phone"`, `"whatsapp"`, `"email"`, `"web"`, `"payer"`, `"regulator"`, `"other"`
        - `includeUnattributed` (`defineContractIndicatorMeasure.measure.4.counted.includeUnattributed`; boolean, optional) — For complaints: also those that name no contract, by people the contract covered the day they filed them, as the execution guide counts "the complaints of the contract's users"; `false` counts only those that name the contract.
        - `lines` (`defineContractIndicatorMeasure.measure.4.counted.lines`; array<string>, optional) — Only these technical-note lines: for services, expected services and people served.
        - `procedures` (`defineContractIndicatorMeasure.measure.4.counted.procedures`; array<string>, optional) — Only these procedures: for services and people served.
        - `reasons` (`defineContractIndicatorMeasure.measure.4.counted.reasons`; array<string>, optional) — Only complaints for these reasons.
          - one of `"waiting_time"`, `"access_denied"`, `"scheduling"`, `"staff_treatment"`, `"care_quality"`, `"information"`, `"facilities"`, `"medication"`, `"charges"`, `"privacy"`, `"other"`
      - `statistic` (`defineContractIndicatorMeasure.measure.4.statistic`; string, required)
        - one of `"count"`
- `requestKey` (`defineContractIndicatorMeasure.requestKey`; string, required) — Idempotency key: 32 lowercase hexadecimal characters, returned in the answer. Writing the same measure again returns it.
- `sheet` (`defineContractIndicatorMeasure.sheet`; object, required) — The indicator's technical sheet (Res. 2335 de 2023, in the style of the sheets of Res. 256 de 2016): its name and definition, what the numerator and, for a ratio, the denominator count and where they come from, how often it is evaluated (never longer than the version), what it follows, its baseline, its goals by month (1 to 12), its thresholds or ranges (1 to 6), who reports it, and the population it measures (the members of some cohorts, the enrolled of some programs; an age range or a sex is a cohort's criteria; empty for everyone), which narrows every count of people of the measure. Required since 22 October 2026: a body without it fails.
  - `baseline` (`defineContractIndicatorMeasure.sheet.baseline`; object, required) — Its value when the contract started.
    - `measuredOn` (`defineContractIndicatorMeasure.sheet.baseline.measuredOn`; string, required) — The day it was measured on.
      - format `date`
    - `source` (`defineContractIndicatorMeasure.sheet.baseline.source`; string, required) — Where it comes from (1 to 500 characters), for example the payer's report of the previous agreement.
    - `valueHundredths` (`defineContractIndicatorMeasure.sheet.baseline.valueHundredths`; integer, required) — The value, in hundredths of the measure's unit (`8250` is 82.50 %).
      - format `int64`
  - `classification` (`defineContractIndicatorMeasure.sheet.classification`; string, required) — What it follows.
    - one of `"management"`, `"care_quality"`, `"health_outcome"`
  - `definition` (`defineContractIndicatorMeasure.sheet.definition`; string, required) — What it measures and why (1 to 2,000 characters).
  - `goals` (`defineContractIndicatorMeasure.sheet.goals`; array<object>, required) — Its goals, 1 to 12, by the month each applies from, in order.
    - `from` (`defineContractIndicatorMeasure.sheet.goals.from`; string, required) — The first month it applies to, `YYYY-MM`.
      - example `"2026-07"`
    - `valueHundredths` (`defineContractIndicatorMeasure.sheet.goals.valueHundredths`; integer, required) — The goal, in hundredths of the measure's unit.
      - format `int64`
  - `name` (`defineContractIndicatorMeasure.sheet.name`; string, required) — The indicator's name (1 to 200 characters).
  - `numerator` (`defineContractIndicatorMeasure.sheet.numerator`; string, required) — What the numerator counts, in words (1 to 1,000 characters).
  - `periodicity` (`defineContractIndicatorMeasure.sheet.periodicity`; string, required) — How often it is evaluated with the payer.
    - one of `"monthly"`, `"quarterly"`, `"semiannual"`, `"annual"`
  - `responsible` (`defineContractIndicatorMeasure.sheet.responsible`; string, required) — Who obtains, computes and reports it (1 to 200 characters).
  - `source` (`defineContractIndicatorMeasure.sheet.source`; string, required) — Where the numerator and the denominator come from (1 to 500 characters), for example `RIPS del contrato y archivo de población de la EPS`.
  - `thresholds` (`defineContractIndicatorMeasure.sheet.thresholds`; array<object>, required) — Its thresholds or ranges, 1 to 6, each label once.
    - `label` (`defineContractIndicatorMeasure.sheet.thresholds.label`; string, required) — What a result in the range means (1 to 80 characters), for example `Satisfactorio`.
    - `fromHundredths` (`defineContractIndicatorMeasure.sheet.thresholds.fromHundredths`; integer | null, optional) — The lowest result of the range, included, in hundredths of the unit; `null` when it has no floor.
      - format `int64`
    - `toHundredths` (`defineContractIndicatorMeasure.sheet.thresholds.toHundredths`; integer | null, optional) — The highest result of the range, excluded, in hundredths of the unit; `null` when it has no ceiling.
      - format `int64`
  - `denominator` (`defineContractIndicatorMeasure.sheet.denominator`; string | null, optional) — What the denominator counts, in words (1 to 1,000 characters): for a ratio, and only then.
  - `population` (`defineContractIndicatorMeasure.sheet.population`; object, optional) — Who it measures.
    - `cohorts` (`defineContractIndicatorMeasure.sheet.population.cohorts`; array<string>, optional) — Only the members of one of these cohorts, in its latest cut while its version is active: an age range and a sex are a cohort's criteria.
    - `programs` (`defineContractIndicatorMeasure.sheet.population.programs`; array<string>, optional) — Only the people enrolled in one of these programs while its version is active.
- `sourceRef` (`defineContractIndicatorMeasure.sourceRef`; string, required) — The passage of the execution guide or annex that sets the measure and the target: 1 to 512 characters.
- `targetHundredths` (`defineContractIndicatorMeasure.targetHundredths`; integer, required) — The target in hundredths of the formula's unit: a percent (`9000` is 90.00 %), per thousand, days (`500` is five days) or a count; 0 to 100,000,000.
  - format `int64`
- `versionId` (`defineContractIndicatorMeasure.versionId`; string, required) — The contract version that weighs the indicator.
- `dryRun` (`defineContractIndicatorMeasure.dryRun`; boolean, optional) — `true` checks and returns the result without keeping it; default `false`.

## Example request

```json
{
  "contractId": "pgp-imagenes-2026",
  "direction": "lower_is_better",
  "dryRun": false,
  "indicatorId": "complaint_rate",
  "measure": {
    "denominator": {
      "quantity": "people_served"
    },
    "numerator": {
      "quantity": "complaints",
      "reasons": [
        "waiting_time",
        "access_denied"
      ]
    },
    "per": "per_thousand",
    "statistic": "ratio"
  },
  "requestKey": "5e6f708192a3b4c5d6e7f8091a2b3c4d",
  "sheet": {
    "baseline": {
      "measuredOn": "2025-12-31",
      "source": "Informe de PQRS de 2025",
      "valueHundredths": 820
    },
    "classification": "care_quality",
    "definition": "Quejas por demora o negación del servicio por cada mil personas atendidas en el mes.",
    "denominator": "Personas atendidas en el mes",
    "goals": [
      {
        "from": "2026-01",
        "valueHundredths": 500
      }
    ],
    "name": "Tasa de quejas por acceso",
    "numerator": "Quejas del mes por demora o negación del servicio",
    "periodicity": "monthly",
    "population": {},
    "responsible": "Coordinación de atención al usuario",
    "source": "Registro de PQRS y RIPS del contrato",
    "thresholds": [
      {
        "fromHundredths": null,
        "label": "Satisfactorio",
        "toHundredths": 500
      }
    ]
  },
  "sourceRef": "Guía de ejecución, numeral 7.3",
  "targetHundredths": 500,
  "versionId": "pgp-imagenes-2026-v1"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://api-ambar.getarbol.com/v1/contract-indicators/define-measure \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "contractId": "pgp-imagenes-2026",
  "direction": "lower_is_better",
  "dryRun": false,
  "indicatorId": "complaint_rate",
  "measure": {
    "denominator": {
      "quantity": "people_served"
    },
    "numerator": {
      "quantity": "complaints",
      "reasons": [
        "waiting_time",
        "access_denied"
      ]
    },
    "per": "per_thousand",
    "statistic": "ratio"
  },
  "requestKey": "5e6f708192a3b4c5d6e7f8091a2b3c4d",
  "sheet": {
    "baseline": {
      "measuredOn": "2025-12-31",
      "source": "Informe de PQRS de 2025",
      "valueHundredths": 820
    },
    "classification": "care_quality",
    "definition": "Quejas por demora o negación del servicio por cada mil personas atendidas en el mes.",
    "denominator": "Personas atendidas en el mes",
    "goals": [
      {
        "from": "2026-01",
        "valueHundredths": 500
      }
    ],
    "name": "Tasa de quejas por acceso",
    "numerator": "Quejas del mes por demora o negación del servicio",
    "periodicity": "monthly",
    "population": {},
    "responsible": "Coordinación de atención al usuario",
    "source": "Registro de PQRS y RIPS del contrato",
    "thresholds": [
      {
        "fromHundredths": null,
        "label": "Satisfactorio",
        "toHundredths": 500
      }
    ]
  },
  "sourceRef": "Guía de ejecución, numeral 7.3",
  "targetHundredths": 500,
  "versionId": "pgp-imagenes-2026-v1"
}
'
```

### TypeScript

```typescript
const url = 'https://api-ambar.getarbol.com/v1/contract-indicators/define-measure';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    contractId: 'pgp-imagenes-2026',
    direction: 'lower_is_better',
    dryRun: false,
    indicatorId: 'complaint_rate',
    measure: {
      denominator: {quantity: 'people_served'},
      numerator: {quantity: 'complaints', reasons: ['waiting_time', 'access_denied']},
      per: 'per_thousand',
      statistic: 'ratio'
    },
    requestKey: '5e6f708192a3b4c5d6e7f8091a2b3c4d',
    sheet: {
      baseline: {
        measuredOn: '2025-12-31',
        source: 'Informe de PQRS de 2025',
        valueHundredths: 820
      },
      classification: 'care_quality',
      definition: 'Quejas por demora o negación del servicio por cada mil personas atendidas en el mes.',
      denominator: 'Personas atendidas en el mes',
      goals: [{from: '2026-01', valueHundredths: 500}],
      name: 'Tasa de quejas por acceso',
      numerator: 'Quejas del mes por demora o negación del servicio',
      periodicity: 'monthly',
      population: {},
      responsible: 'Coordinación de atención al usuario',
      source: 'Registro de PQRS y RIPS del contrato',
      thresholds: [{fromHundredths: null, label: 'Satisfactorio', toHundredths: 500}]
    },
    sourceRef: 'Guía de ejecución, numeral 7.3',
    targetHundredths: 500,
    versionId: 'pgp-imagenes-2026-v1'
  })
};

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/contract-indicators/define-measure"

payload = {
    "contractId": "pgp-imagenes-2026",
    "direction": "lower_is_better",
    "dryRun": False,
    "indicatorId": "complaint_rate",
    "measure": {
        "denominator": { "quantity": "people_served" },
        "numerator": {
            "quantity": "complaints",
            "reasons": ["waiting_time", "access_denied"]
        },
        "per": "per_thousand",
        "statistic": "ratio"
    },
    "requestKey": "5e6f708192a3b4c5d6e7f8091a2b3c4d",
    "sheet": {
        "baseline": {
            "measuredOn": "2025-12-31",
            "source": "Informe de PQRS de 2025",
            "valueHundredths": 820
        },
        "classification": "care_quality",
        "definition": "Quejas por demora o negación del servicio por cada mil personas atendidas en el mes.",
        "denominator": "Personas atendidas en el mes",
        "goals": [
            {
                "from": "2026-01",
                "valueHundredths": 500
            }
        ],
        "name": "Tasa de quejas por acceso",
        "numerator": "Quejas del mes por demora o negación del servicio",
        "periodicity": "monthly",
        "population": {},
        "responsible": "Coordinación de atención al usuario",
        "source": "Registro de PQRS y RIPS del contrato",
        "thresholds": [
            {
                "fromHundredths": None,
                "label": "Satisfactorio",
                "toHundredths": 500
            }
        ]
    },
    "sourceRef": "Guía de ejecución, numeral 7.3",
    "targetHundredths": 500,
    "versionId": "pgp-imagenes-2026-v1"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

#### Example

```json
{
  "data": {
    "dryRun": false,
    "measure": {
      "confirmedAt": null,
      "confirmedBy": null,
      "decidesMonths": false,
      "definedBy": "actor_analyst",
      "direction": "lower_is_better",
      "indicatorId": "diagnostic_timeliness",
      "measure": {
        "span": "order_to_service",
        "statistic": "average"
      },
      "sheet": null,
      "sourceRef": "Guía de ejecución, numeral 7.2",
      "targetHundredths": 500,
      "unit": "days"
    },
    "requestKey": "0123456789abcdef0123456789abcdef"
  },
  "metadata": {
    "requestId": "request_01"
  },
  "success": true
}
```

- `data` (`defineContractIndicatorMeasure.response.200.data`; object, required) — An indicator's measure after a change.
  - `dryRun` (`defineContractIndicatorMeasure.response.200.data.dryRun`; boolean, required) — `true` when nothing was kept.
  - `measure` (`defineContractIndicatorMeasure.response.200.data.measure`; object, required) — The measure as kept (or as it would be, for a dry run).
    - example `{"confirmedAt":null,"confirmedBy":null,"decidesMonths":false,"definedBy":"actor_analyst","direction":"lower_is_better","indicatorId":"diagnostic_timeliness","measure":{"span":"order_to_service","statistic":"average"},"sheet":null,"sourceRef":"Guía de ejecución, numeral 7.2","targetHundredths":500,"unit":"days"}`
    - `decidesMonths` (`defineContractIndicatorMeasure.response.200.data.measure.decidesMonths`; boolean, required) — Whether a month's result decides if the indicator was met, which moves money; until another person confirms the measure, the result is only shown.
    - `definedBy` (`defineContractIndicatorMeasure.response.200.data.measure.definedBy`; string, required) — Who wrote them.
    - `direction` (`defineContractIndicatorMeasure.response.200.data.measure.direction`; string, required) — Whether a result above the target (`higher_is_better`) or below it (`lower_is_better`) meets it; a result on the target meets it.
      - one of `"higher_is_better"`, `"lower_is_better"`
    - `indicatorId` (`defineContractIndicatorMeasure.response.200.data.measure.indicatorId`; string, required) — The indicator.
    - `measure` (`defineContractIndicatorMeasure.response.200.data.measure.measure`; IndicatorMeasure, required) — Its formula over the month's quantities.
      - one of:
        - `object`
          - `denominator` (`defineContractIndicatorMeasure.response.200.data.measure.measure.1.denominator`; object, required) — What it is counted against.
            - `quantity` (`defineContractIndicatorMeasure.response.200.data.measure.measure.1.denominator.quantity`; string, required) — What is counted.
              - one of `"services"`, `"expected_services"`, `"people_served"`, `"population"`, `"complaints"`
            - `channels` (`defineContractIndicatorMeasure.response.200.data.measure.measure.1.denominator.channels`; array<string>, optional) — Only complaints filed by these channels.
              - one of `"in_person"`, `"suggestion_box"`, `"phone"`, `"whatsapp"`, `"email"`, `"web"`, `"payer"`, `"regulator"`, `"other"`
            - `includeUnattributed` (`defineContractIndicatorMeasure.response.200.data.measure.measure.1.denominator.includeUnattributed`; boolean, optional) — For complaints: also those that name no contract, by people the contract covered the day they filed them, as the execution guide counts "the complaints of the contract's users"; `false` counts only those that name the contract.
            - `lines` (`defineContractIndicatorMeasure.response.200.data.measure.measure.1.denominator.lines`; array<string>, optional) — Only these technical-note lines: for services, expected services and people served.
            - `procedures` (`defineContractIndicatorMeasure.response.200.data.measure.measure.1.denominator.procedures`; array<string>, optional) — Only these procedures: for services and people served.
            - `reasons` (`defineContractIndicatorMeasure.response.200.data.measure.measure.1.denominator.reasons`; array<string>, optional) — Only complaints for these reasons.
              - one of `"waiting_time"`, `"access_denied"`, `"scheduling"`, `"staff_treatment"`, `"care_quality"`, `"information"`, `"facilities"`, `"medication"`, `"charges"`, `"privacy"`, `"other"`
          - `numerator` (`defineContractIndicatorMeasure.response.200.data.measure.measure.1.numerator`; object, required) — What is counted above.
            - `quantity` (`defineContractIndicatorMeasure.response.200.data.measure.measure.1.numerator.quantity`; string, required) — What is counted.
              - one of `"services"`, `"expected_services"`, `"people_served"`, `"population"`, `"complaints"`
            - `channels` (`defineContractIndicatorMeasure.response.200.data.measure.measure.1.numerator.channels`; array<string>, optional) — Only complaints filed by these channels.
              - one of `"in_person"`, `"suggestion_box"`, `"phone"`, `"whatsapp"`, `"email"`, `"web"`, `"payer"`, `"regulator"`, `"other"`
            - `includeUnattributed` (`defineContractIndicatorMeasure.response.200.data.measure.measure.1.numerator.includeUnattributed`; boolean, optional) — For complaints: also those that name no contract, by people the contract covered the day they filed them, as the execution guide counts "the complaints of the contract's users"; `false` counts only those that name the contract.
            - `lines` (`defineContractIndicatorMeasure.response.200.data.measure.measure.1.numerator.lines`; array<string>, optional) — Only these technical-note lines: for services, expected services and people served.
            - `procedures` (`defineContractIndicatorMeasure.response.200.data.measure.measure.1.numerator.procedures`; array<string>, optional) — Only these procedures: for services and people served.
            - `reasons` (`defineContractIndicatorMeasure.response.200.data.measure.measure.1.numerator.reasons`; array<string>, optional) — Only complaints for these reasons.
              - one of `"waiting_time"`, `"access_denied"`, `"scheduling"`, `"staff_treatment"`, `"care_quality"`, `"information"`, `"facilities"`, `"medication"`, `"charges"`, `"privacy"`, `"other"`
          - `per` (`defineContractIndicatorMeasure.response.200.data.measure.measure.1.per`; string, required) — Per hundred (a percent) or per thousand.
            - one of `"percent"`, `"per_thousand"`
          - `statistic` (`defineContractIndicatorMeasure.response.200.data.measure.measure.1.statistic`; string, required)
            - one of `"ratio"`
        - `object`
          - `span` (`defineContractIndicatorMeasure.response.200.data.measure.measure.2.span`; string, required) — The span measured.
            - one of `"order_to_service"`
          - `statistic` (`defineContractIndicatorMeasure.response.200.data.measure.measure.2.statistic`; string, required)
            - one of `"average"`
          - `services` (`defineContractIndicatorMeasure.response.200.data.measure.measure.2.services`; object, optional) — The services it is measured on.
            - `lines` (`defineContractIndicatorMeasure.response.200.data.measure.measure.2.services.lines`; array<string>, optional) — Only these technical-note lines.
            - `procedures` (`defineContractIndicatorMeasure.response.200.data.measure.measure.2.services.procedures`; array<string>, optional) — Only these procedures.
        - `object`
          - `days` (`defineContractIndicatorMeasure.response.200.data.measure.measure.3.days`; integer, required) — The days allowed, 1 to 365.
            - format `int32`; min 0
          - `span` (`defineContractIndicatorMeasure.response.200.data.measure.measure.3.span`; string, required) — The span measured.
            - one of `"order_to_service"`
          - `statistic` (`defineContractIndicatorMeasure.response.200.data.measure.measure.3.statistic`; string, required)
            - one of `"share_within"`
          - `services` (`defineContractIndicatorMeasure.response.200.data.measure.measure.3.services`; object, optional) — The services it is measured on.
            - `lines` (`defineContractIndicatorMeasure.response.200.data.measure.measure.3.services.lines`; array<string>, optional) — Only these technical-note lines.
            - `procedures` (`defineContractIndicatorMeasure.response.200.data.measure.measure.3.services.procedures`; array<string>, optional) — Only these procedures.
        - `object`
          - `counted` (`defineContractIndicatorMeasure.response.200.data.measure.measure.4.counted`; object, required) — What is counted.
            - `quantity` (`defineContractIndicatorMeasure.response.200.data.measure.measure.4.counted.quantity`; string, required) — What is counted.
              - one of `"services"`, `"expected_services"`, `"people_served"`, `"population"`, `"complaints"`
            - `channels` (`defineContractIndicatorMeasure.response.200.data.measure.measure.4.counted.channels`; array<string>, optional) — Only complaints filed by these channels.
              - one of `"in_person"`, `"suggestion_box"`, `"phone"`, `"whatsapp"`, `"email"`, `"web"`, `"payer"`, `"regulator"`, `"other"`
            - `includeUnattributed` (`defineContractIndicatorMeasure.response.200.data.measure.measure.4.counted.includeUnattributed`; boolean, optional) — For complaints: also those that name no contract, by people the contract covered the day they filed them, as the execution guide counts "the complaints of the contract's users"; `false` counts only those that name the contract.
            - `lines` (`defineContractIndicatorMeasure.response.200.data.measure.measure.4.counted.lines`; array<string>, optional) — Only these technical-note lines: for services, expected services and people served.
            - `procedures` (`defineContractIndicatorMeasure.response.200.data.measure.measure.4.counted.procedures`; array<string>, optional) — Only these procedures: for services and people served.
            - `reasons` (`defineContractIndicatorMeasure.response.200.data.measure.measure.4.counted.reasons`; array<string>, optional) — Only complaints for these reasons.
              - one of `"waiting_time"`, `"access_denied"`, `"scheduling"`, `"staff_treatment"`, `"care_quality"`, `"information"`, `"facilities"`, `"medication"`, `"charges"`, `"privacy"`, `"other"`
          - `statistic` (`defineContractIndicatorMeasure.response.200.data.measure.measure.4.statistic`; string, required)
            - one of `"count"`
    - `sheet` (`defineContractIndicatorMeasure.response.200.data.measure.sheet`; one of, required)
      - one of: `IndicatorSheet`, `null`
    - `sourceRef` (`defineContractIndicatorMeasure.response.200.data.measure.sourceRef`; string, required) — The passage of the execution guide or annex that sets them.
    - `targetHundredths` (`defineContractIndicatorMeasure.response.200.data.measure.targetHundredths`; integer, required) — The target in hundredths of the unit.
      - format `int64`
    - `unit` (`defineContractIndicatorMeasure.response.200.data.measure.unit`; string, required) — The unit of its results and target: `percent`, `per_thousand`, `days` or `count`.
      - one of `"percent"`, `"per_thousand"`, `"days"`, `"count"`
    - `confirmedAt` (`defineContractIndicatorMeasure.response.200.data.measure.confirmedAt`; string | null, optional) — When they were confirmed.
      - format `date-time`
    - `confirmedBy` (`defineContractIndicatorMeasure.response.200.data.measure.confirmedBy`; string | null, optional) — Who confirmed them; `null` while they decide nothing.
  - `requestKey` (`defineContractIndicatorMeasure.response.200.data.requestKey`; string, required) — The idempotency key of the request.
- `metadata` (`defineContractIndicatorMeasure.response.200.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`defineContractIndicatorMeasure.response.200.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.response.400.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.response.400.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`defineContractIndicatorMeasure.response.400.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`defineContractIndicatorMeasure.response.400.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`defineContractIndicatorMeasure.response.400.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.response.400.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`defineContractIndicatorMeasure.response.400.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.response.401.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.response.401.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`defineContractIndicatorMeasure.response.401.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`defineContractIndicatorMeasure.response.401.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`defineContractIndicatorMeasure.response.401.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.response.401.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`defineContractIndicatorMeasure.response.401.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.response.403.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.response.403.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`defineContractIndicatorMeasure.response.403.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`defineContractIndicatorMeasure.response.403.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`defineContractIndicatorMeasure.response.403.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.response.403.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`defineContractIndicatorMeasure.response.403.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.response.404.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.response.404.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`defineContractIndicatorMeasure.response.404.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`defineContractIndicatorMeasure.response.404.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`defineContractIndicatorMeasure.response.404.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.response.404.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`defineContractIndicatorMeasure.response.404.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.response.409.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.response.409.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`defineContractIndicatorMeasure.response.409.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`defineContractIndicatorMeasure.response.409.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`defineContractIndicatorMeasure.response.409.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.response.409.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`defineContractIndicatorMeasure.response.409.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.response.413.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.response.413.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`defineContractIndicatorMeasure.response.413.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`defineContractIndicatorMeasure.response.413.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`defineContractIndicatorMeasure.response.413.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.response.413.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`defineContractIndicatorMeasure.response.413.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.response.422.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.response.422.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`defineContractIndicatorMeasure.response.422.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`defineContractIndicatorMeasure.response.422.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`defineContractIndicatorMeasure.response.422.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.response.422.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`defineContractIndicatorMeasure.response.422.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.response.500.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.response.500.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`defineContractIndicatorMeasure.response.500.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`defineContractIndicatorMeasure.response.500.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`defineContractIndicatorMeasure.response.500.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.response.500.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`defineContractIndicatorMeasure.response.500.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.response.503.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.response.503.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`defineContractIndicatorMeasure.response.503.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`defineContractIndicatorMeasure.response.503.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`defineContractIndicatorMeasure.response.503.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.response.503.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`defineContractIndicatorMeasure.response.503.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.response.default.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.response.default.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`defineContractIndicatorMeasure.response.default.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`defineContractIndicatorMeasure.response.default.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`defineContractIndicatorMeasure.response.default.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.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` (`defineContractIndicatorMeasure.response.default.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`defineContractIndicatorMeasure.response.default.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`defineContractIndicatorMeasure.response.default.success`; boolean, required) — Always `false` in a failure envelope.
  - one of `false`


Source: https://docs.getarbol.com/api/ambar/define-contract-indicator-measure/index.md
