---
title: "Save a cohort workspace"
---

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

# Save a cohort workspace

Path: Ámbar API › Cohorts

`POST /v1/cohort-workspaces/save`

Creates (`expectedVersion` `0`, status `draft`) or updates a cohort together with its review policy in one step.
The cohort definition becomes `curated`: patients join only through decideCohortPatient or a population import. Use createCohort or updateCohort for cohorts without a policy.
Returns the saved cohort with its policy, `policyVersion` (the new `version`), latest snapshot and counts.
Idempotency: the same `requestKey` with the same body returns the original result; a different body with that key fails with IDEMPOTENCY_CONFLICT.
Errors: CONFLICT when the id exists on create, `expectedVersion` is stale or a retired cohort would leave `retired`: re-read with getCohortPolicy; INVALID_INPUT for an invalid policy or fields.
ACCESS_DENIED without the cohort write and approve grants or as a non-human caller; COMMIT_UNCERTAIN: retry with the same `requestKey` before doing anything else.

## Authentication

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

## Request body

_Required._

- `expectedVersion` (`saveCohortWorkspace.expectedVersion`; string, required) — `0` to create the cohort (then `status` must be `draft`); otherwise its current `version`.
- `id` (`saveCohortWorkspace.id`; string, required) — Cohort identifier: a lowercase letter, then lowercase letters, digits, `_` or `-` (max 128).
- `policy` (`saveCohortWorkspace.policy`; object, required) — Review policy. The cohort definition becomes `curated`: members join only by decisions.
  - `confirmation` (`saveCohortWorkspace.policy.confirmation`; string, required) — Review mode declared by the author.
    - one of `"automatic"`, `"nurse"`
  - `rules` (`saveCohortWorkspace.policy.rules`; array<object>, required) — 1-20 rules.
    - `diagnosisPrefixes` (`saveCohortWorkspace.policy.rules.diagnosisPrefixes`; array<string>, required) — Up to 100 unique ICD-10 prefixes (1-20 characters, dots ignored) matched against accepted diagnosis evidence.
    - `diagnosisRanges` (`saveCohortWorkspace.policy.rules.diagnosisRanges`; array<object>, required) — Up to 50 ICD-10 ranges. Prefixes and ranges together match when any one matches, or when all do if `requiresAll` is `true`.
      - `from` (`saveCohortWorkspace.policy.rules.diagnosisRanges.from`; string, required) — First code of the range (1-20 characters), such as `I10`.
      - `to` (`saveCohortWorkspace.policy.rules.diagnosisRanges.to`; string, required) — Last code of the range (1-20 characters); must not sort before `from`.
    - `excludeDiagnosisCombinations` (`saveCohortWorkspace.policy.rules.excludeDiagnosisCombinations`; array<array<string>>, required) — Up to 50 sets of 2-10 ICD-10 prefixes; a patient with every prefix of one set does not match.
    - `excludeDiagnosisPrefixes` (`saveCohortWorkspace.policy.rules.excludeDiagnosisPrefixes`; array<string>, required) — Up to 100 unique ICD-10 prefixes; a patient with any of them does not match.
    - `interventions` (`saveCohortWorkspace.policy.rules.interventions`; array<object>, required) — Up to 10 procedure criteria.
      - `codes` (`saveCohortWorkspace.policy.rules.interventions.codes`; array<string>, required) — 1-50 unique selectors `SYSTEM:code` (`CUPS`, `SCT`, `ORG`, `AMBAR` or `LOINC`), each up to 80 characters; any of them qualifies.
      - `op` (`saveCohortWorkspace.policy.rules.interventions.op`; string, required) — Whether a qualifying procedure must exist or must not exist.
        - one of `"present"`, `"absent"`
      - `source` (`saveCohortWorkspace.policy.rules.interventions.source`; object, required) — Documentary source of this criterion; unless it is approved, the criterion is `unknown`.
        - `document` (`saveCohortWorkspace.policy.rules.interventions.source.document`; string, required) — Title of the source document (1-240 characters).
        - `locator` (`saveCohortWorkspace.policy.rules.interventions.source.locator`; string, required) — Where the criterion is in the document, such as a section (1-240 characters).
        - `status` (`saveCohortWorkspace.policy.rules.interventions.source.status`; string, required) — Review status of the source.
          - one of `"draft"`, `"approved"`
        - `version` (`saveCohortWorkspace.policy.rules.interventions.source.version`; string, required) — Edition of the source document (1-120 characters).
        - `reviewedAt` (`saveCohortWorkspace.policy.rules.interventions.source.reviewedAt`; string | null, optional) — When a person reviewed the source (RFC 3339); required when `approved`.
        - `reviewedBy` (`saveCohortWorkspace.policy.rules.interventions.source.reviewedBy`; string | null, optional) — Who reviewed the source (1-120 characters); required when `approved`.
        - `sha256` (`saveCohortWorkspace.policy.rules.interventions.source.sha256`; string | null, optional) — SHA-256 of the source document (64 lowercase hexadecimal characters); `null` if not given.
      - `withinDays` (`saveCohortWorkspace.policy.rules.interventions.withinDays`; integer | null, optional) — Only records from the last N days count (1-3650); `null` means any time.
        - format `int32`; min 0
    - `manual` (`saveCohortWorkspace.policy.rules.manual`; boolean, required) — `true` when membership needs an institutional roster record for this cohort or an explicit admission by a person (as in a population import).
    - `medications` (`saveCohortWorkspace.policy.rules.medications`; array<object>, required) — Up to 10 medication criteria.
      - `codes` (`saveCohortWorkspace.policy.rules.medications.codes`; array<string>, required) — 1-50 unique ATC codes or prefixes, optionally written `ATC:C09`; any of them qualifies.
      - `event` (`saveCohortWorkspace.policy.rules.medications.event`; string, required) — Kind of medication record that counts.
        - one of `"prescribed"`, `"dispensed"`, `"documented_change"`
      - `op` (`saveCohortWorkspace.policy.rules.medications.op`; string, required) — Whether a qualifying record must exist or must not exist.
        - one of `"present"`, `"absent"`
      - `source` (`saveCohortWorkspace.policy.rules.medications.source`; object, required) — Documentary source of this criterion; unless it is approved, the criterion is `unknown`.
        - `document` (`saveCohortWorkspace.policy.rules.medications.source.document`; string, required) — Title of the source document (1-240 characters).
        - `locator` (`saveCohortWorkspace.policy.rules.medications.source.locator`; string, required) — Where the criterion is in the document, such as a section (1-240 characters).
        - `status` (`saveCohortWorkspace.policy.rules.medications.source.status`; string, required) — Review status of the source.
          - one of `"draft"`, `"approved"`
        - `version` (`saveCohortWorkspace.policy.rules.medications.source.version`; string, required) — Edition of the source document (1-120 characters).
        - `reviewedAt` (`saveCohortWorkspace.policy.rules.medications.source.reviewedAt`; string | null, optional) — When a person reviewed the source (RFC 3339); required when `approved`.
        - `reviewedBy` (`saveCohortWorkspace.policy.rules.medications.source.reviewedBy`; string | null, optional) — Who reviewed the source (1-120 characters); required when `approved`.
        - `sha256` (`saveCohortWorkspace.policy.rules.medications.source.sha256`; string | null, optional) — SHA-256 of the source document (64 lowercase hexadecimal characters); `null` if not given.
      - `actions` (`saveCohortWorkspace.policy.rules.medications.actions`; array | null, optional) — Changes that count (1-4); required when `event` is `documented_change`; `null` = any.
      - `sourceKinds` (`saveCohortWorkspace.policy.rules.medications.sourceKinds`; array | null, optional) — Record sources that count (1-4); required for `documented_change`; `null` = any. Patient reports never count.
      - `withinDays` (`saveCohortWorkspace.policy.rules.medications.withinDays`; integer | null, optional) — Only records from the last N days count (1-3650); `null` means any time.
        - format `int32`; min 0
    - `observations` (`saveCohortWorkspace.policy.rules.observations`; array<object>, required) — Up to 10 observation criteria.
      - `code` (`saveCohortWorkspace.policy.rules.observations.code`; string, required) — Observation selector `SYSTEM:code`, where SYSTEM is `LOINC`, `CUPS`, `SCT`, `ORG` or `AMBAR` (1-40 characters).
      - `count` (`saveCohortWorkspace.policy.rules.observations.count`; integer, required) — Observations needed (1-10, default 1). With 1, the latest observation in the window is compared; otherwise that many must meet the comparison.
        - format `int32`; min 0
      - `minSpacingDays` (`saveCohortWorkspace.policy.rules.observations.minSpacingDays`; integer, required) — Minimum days between counted observations when `count` is above 1 (0-3650).
        - format `int32`; min 0
      - `op` (`saveCohortWorkspace.policy.rules.observations.op`; string, required) — Comparison against `value`.
        - one of `"gte"`, `"gt"`, `"lte"`, `"lt"`, `"eq"`, `"missing"`
      - `source` (`saveCohortWorkspace.policy.rules.observations.source`; one of, optional)
        - one of: `PopulationRuleSource`, `null`
      - `unit` (`saveCohortWorkspace.policy.rules.observations.unit`; string | null, optional) — Unit the observations must use: `mmHg`, `%`, `mg/dL`, `mg/g`, `mg/24h`, `mL/min`, `g/dL`, `mEq/L`, `pg/mL`, `mg/L`, `mUI/L`, `kg`, `cm` or `kg/m2`. Required unless `op` is `missing`.
      - `value` (`saveCohortWorkspace.policy.rules.observations.value`; number | null, optional) — Threshold (finite number); required unless `op` is `missing`.
        - format `double`
      - `withinDays` (`saveCohortWorkspace.policy.rules.observations.withinDays`; integer | null, optional) — Only records from the last N days count (1-3650); `null` means any time.
        - format `int32`; min 0
    - `requiresAll` (`saveCohortWorkspace.policy.rules.requiresAll`; boolean, required) — `true` when every diagnosis prefix and range must match instead of any one.
    - `requiresCoverage` (`saveCohortWorkspace.policy.rules.requiresCoverage`; array<string>, required) — Up to 3 contract coverage flags the assignment must include; needs `portfolioId`.
      - one of `"dispensingIncluded"`, `"postDischargeManagement"`, `"renalReplacementModule"`
    - `longitudinalReview` (`saveCohortWorkspace.policy.rules.longitudinalReview`; one of, optional)
      - one of: `LongitudinalReview`, `null`
    - `maxAge` (`saveCohortWorkspace.policy.rules.maxAge`; integer | null, optional) — Maximum age in completed years (0-130, inclusive); `null` = no limit.
      - format `int32`; min 0
    - `minAge` (`saveCohortWorkspace.policy.rules.minAge`; integer | null, optional) — Minimum age in completed years (0-130, inclusive, at most `maxAge`); `null` = no limit.
      - format `int32`; min 0
    - `portfolioId` (`saveCohortWorkspace.policy.rules.portfolioId`; string | null, optional) — Contract the patient must be individually assigned to (1-128 characters); `null` = none. Required by `requiresCoverage` and `longitudinalReview`.
    - `sex` (`saveCohortWorkspace.policy.rules.sex`; one of, optional)
      - one of: `Sex`, `null`
  - `sensitivity` (`saveCohortWorkspace.policy.sensitivity`; string, required) — Sensitivity label.
    - one of `"standard"`, `"restricted"`
  - `sortOrder` (`saveCohortWorkspace.policy.sortOrder`; integer, required) — Display order hint (0-1000).
    - format `int32`; min 0
  - `medicalProposal` (`saveCohortWorkspace.policy.medicalProposal`; one of, optional)
    - one of: `MedicalProposal`, `null`
  - `terminologyReleases` (`saveCohortWorkspace.policy.terminologyReleases`; array<object>, optional) — Up to 32 unique code system editions. A coded fact used by a rule must come from a listed edition, otherwise that rule evaluates as `unknown`.
    - `system` (`saveCohortWorkspace.policy.terminologyReleases.system`; string, required) — Code system URI (1-200 characters).
    - `version` (`saveCohortWorkspace.policy.terminologyReleases.version`; string, required) — Edition of that code system (1-64 characters).
    - `units` (`saveCohortWorkspace.policy.terminologyReleases.units`; array | null, optional) — Up to 30 unique observation units accepted for this edition (same unit list as observation criteria); `null` = any unit.
  - `tiers` (`saveCohortWorkspace.policy.tiers`; object, optional) — Rules for the probability tiers below `confirmed` (`probable`, `possible` and `ruled_out`); `rules` decide `confirmed`. Absent when the policy only decides membership.
    - `possible` (`saveCohortWorkspace.policy.tiers.possible`; array<object>, required) — Up to 20 rules for `possible`: weak signals, such as one isolated high reading.
      - `diagnosisPrefixes` (`saveCohortWorkspace.policy.tiers.possible.diagnosisPrefixes`; array<string>, required) — Up to 100 unique ICD-10 prefixes (1-20 characters, dots ignored) matched against accepted diagnosis evidence.
      - `diagnosisRanges` (`saveCohortWorkspace.policy.tiers.possible.diagnosisRanges`; array<object>, required) — Up to 50 ICD-10 ranges. Prefixes and ranges together match when any one matches, or when all do if `requiresAll` is `true`.
        - `from` (`saveCohortWorkspace.policy.tiers.possible.diagnosisRanges.from`; string, required) — First code of the range (1-20 characters), such as `I10`.
        - `to` (`saveCohortWorkspace.policy.tiers.possible.diagnosisRanges.to`; string, required) — Last code of the range (1-20 characters); must not sort before `from`.
      - `excludeDiagnosisCombinations` (`saveCohortWorkspace.policy.tiers.possible.excludeDiagnosisCombinations`; array<array<string>>, required) — Up to 50 sets of 2-10 ICD-10 prefixes; a patient with every prefix of one set does not match.
      - `excludeDiagnosisPrefixes` (`saveCohortWorkspace.policy.tiers.possible.excludeDiagnosisPrefixes`; array<string>, required) — Up to 100 unique ICD-10 prefixes; a patient with any of them does not match.
      - `interventions` (`saveCohortWorkspace.policy.tiers.possible.interventions`; array<object>, required) — Up to 10 procedure criteria.
        - `codes` (`saveCohortWorkspace.policy.tiers.possible.interventions.codes`; array<string>, required) — 1-50 unique selectors `SYSTEM:code` (`CUPS`, `SCT`, `ORG`, `AMBAR` or `LOINC`), each up to 80 characters; any of them qualifies.
        - `op` (`saveCohortWorkspace.policy.tiers.possible.interventions.op`; string, required) — Whether a qualifying procedure must exist or must not exist.
          - one of `"present"`, `"absent"`
        - `source` (`saveCohortWorkspace.policy.tiers.possible.interventions.source`; object, required) — Documentary source of this criterion; unless it is approved, the criterion is `unknown`.
          - `document` (`saveCohortWorkspace.policy.tiers.possible.interventions.source.document`; string, required) — Title of the source document (1-240 characters).
          - `locator` (`saveCohortWorkspace.policy.tiers.possible.interventions.source.locator`; string, required) — Where the criterion is in the document, such as a section (1-240 characters).
          - `status` (`saveCohortWorkspace.policy.tiers.possible.interventions.source.status`; string, required) — Review status of the source.
            - one of `"draft"`, `"approved"`
          - `version` (`saveCohortWorkspace.policy.tiers.possible.interventions.source.version`; string, required) — Edition of the source document (1-120 characters).
          - `reviewedAt` (`saveCohortWorkspace.policy.tiers.possible.interventions.source.reviewedAt`; string | null, optional) — When a person reviewed the source (RFC 3339); required when `approved`.
          - `reviewedBy` (`saveCohortWorkspace.policy.tiers.possible.interventions.source.reviewedBy`; string | null, optional) — Who reviewed the source (1-120 characters); required when `approved`.
          - `sha256` (`saveCohortWorkspace.policy.tiers.possible.interventions.source.sha256`; string | null, optional) — SHA-256 of the source document (64 lowercase hexadecimal characters); `null` if not given.
        - `withinDays` (`saveCohortWorkspace.policy.tiers.possible.interventions.withinDays`; integer | null, optional) — Only records from the last N days count (1-3650); `null` means any time.
          - format `int32`; min 0
      - `manual` (`saveCohortWorkspace.policy.tiers.possible.manual`; boolean, required) — `true` when membership needs an institutional roster record for this cohort or an explicit admission by a person (as in a population import).
      - `medications` (`saveCohortWorkspace.policy.tiers.possible.medications`; array<object>, required) — Up to 10 medication criteria.
        - `codes` (`saveCohortWorkspace.policy.tiers.possible.medications.codes`; array<string>, required) — 1-50 unique ATC codes or prefixes, optionally written `ATC:C09`; any of them qualifies.
        - `event` (`saveCohortWorkspace.policy.tiers.possible.medications.event`; string, required) — Kind of medication record that counts.
          - one of `"prescribed"`, `"dispensed"`, `"documented_change"`
        - `op` (`saveCohortWorkspace.policy.tiers.possible.medications.op`; string, required) — Whether a qualifying record must exist or must not exist.
          - one of `"present"`, `"absent"`
        - `source` (`saveCohortWorkspace.policy.tiers.possible.medications.source`; object, required) — Documentary source of this criterion; unless it is approved, the criterion is `unknown`.
          - `document` (`saveCohortWorkspace.policy.tiers.possible.medications.source.document`; string, required) — Title of the source document (1-240 characters).
          - `locator` (`saveCohortWorkspace.policy.tiers.possible.medications.source.locator`; string, required) — Where the criterion is in the document, such as a section (1-240 characters).
          - `status` (`saveCohortWorkspace.policy.tiers.possible.medications.source.status`; string, required) — Review status of the source.
            - one of `"draft"`, `"approved"`
          - `version` (`saveCohortWorkspace.policy.tiers.possible.medications.source.version`; string, required) — Edition of the source document (1-120 characters).
          - `reviewedAt` (`saveCohortWorkspace.policy.tiers.possible.medications.source.reviewedAt`; string | null, optional) — When a person reviewed the source (RFC 3339); required when `approved`.
          - `reviewedBy` (`saveCohortWorkspace.policy.tiers.possible.medications.source.reviewedBy`; string | null, optional) — Who reviewed the source (1-120 characters); required when `approved`.
          - `sha256` (`saveCohortWorkspace.policy.tiers.possible.medications.source.sha256`; string | null, optional) — SHA-256 of the source document (64 lowercase hexadecimal characters); `null` if not given.
        - `actions` (`saveCohortWorkspace.policy.tiers.possible.medications.actions`; array | null, optional) — Changes that count (1-4); required when `event` is `documented_change`; `null` = any.
        - `sourceKinds` (`saveCohortWorkspace.policy.tiers.possible.medications.sourceKinds`; array | null, optional) — Record sources that count (1-4); required for `documented_change`; `null` = any. Patient reports never count.
        - `withinDays` (`saveCohortWorkspace.policy.tiers.possible.medications.withinDays`; integer | null, optional) — Only records from the last N days count (1-3650); `null` means any time.
          - format `int32`; min 0
      - `observations` (`saveCohortWorkspace.policy.tiers.possible.observations`; array<object>, required) — Up to 10 observation criteria.
        - `code` (`saveCohortWorkspace.policy.tiers.possible.observations.code`; string, required) — Observation selector `SYSTEM:code`, where SYSTEM is `LOINC`, `CUPS`, `SCT`, `ORG` or `AMBAR` (1-40 characters).
        - `count` (`saveCohortWorkspace.policy.tiers.possible.observations.count`; integer, required) — Observations needed (1-10, default 1). With 1, the latest observation in the window is compared; otherwise that many must meet the comparison.
          - format `int32`; min 0
        - `minSpacingDays` (`saveCohortWorkspace.policy.tiers.possible.observations.minSpacingDays`; integer, required) — Minimum days between counted observations when `count` is above 1 (0-3650).
          - format `int32`; min 0
        - `op` (`saveCohortWorkspace.policy.tiers.possible.observations.op`; string, required) — Comparison against `value`.
          - one of `"gte"`, `"gt"`, `"lte"`, `"lt"`, `"eq"`, `"missing"`
        - `source` (`saveCohortWorkspace.policy.tiers.possible.observations.source`; one of, optional)
          - one of: `PopulationRuleSource`, `null`
        - `unit` (`saveCohortWorkspace.policy.tiers.possible.observations.unit`; string | null, optional) — Unit the observations must use: `mmHg`, `%`, `mg/dL`, `mg/g`, `mg/24h`, `mL/min`, `g/dL`, `mEq/L`, `pg/mL`, `mg/L`, `mUI/L`, `kg`, `cm` or `kg/m2`. Required unless `op` is `missing`.
        - `value` (`saveCohortWorkspace.policy.tiers.possible.observations.value`; number | null, optional) — Threshold (finite number); required unless `op` is `missing`.
          - format `double`
        - `withinDays` (`saveCohortWorkspace.policy.tiers.possible.observations.withinDays`; integer | null, optional) — Only records from the last N days count (1-3650); `null` means any time.
          - format `int32`; min 0
      - `requiresAll` (`saveCohortWorkspace.policy.tiers.possible.requiresAll`; boolean, required) — `true` when every diagnosis prefix and range must match instead of any one.
      - `requiresCoverage` (`saveCohortWorkspace.policy.tiers.possible.requiresCoverage`; array<string>, required) — Up to 3 contract coverage flags the assignment must include; needs `portfolioId`.
        - one of `"dispensingIncluded"`, `"postDischargeManagement"`, `"renalReplacementModule"`
      - `longitudinalReview` (`saveCohortWorkspace.policy.tiers.possible.longitudinalReview`; one of, optional)
        - one of: `LongitudinalReview`, `null`
      - `maxAge` (`saveCohortWorkspace.policy.tiers.possible.maxAge`; integer | null, optional) — Maximum age in completed years (0-130, inclusive); `null` = no limit.
        - format `int32`; min 0
      - `minAge` (`saveCohortWorkspace.policy.tiers.possible.minAge`; integer | null, optional) — Minimum age in completed years (0-130, inclusive, at most `maxAge`); `null` = no limit.
        - format `int32`; min 0
      - `portfolioId` (`saveCohortWorkspace.policy.tiers.possible.portfolioId`; string | null, optional) — Contract the patient must be individually assigned to (1-128 characters); `null` = none. Required by `requiresCoverage` and `longitudinalReview`.
      - `sex` (`saveCohortWorkspace.policy.tiers.possible.sex`; one of, optional)
        - one of: `Sex`, `null`
    - `probable` (`saveCohortWorkspace.policy.tiers.probable`; array<object>, required) — Up to 20 rules for `probable`: strong but incomplete evidence, such as two high blood pressure readings on different days without a recorded diagnosis.
      - `diagnosisPrefixes` (`saveCohortWorkspace.policy.tiers.probable.diagnosisPrefixes`; array<string>, required) — Up to 100 unique ICD-10 prefixes (1-20 characters, dots ignored) matched against accepted diagnosis evidence.
      - `diagnosisRanges` (`saveCohortWorkspace.policy.tiers.probable.diagnosisRanges`; array<object>, required) — Up to 50 ICD-10 ranges. Prefixes and ranges together match when any one matches, or when all do if `requiresAll` is `true`.
        - `from` (`saveCohortWorkspace.policy.tiers.probable.diagnosisRanges.from`; string, required) — First code of the range (1-20 characters), such as `I10`.
        - `to` (`saveCohortWorkspace.policy.tiers.probable.diagnosisRanges.to`; string, required) — Last code of the range (1-20 characters); must not sort before `from`.
      - `excludeDiagnosisCombinations` (`saveCohortWorkspace.policy.tiers.probable.excludeDiagnosisCombinations`; array<array<string>>, required) — Up to 50 sets of 2-10 ICD-10 prefixes; a patient with every prefix of one set does not match.
      - `excludeDiagnosisPrefixes` (`saveCohortWorkspace.policy.tiers.probable.excludeDiagnosisPrefixes`; array<string>, required) — Up to 100 unique ICD-10 prefixes; a patient with any of them does not match.
      - `interventions` (`saveCohortWorkspace.policy.tiers.probable.interventions`; array<object>, required) — Up to 10 procedure criteria.
        - `codes` (`saveCohortWorkspace.policy.tiers.probable.interventions.codes`; array<string>, required) — 1-50 unique selectors `SYSTEM:code` (`CUPS`, `SCT`, `ORG`, `AMBAR` or `LOINC`), each up to 80 characters; any of them qualifies.
        - `op` (`saveCohortWorkspace.policy.tiers.probable.interventions.op`; string, required) — Whether a qualifying procedure must exist or must not exist.
          - one of `"present"`, `"absent"`
        - `source` (`saveCohortWorkspace.policy.tiers.probable.interventions.source`; object, required) — Documentary source of this criterion; unless it is approved, the criterion is `unknown`.
          - `document` (`saveCohortWorkspace.policy.tiers.probable.interventions.source.document`; string, required) — Title of the source document (1-240 characters).
          - `locator` (`saveCohortWorkspace.policy.tiers.probable.interventions.source.locator`; string, required) — Where the criterion is in the document, such as a section (1-240 characters).
          - `status` (`saveCohortWorkspace.policy.tiers.probable.interventions.source.status`; string, required) — Review status of the source.
            - one of `"draft"`, `"approved"`
          - `version` (`saveCohortWorkspace.policy.tiers.probable.interventions.source.version`; string, required) — Edition of the source document (1-120 characters).
          - `reviewedAt` (`saveCohortWorkspace.policy.tiers.probable.interventions.source.reviewedAt`; string | null, optional) — When a person reviewed the source (RFC 3339); required when `approved`.
          - `reviewedBy` (`saveCohortWorkspace.policy.tiers.probable.interventions.source.reviewedBy`; string | null, optional) — Who reviewed the source (1-120 characters); required when `approved`.
          - `sha256` (`saveCohortWorkspace.policy.tiers.probable.interventions.source.sha256`; string | null, optional) — SHA-256 of the source document (64 lowercase hexadecimal characters); `null` if not given.
        - `withinDays` (`saveCohortWorkspace.policy.tiers.probable.interventions.withinDays`; integer | null, optional) — Only records from the last N days count (1-3650); `null` means any time.
          - format `int32`; min 0
      - `manual` (`saveCohortWorkspace.policy.tiers.probable.manual`; boolean, required) — `true` when membership needs an institutional roster record for this cohort or an explicit admission by a person (as in a population import).
      - `medications` (`saveCohortWorkspace.policy.tiers.probable.medications`; array<object>, required) — Up to 10 medication criteria.
        - `codes` (`saveCohortWorkspace.policy.tiers.probable.medications.codes`; array<string>, required) — 1-50 unique ATC codes or prefixes, optionally written `ATC:C09`; any of them qualifies.
        - `event` (`saveCohortWorkspace.policy.tiers.probable.medications.event`; string, required) — Kind of medication record that counts.
          - one of `"prescribed"`, `"dispensed"`, `"documented_change"`
        - `op` (`saveCohortWorkspace.policy.tiers.probable.medications.op`; string, required) — Whether a qualifying record must exist or must not exist.
          - one of `"present"`, `"absent"`
        - `source` (`saveCohortWorkspace.policy.tiers.probable.medications.source`; object, required) — Documentary source of this criterion; unless it is approved, the criterion is `unknown`.
          - `document` (`saveCohortWorkspace.policy.tiers.probable.medications.source.document`; string, required) — Title of the source document (1-240 characters).
          - `locator` (`saveCohortWorkspace.policy.tiers.probable.medications.source.locator`; string, required) — Where the criterion is in the document, such as a section (1-240 characters).
          - `status` (`saveCohortWorkspace.policy.tiers.probable.medications.source.status`; string, required) — Review status of the source.
            - one of `"draft"`, `"approved"`
          - `version` (`saveCohortWorkspace.policy.tiers.probable.medications.source.version`; string, required) — Edition of the source document (1-120 characters).
          - `reviewedAt` (`saveCohortWorkspace.policy.tiers.probable.medications.source.reviewedAt`; string | null, optional) — When a person reviewed the source (RFC 3339); required when `approved`.
          - `reviewedBy` (`saveCohortWorkspace.policy.tiers.probable.medications.source.reviewedBy`; string | null, optional) — Who reviewed the source (1-120 characters); required when `approved`.
          - `sha256` (`saveCohortWorkspace.policy.tiers.probable.medications.source.sha256`; string | null, optional) — SHA-256 of the source document (64 lowercase hexadecimal characters); `null` if not given.
        - `actions` (`saveCohortWorkspace.policy.tiers.probable.medications.actions`; array | null, optional) — Changes that count (1-4); required when `event` is `documented_change`; `null` = any.
        - `sourceKinds` (`saveCohortWorkspace.policy.tiers.probable.medications.sourceKinds`; array | null, optional) — Record sources that count (1-4); required for `documented_change`; `null` = any. Patient reports never count.
        - `withinDays` (`saveCohortWorkspace.policy.tiers.probable.medications.withinDays`; integer | null, optional) — Only records from the last N days count (1-3650); `null` means any time.
          - format `int32`; min 0
      - `observations` (`saveCohortWorkspace.policy.tiers.probable.observations`; array<object>, required) — Up to 10 observation criteria.
        - `code` (`saveCohortWorkspace.policy.tiers.probable.observations.code`; string, required) — Observation selector `SYSTEM:code`, where SYSTEM is `LOINC`, `CUPS`, `SCT`, `ORG` or `AMBAR` (1-40 characters).
        - `count` (`saveCohortWorkspace.policy.tiers.probable.observations.count`; integer, required) — Observations needed (1-10, default 1). With 1, the latest observation in the window is compared; otherwise that many must meet the comparison.
          - format `int32`; min 0
        - `minSpacingDays` (`saveCohortWorkspace.policy.tiers.probable.observations.minSpacingDays`; integer, required) — Minimum days between counted observations when `count` is above 1 (0-3650).
          - format `int32`; min 0
        - `op` (`saveCohortWorkspace.policy.tiers.probable.observations.op`; string, required) — Comparison against `value`.
          - one of `"gte"`, `"gt"`, `"lte"`, `"lt"`, `"eq"`, `"missing"`
        - `source` (`saveCohortWorkspace.policy.tiers.probable.observations.source`; one of, optional)
          - one of: `PopulationRuleSource`, `null`
        - `unit` (`saveCohortWorkspace.policy.tiers.probable.observations.unit`; string | null, optional) — Unit the observations must use: `mmHg`, `%`, `mg/dL`, `mg/g`, `mg/24h`, `mL/min`, `g/dL`, `mEq/L`, `pg/mL`, `mg/L`, `mUI/L`, `kg`, `cm` or `kg/m2`. Required unless `op` is `missing`.
        - `value` (`saveCohortWorkspace.policy.tiers.probable.observations.value`; number | null, optional) — Threshold (finite number); required unless `op` is `missing`.
          - format `double`
        - `withinDays` (`saveCohortWorkspace.policy.tiers.probable.observations.withinDays`; integer | null, optional) — Only records from the last N days count (1-3650); `null` means any time.
          - format `int32`; min 0
      - `requiresAll` (`saveCohortWorkspace.policy.tiers.probable.requiresAll`; boolean, required) — `true` when every diagnosis prefix and range must match instead of any one.
      - `requiresCoverage` (`saveCohortWorkspace.policy.tiers.probable.requiresCoverage`; array<string>, required) — Up to 3 contract coverage flags the assignment must include; needs `portfolioId`.
        - one of `"dispensingIncluded"`, `"postDischargeManagement"`, `"renalReplacementModule"`
      - `longitudinalReview` (`saveCohortWorkspace.policy.tiers.probable.longitudinalReview`; one of, optional)
        - one of: `LongitudinalReview`, `null`
      - `maxAge` (`saveCohortWorkspace.policy.tiers.probable.maxAge`; integer | null, optional) — Maximum age in completed years (0-130, inclusive); `null` = no limit.
        - format `int32`; min 0
      - `minAge` (`saveCohortWorkspace.policy.tiers.probable.minAge`; integer | null, optional) — Minimum age in completed years (0-130, inclusive, at most `maxAge`); `null` = no limit.
        - format `int32`; min 0
      - `portfolioId` (`saveCohortWorkspace.policy.tiers.probable.portfolioId`; string | null, optional) — Contract the patient must be individually assigned to (1-128 characters); `null` = none. Required by `requiresCoverage` and `longitudinalReview`.
      - `sex` (`saveCohortWorkspace.policy.tiers.probable.sex`; one of, optional)
        - one of: `Sex`, `null`
    - `ruledOut` (`saveCohortWorkspace.policy.tiers.ruledOut`; array<object>, required) — Up to 20 rules for `ruled_out`: the evidence says no, such as repeated normal readings without treatment. Absence counts only over a proven complete interval.
      - `diagnosisPrefixes` (`saveCohortWorkspace.policy.tiers.ruledOut.diagnosisPrefixes`; array<string>, required) — Up to 100 unique ICD-10 prefixes (1-20 characters, dots ignored) matched against accepted diagnosis evidence.
      - `diagnosisRanges` (`saveCohortWorkspace.policy.tiers.ruledOut.diagnosisRanges`; array<object>, required) — Up to 50 ICD-10 ranges. Prefixes and ranges together match when any one matches, or when all do if `requiresAll` is `true`.
        - `from` (`saveCohortWorkspace.policy.tiers.ruledOut.diagnosisRanges.from`; string, required) — First code of the range (1-20 characters), such as `I10`.
        - `to` (`saveCohortWorkspace.policy.tiers.ruledOut.diagnosisRanges.to`; string, required) — Last code of the range (1-20 characters); must not sort before `from`.
      - `excludeDiagnosisCombinations` (`saveCohortWorkspace.policy.tiers.ruledOut.excludeDiagnosisCombinations`; array<array<string>>, required) — Up to 50 sets of 2-10 ICD-10 prefixes; a patient with every prefix of one set does not match.
      - `excludeDiagnosisPrefixes` (`saveCohortWorkspace.policy.tiers.ruledOut.excludeDiagnosisPrefixes`; array<string>, required) — Up to 100 unique ICD-10 prefixes; a patient with any of them does not match.
      - `interventions` (`saveCohortWorkspace.policy.tiers.ruledOut.interventions`; array<object>, required) — Up to 10 procedure criteria.
        - `codes` (`saveCohortWorkspace.policy.tiers.ruledOut.interventions.codes`; array<string>, required) — 1-50 unique selectors `SYSTEM:code` (`CUPS`, `SCT`, `ORG`, `AMBAR` or `LOINC`), each up to 80 characters; any of them qualifies.
        - `op` (`saveCohortWorkspace.policy.tiers.ruledOut.interventions.op`; string, required) — Whether a qualifying procedure must exist or must not exist.
          - one of `"present"`, `"absent"`
        - `source` (`saveCohortWorkspace.policy.tiers.ruledOut.interventions.source`; object, required) — Documentary source of this criterion; unless it is approved, the criterion is `unknown`.
          - `document` (`saveCohortWorkspace.policy.tiers.ruledOut.interventions.source.document`; string, required) — Title of the source document (1-240 characters).
          - `locator` (`saveCohortWorkspace.policy.tiers.ruledOut.interventions.source.locator`; string, required) — Where the criterion is in the document, such as a section (1-240 characters).
          - `status` (`saveCohortWorkspace.policy.tiers.ruledOut.interventions.source.status`; string, required) — Review status of the source.
            - one of `"draft"`, `"approved"`
          - `version` (`saveCohortWorkspace.policy.tiers.ruledOut.interventions.source.version`; string, required) — Edition of the source document (1-120 characters).
          - `reviewedAt` (`saveCohortWorkspace.policy.tiers.ruledOut.interventions.source.reviewedAt`; string | null, optional) — When a person reviewed the source (RFC 3339); required when `approved`.
          - `reviewedBy` (`saveCohortWorkspace.policy.tiers.ruledOut.interventions.source.reviewedBy`; string | null, optional) — Who reviewed the source (1-120 characters); required when `approved`.
          - `sha256` (`saveCohortWorkspace.policy.tiers.ruledOut.interventions.source.sha256`; string | null, optional) — SHA-256 of the source document (64 lowercase hexadecimal characters); `null` if not given.
        - `withinDays` (`saveCohortWorkspace.policy.tiers.ruledOut.interventions.withinDays`; integer | null, optional) — Only records from the last N days count (1-3650); `null` means any time.
          - format `int32`; min 0
      - `manual` (`saveCohortWorkspace.policy.tiers.ruledOut.manual`; boolean, required) — `true` when membership needs an institutional roster record for this cohort or an explicit admission by a person (as in a population import).
      - `medications` (`saveCohortWorkspace.policy.tiers.ruledOut.medications`; array<object>, required) — Up to 10 medication criteria.
        - `codes` (`saveCohortWorkspace.policy.tiers.ruledOut.medications.codes`; array<string>, required) — 1-50 unique ATC codes or prefixes, optionally written `ATC:C09`; any of them qualifies.
        - `event` (`saveCohortWorkspace.policy.tiers.ruledOut.medications.event`; string, required) — Kind of medication record that counts.
          - one of `"prescribed"`, `"dispensed"`, `"documented_change"`
        - `op` (`saveCohortWorkspace.policy.tiers.ruledOut.medications.op`; string, required) — Whether a qualifying record must exist or must not exist.
          - one of `"present"`, `"absent"`
        - `source` (`saveCohortWorkspace.policy.tiers.ruledOut.medications.source`; object, required) — Documentary source of this criterion; unless it is approved, the criterion is `unknown`.
          - `document` (`saveCohortWorkspace.policy.tiers.ruledOut.medications.source.document`; string, required) — Title of the source document (1-240 characters).
          - `locator` (`saveCohortWorkspace.policy.tiers.ruledOut.medications.source.locator`; string, required) — Where the criterion is in the document, such as a section (1-240 characters).
          - `status` (`saveCohortWorkspace.policy.tiers.ruledOut.medications.source.status`; string, required) — Review status of the source.
            - one of `"draft"`, `"approved"`
          - `version` (`saveCohortWorkspace.policy.tiers.ruledOut.medications.source.version`; string, required) — Edition of the source document (1-120 characters).
          - `reviewedAt` (`saveCohortWorkspace.policy.tiers.ruledOut.medications.source.reviewedAt`; string | null, optional) — When a person reviewed the source (RFC 3339); required when `approved`.
          - `reviewedBy` (`saveCohortWorkspace.policy.tiers.ruledOut.medications.source.reviewedBy`; string | null, optional) — Who reviewed the source (1-120 characters); required when `approved`.
          - `sha256` (`saveCohortWorkspace.policy.tiers.ruledOut.medications.source.sha256`; string | null, optional) — SHA-256 of the source document (64 lowercase hexadecimal characters); `null` if not given.
        - `actions` (`saveCohortWorkspace.policy.tiers.ruledOut.medications.actions`; array | null, optional) — Changes that count (1-4); required when `event` is `documented_change`; `null` = any.
        - `sourceKinds` (`saveCohortWorkspace.policy.tiers.ruledOut.medications.sourceKinds`; array | null, optional) — Record sources that count (1-4); required for `documented_change`; `null` = any. Patient reports never count.
        - `withinDays` (`saveCohortWorkspace.policy.tiers.ruledOut.medications.withinDays`; integer | null, optional) — Only records from the last N days count (1-3650); `null` means any time.
          - format `int32`; min 0
      - `observations` (`saveCohortWorkspace.policy.tiers.ruledOut.observations`; array<object>, required) — Up to 10 observation criteria.
        - `code` (`saveCohortWorkspace.policy.tiers.ruledOut.observations.code`; string, required) — Observation selector `SYSTEM:code`, where SYSTEM is `LOINC`, `CUPS`, `SCT`, `ORG` or `AMBAR` (1-40 characters).
        - `count` (`saveCohortWorkspace.policy.tiers.ruledOut.observations.count`; integer, required) — Observations needed (1-10, default 1). With 1, the latest observation in the window is compared; otherwise that many must meet the comparison.
          - format `int32`; min 0
        - `minSpacingDays` (`saveCohortWorkspace.policy.tiers.ruledOut.observations.minSpacingDays`; integer, required) — Minimum days between counted observations when `count` is above 1 (0-3650).
          - format `int32`; min 0
        - `op` (`saveCohortWorkspace.policy.tiers.ruledOut.observations.op`; string, required) — Comparison against `value`.
          - one of `"gte"`, `"gt"`, `"lte"`, `"lt"`, `"eq"`, `"missing"`
        - `source` (`saveCohortWorkspace.policy.tiers.ruledOut.observations.source`; one of, optional)
          - one of: `PopulationRuleSource`, `null`
        - `unit` (`saveCohortWorkspace.policy.tiers.ruledOut.observations.unit`; string | null, optional) — Unit the observations must use: `mmHg`, `%`, `mg/dL`, `mg/g`, `mg/24h`, `mL/min`, `g/dL`, `mEq/L`, `pg/mL`, `mg/L`, `mUI/L`, `kg`, `cm` or `kg/m2`. Required unless `op` is `missing`.
        - `value` (`saveCohortWorkspace.policy.tiers.ruledOut.observations.value`; number | null, optional) — Threshold (finite number); required unless `op` is `missing`.
          - format `double`
        - `withinDays` (`saveCohortWorkspace.policy.tiers.ruledOut.observations.withinDays`; integer | null, optional) — Only records from the last N days count (1-3650); `null` means any time.
          - format `int32`; min 0
      - `requiresAll` (`saveCohortWorkspace.policy.tiers.ruledOut.requiresAll`; boolean, required) — `true` when every diagnosis prefix and range must match instead of any one.
      - `requiresCoverage` (`saveCohortWorkspace.policy.tiers.ruledOut.requiresCoverage`; array<string>, required) — Up to 3 contract coverage flags the assignment must include; needs `portfolioId`.
        - one of `"dispensingIncluded"`, `"postDischargeManagement"`, `"renalReplacementModule"`
      - `longitudinalReview` (`saveCohortWorkspace.policy.tiers.ruledOut.longitudinalReview`; one of, optional)
        - one of: `LongitudinalReview`, `null`
      - `maxAge` (`saveCohortWorkspace.policy.tiers.ruledOut.maxAge`; integer | null, optional) — Maximum age in completed years (0-130, inclusive); `null` = no limit.
        - format `int32`; min 0
      - `minAge` (`saveCohortWorkspace.policy.tiers.ruledOut.minAge`; integer | null, optional) — Minimum age in completed years (0-130, inclusive, at most `maxAge`); `null` = no limit.
        - format `int32`; min 0
      - `portfolioId` (`saveCohortWorkspace.policy.tiers.ruledOut.portfolioId`; string | null, optional) — Contract the patient must be individually assigned to (1-128 characters); `null` = none. Required by `requiresCoverage` and `longitudinalReview`.
      - `sex` (`saveCohortWorkspace.policy.tiers.ruledOut.sex`; one of, optional)
        - one of: `Sex`, `null`
- `requestKey` (`saveCohortWorkspace.requestKey`; string, required) — 32 lowercase hexadecimal characters; reuse it only to retry this exact request.
- `status` (`saveCohortWorkspace.status`; string, required) — Cohort status; `retired` is final.
  - one of `"draft"`, `"active"`, `"retired"`
- `title` (`saveCohortWorkspace.title`; string, required) — Display title (1-120 characters, no surrounding spaces or control characters).

## Example request

```json
{
  "expectedVersion": "1",
  "id": "example_01",
  "policy": {
    "confirmation": "automatic",
    "medicalProposal": {
      "activityCode": "example",
      "reason": "example"
    },
    "rules": [
      {
        "diagnosisPrefixes": [
          "example"
        ],
        "diagnosisRanges": [
          {
            "from": "example",
            "to": "example"
          }
        ],
        "excludeDiagnosisCombinations": [
          [
            "example"
          ]
        ],
        "excludeDiagnosisPrefixes": [
          "example"
        ],
        "interventions": [
          {
            "codes": [
              "example"
            ],
            "op": "present",
            "source": {
              "document": "example",
              "locator": "example",
              "reviewedAt": "2026-10-14T13:00:00Z",
              "reviewedBy": "example",
              "sha256": "0123456789abcdef0123456789abcdef",
              "status": "draft",
              "version": "1"
            },
            "withinDays": 0
          }
        ],
        "longitudinalReview": {
          "actions": [
            "start"
          ],
          "adjustmentSelection": "latest_two_distinct",
          "applicability": "example",
          "atc": "example",
          "observation": {
            "code": "example",
            "target": {
              "op": "gte",
              "value": 1
            },
            "unit": "example"
          },
          "responseWindow": {
            "maxDays": 0,
            "minDays": 0
          },
          "resultSelection": "latest_in_response_window",
          "reviewWindow": {
            "amount": 0,
            "unit": "days"
          },
          "source": {
            "document": "example",
            "locator": "example",
            "reviewedAt": "2026-10-14T13:00:00Z",
            "reviewedBy": "example",
            "sha256": "0123456789abcdef0123456789abcdef",
            "status": "draft",
            "version": "1"
          },
          "sourceId": "source_01",
          "sourceKinds": [
            "medical_record"
          ]
        },
        "manual": false,
        "maxAge": 0,
        "medications": [
          {
            "actions": [
              "start"
            ],
            "codes": [
              "example"
            ],
            "event": "prescribed",
            "op": "present",
            "source": {
              "document": "example",
              "locator": "example",
              "reviewedAt": "2026-10-14T13:00:00Z",
              "reviewedBy": "example",
              "sha256": "0123456789abcdef0123456789abcdef",
              "status": "draft",
              "version": "1"
            },
            "sourceKinds": [
              "medical_record"
            ],
            "withinDays": 0
          }
        ],
        "minAge": 0,
        "observations": [
          {
            "code": "example",
            "count": 0,
            "minSpacingDays": 0,
            "op": "gte",
            "source": {
              "document": "example",
              "locator": "example",
              "reviewedAt": "2026-10-14T13:00:00Z",
              "reviewedBy": "example",
              "sha256": "0123456789abcdef0123456789abcdef",
              "status": "draft",
              "version": "1"
            },
            "unit": "example",
            "value": 1,
            "withinDays": 0
          }
        ],
        "portfolioId": "portfolio_01",
        "requiresAll": false,
        "requiresCoverage": [
          "dispensingIncluded"
        ],
        "sex": "female"
      }
    ],
    "sensitivity": "standard",
    "sortOrder": 0,
    "terminologyReleases": [
      {
        "system": "example",
        "units": [
          "example"
        ],
        "version": "1"
      }
    ],
    "tiers": {
      "possible": [
        {
          "diagnosisPrefixes": [
            "example"
          ],
          "diagnosisRanges": [
            {
              "from": "example",
              "to": "example"
            }
          ],
          "excludeDiagnosisCombinations": [
            [
              "example"
            ]
          ],
          "excludeDiagnosisPrefixes": [
            "example"
          ],
          "interventions": [
            {
              "codes": [
                "example"
              ],
              "op": "present",
              "source": {
                "document": "example",
                "locator": "example",
                "reviewedAt": "2026-10-14T13:00:00Z",
                "reviewedBy": "example",
                "sha256": "0123456789abcdef0123456789abcdef",
                "status": "draft",
                "version": "1"
              },
              "withinDays": 0
            }
          ],
          "longitudinalReview": {
            "actions": [
              "start"
            ],
            "adjustmentSelection": "latest_two_distinct",
            "applicability": "example",
            "atc": "example",
            "observation": {
              "code": "example",
              "target": {
                "op": "gte",
                "value": 1
              },
              "unit": "example"
            },
            "responseWindow": {
              "maxDays": 0,
              "minDays": 0
            },
            "resultSelection": "latest_in_response_window",
            "reviewWindow": {
              "amount": 0,
              "unit": "days"
            },
            "source": {
              "document": "example",
              "locator": "example",
              "reviewedAt": "2026-10-14T13:00:00Z",
              "reviewedBy": "example",
              "sha256": "0123456789abcdef0123456789abcdef",
              "status": "draft",
              "version": "1"
            },
            "sourceId": "source_01",
            "sourceKinds": [
              "medical_record"
            ]
          },
          "manual": false,
          "maxAge": 0,
          "medications": [
            {
              "actions": [
                "start"
              ],
              "codes": [
                "example"
              ],
              "event": "prescribed",
              "op": "present",
              "source": {
                "document": "example",
                "locator": "example",
                "reviewedAt": "2026-10-14T13:00:00Z",
                "reviewedBy": "example",
                "sha256": "0123456789abcdef0123456789abcdef",
                "status": "draft",
                "version": "1"
              },
              "sourceKinds": [
                "medical_record"
              ],
              "withinDays": 0
            }
          ],
          "minAge": 0,
          "observations": [
            {
              "code": "example",
              "count": 0,
              "minSpacingDays": 0,
              "op": "gte",
              "source": {
                "document": "example",
                "locator": "example",
                "reviewedAt": "2026-10-14T13:00:00Z",
                "reviewedBy": "example",
                "sha256": "0123456789abcdef0123456789abcdef",
                "status": "draft",
                "version": "1"
              },
              "unit": "example",
              "value": 1,
              "withinDays": 0
            }
          ],
          "portfolioId": "portfolio_01",
          "requiresAll": false,
          "requiresCoverage": [
            "dispensingIncluded"
          ],
          "sex": "female"
        }
      ],
      "probable": [
        {
          "diagnosisPrefixes": [
            "example"
          ],
          "diagnosisRanges": [
            {
              "from": "example",
              "to": "example"
            }
          ],
          "excludeDiagnosisCombinations": [
            [
              "example"
            ]
          ],
          "excludeDiagnosisPrefixes": [
            "example"
          ],
          "interventions": [
            {
              "codes": [
                "example"
              ],
              "op": "present",
              "source": {
                "document": "example",
                "locator": "example",
                "reviewedAt": "2026-10-14T13:00:00Z",
                "reviewedBy": "example",
                "sha256": "0123456789abcdef0123456789abcdef",
                "status": "draft",
                "version": "1"
              },
              "withinDays": 0
            }
          ],
          "longitudinalReview": {
            "actions": [
              "start"
            ],
            "adjustmentSelection": "latest_two_distinct",
            "applicability": "example",
            "atc": "example",
            "observation": {
              "code": "example",
              "target": {
                "op": "gte",
                "value": 1
              },
              "unit": "example"
            },
            "responseWindow": {
              "maxDays": 0,
              "minDays": 0
            },
            "resultSelection": "latest_in_response_window",
            "reviewWindow": {
              "amount": 0,
              "unit": "days"
            },
            "source": {
              "document": "example",
              "locator": "example",
              "reviewedAt": "2026-10-14T13:00:00Z",
              "reviewedBy": "example",
              "sha256": "0123456789abcdef0123456789abcdef",
              "status": "draft",
              "version": "1"
            },
            "sourceId": "source_01",
            "sourceKinds": [
              "medical_record"
            ]
          },
          "manual": false,
          "maxAge": 0,
          "medications": [
            {
              "actions": [
                "start"
              ],
              "codes": [
                "example"
              ],
              "event": "prescribed",
              "op": "present",
              "source": {
                "document": "example",
                "locator": "example",
                "reviewedAt": "2026-10-14T13:00:00Z",
                "reviewedBy": "example",
                "sha256": "0123456789abcdef0123456789abcdef",
                "status": "draft",
                "version": "1"
              },
              "sourceKinds": [
                "medical_record"
              ],
              "withinDays": 0
            }
          ],
          "minAge": 0,
          "observations": [
            {
              "code": "example",
              "count": 0,
              "minSpacingDays": 0,
              "op": "gte",
              "source": {
                "document": "example",
                "locator": "example",
                "reviewedAt": "2026-10-14T13:00:00Z",
                "reviewedBy": "example",
                "sha256": "0123456789abcdef0123456789abcdef",
                "status": "draft",
                "version": "1"
              },
              "unit": "example",
              "value": 1,
              "withinDays": 0
            }
          ],
          "portfolioId": "portfolio_01",
          "requiresAll": false,
          "requiresCoverage": [
            "dispensingIncluded"
          ],
          "sex": "female"
        }
      ],
      "ruledOut": [
        {
          "diagnosisPrefixes": [
            "example"
          ],
          "diagnosisRanges": [
            {
              "from": "example",
              "to": "example"
            }
          ],
          "excludeDiagnosisCombinations": [
            [
              "example"
            ]
          ],
          "excludeDiagnosisPrefixes": [
            "example"
          ],
          "interventions": [
            {
              "codes": [
                "example"
              ],
              "op": "present",
              "source": {
                "document": "example",
                "locator": "example",
                "reviewedAt": "2026-10-14T13:00:00Z",
                "reviewedBy": "example",
                "sha256": "0123456789abcdef0123456789abcdef",
                "status": "draft",
                "version": "1"
              },
              "withinDays": 0
            }
          ],
          "longitudinalReview": {
            "actions": [
              "start"
            ],
            "adjustmentSelection": "latest_two_distinct",
            "applicability": "example",
            "atc": "example",
            "observation": {
              "code": "example",
              "target": {
                "op": "gte",
                "value": 1
              },
              "unit": "example"
            },
            "responseWindow": {
              "maxDays": 0,
              "minDays": 0
            },
            "resultSelection": "latest_in_response_window",
            "reviewWindow": {
              "amount": 0,
              "unit": "days"
            },
            "source": {
              "document": "example",
              "locator": "example",
              "reviewedAt": "2026-10-14T13:00:00Z",
              "reviewedBy": "example",
              "sha256": "0123456789abcdef0123456789abcdef",
              "status": "draft",
              "version": "1"
            },
            "sourceId": "source_01",
            "sourceKinds": [
              "medical_record"
            ]
          },
          "manual": false,
          "maxAge": 0,
          "medications": [
            {
              "actions": [
                "start"
              ],
              "codes": [
                "example"
              ],
              "event": "prescribed",
              "op": "present",
              "source": {
                "document": "example",
                "locator": "example",
                "reviewedAt": "2026-10-14T13:00:00Z",
                "reviewedBy": "example",
                "sha256": "0123456789abcdef0123456789abcdef",
                "status": "draft",
                "version": "1"
              },
              "sourceKinds": [
                "medical_record"
              ],
              "withinDays": 0
            }
          ],
          "minAge": 0,
          "observations": [
            {
              "code": "example",
              "count": 0,
              "minSpacingDays": 0,
              "op": "gte",
              "source": {
                "document": "example",
                "locator": "example",
                "reviewedAt": "2026-10-14T13:00:00Z",
                "reviewedBy": "example",
                "sha256": "0123456789abcdef0123456789abcdef",
                "status": "draft",
                "version": "1"
              },
              "unit": "example",
              "value": 1,
              "withinDays": 0
            }
          ],
          "portfolioId": "portfolio_01",
          "requiresAll": false,
          "requiresCoverage": [
            "dispensingIncluded"
          ],
          "sex": "female"
        }
      ]
    }
  },
  "requestKey": "0123456789abcdef0123456789abcdef",
  "status": "draft",
  "title": "example"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://api-ambar.getarbol.com/v1/cohort-workspaces/save \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "expectedVersion": "1",
  "id": "example_01",
  "policy": {
    "confirmation": "automatic",
    "medicalProposal": {
      "activityCode": "example",
      "reason": "example"
    },
    "rules": [
      {
        "diagnosisPrefixes": [
          "example"
        ],
        "diagnosisRanges": [
          {
            "from": "example",
            "to": "example"
          }
        ],
        "excludeDiagnosisCombinations": [
          [
            "example"
          ]
        ],
        "excludeDiagnosisPrefixes": [
          "example"
        ],
        "interventions": [
          {
            "codes": [
              "example"
            ],
            "op": "present",
            "source": {
              "document": "example",
              "locator": "example",
              "reviewedAt": "2026-10-14T13:00:00Z",
              "reviewedBy": "example",
              "sha256": "0123456789abcdef0123456789abcdef",
              "status": "draft",
              "version": "1"
            },
            "withinDays": 0
          }
        ],
        "longitudinalReview": {
          "actions": [
            "start"
          ],
          "adjustmentSelection": "latest_two_distinct",
          "applicability": "example",
          "atc": "example",
          "observation": {
            "code": "example",
            "target": {
              "op": "gte",
              "value": 1
            },
            "unit": "example"
          },
          "responseWindow": {
            "maxDays": 0,
            "minDays": 0
          },
          "resultSelection": "latest_in_response_window",
          "reviewWindow": {
            "amount": 0,
            "unit": "days"
          },
          "source": {
            "document": "example",
            "locator": "example",
            "reviewedAt": "2026-10-14T13:00:00Z",
            "reviewedBy": "example",
            "sha256": "0123456789abcdef0123456789abcdef",
            "status": "draft",
            "version": "1"
          },
          "sourceId": "source_01",
          "sourceKinds": [
            "medical_record"
          ]
        },
        "manual": false,
        "maxAge": 0,
        "medications": [
          {
            "actions": [
              "start"
            ],
            "codes": [
              "example"
            ],
            "event": "prescribed",
            "op": "present",
            "source": {
              "document": "example",
              "locator": "example",
              "reviewedAt": "2026-10-14T13:00:00Z",
              "reviewedBy": "example",
              "sha256": "0123456789abcdef0123456789abcdef",
              "status": "draft",
              "version": "1"
            },
            "sourceKinds": [
              "medical_record"
            ],
            "withinDays": 0
          }
        ],
        "minAge": 0,
        "observations": [
          {
            "code": "example",
            "count": 0,
            "minSpacingDays": 0,
            "op": "gte",
            "source": {
              "document": "example",
              "locator": "example",
              "reviewedAt": "2026-10-14T13:00:00Z",
              "reviewedBy": "example",
              "sha256": "0123456789abcdef0123456789abcdef",
              "status": "draft",
              "version": "1"
            },
            "unit": "example",
            "value": 1,
            "withinDays": 0
          }
        ],
        "portfolioId": "portfolio_01",
        "requiresAll": false,
        "requiresCoverage": [
          "dispensingIncluded"
        ],
        "sex": "female"
      }
    ],
    "sensitivity": "standard",
    "sortOrder": 0,
    "terminologyReleases": [
      {
        "system": "example",
        "units": [
          "example"
        ],
        "version": "1"
      }
    ],
    "tiers": {
      "possible": [
        {
          "diagnosisPrefixes": [
            "example"
          ],
          "diagnosisRanges": [
            {
              "from": "example",
              "to": "example"
            }
          ],
          "excludeDiagnosisCombinations": [
            [
              "example"
            ]
          ],
          "excludeDiagnosisPrefixes": [
            "example"
          ],
          "interventions": [
            {
              "codes": [
                "example"
              ],
              "op": "present",
              "source": {
                "document": "example",
                "locator": "example",
                "reviewedAt": "2026-10-14T13:00:00Z",
                "reviewedBy": "example",
                "sha256": "0123456789abcdef0123456789abcdef",
                "status": "draft",
                "version": "1"
              },
              "withinDays": 0
            }
          ],
          "longitudinalReview": {
            "actions": [
              "start"
            ],
            "adjustmentSelection": "latest_two_distinct",
            "applicability": "example",
            "atc": "example",
            "observation": {
              "code": "example",
              "target": {
                "op": "gte",
                "value": 1
              },
              "unit": "example"
            },
            "responseWindow": {
              "maxDays": 0,
              "minDays": 0
            },
            "resultSelection": "latest_in_response_window",
            "reviewWindow": {
              "amount": 0,
              "unit": "days"
            },
            "source": {
              "document": "example",
              "locator": "example",
              "reviewedAt": "2026-10-14T13:00:00Z",
              "reviewedBy": "example",
              "sha256": "0123456789abcdef0123456789abcdef",
              "status": "draft",
              "version": "1"
            },
            "sourceId": "source_01",
            "sourceKinds": [
              "medical_record"
            ]
          },
          "manual": false,
          "maxAge": 0,
          "medications": [
            {
              "actions": [
                "start"
              ],
              "codes": [
                "example"
              ],
              "event": "prescribed",
              "op": "present",
              "source": {
                "document": "example",
                "locator": "example",
                "reviewedAt": "2026-10-14T13:00:00Z",
                "reviewedBy": "example",
                "sha256": "0123456789abcdef0123456789abcdef",
                "status": "draft",
                "version": "1"
              },
              "sourceKinds": [
                "medical_record"
              ],
              "withinDays": 0
            }
          ],
          "minAge": 0,
          "observations": [
            {
              "code": "example",
              "count": 0,
              "minSpacingDays": 0,
              "op": "gte",
              "source": {
                "document": "example",
                "locator": "example",
                "reviewedAt": "2026-10-14T13:00:00Z",
                "reviewedBy": "example",
                "sha256": "0123456789abcdef0123456789abcdef",
                "status": "draft",
                "version": "1"
              },
              "unit": "example",
              "value": 1,
              "withinDays": 0
            }
          ],
          "portfolioId": "portfolio_01",
          "requiresAll": false,
          "requiresCoverage": [
            "dispensingIncluded"
          ],
          "sex": "female"
        }
      ],
      "probable": [
        {
          "diagnosisPrefixes": [
            "example"
          ],
          "diagnosisRanges": [
            {
              "from": "example",
              "to": "example"
            }
          ],
          "excludeDiagnosisCombinations": [
            [
              "example"
            ]
          ],
          "excludeDiagnosisPrefixes": [
            "example"
          ],
          "interventions": [
            {
              "codes": [
                "example"
              ],
              "op": "present",
              "source": {
                "document": "example",
                "locator": "example",
                "reviewedAt": "2026-10-14T13:00:00Z",
                "reviewedBy": "example",
                "sha256": "0123456789abcdef0123456789abcdef",
                "status": "draft",
                "version": "1"
              },
              "withinDays": 0
            }
          ],
          "longitudinalReview": {
            "actions": [
              "start"
            ],
            "adjustmentSelection": "latest_two_distinct",
            "applicability": "example",
            "atc": "example",
            "observation": {
              "code": "example",
              "target": {
                "op": "gte",
                "value": 1
              },
              "unit": "example"
            },
            "responseWindow": {
              "maxDays": 0,
              "minDays": 0
            },
            "resultSelection": "latest_in_response_window",
            "reviewWindow": {
              "amount": 0,
              "unit": "days"
            },
            "source": {
              "document": "example",
              "locator": "example",
              "reviewedAt": "2026-10-14T13:00:00Z",
              "reviewedBy": "example",
              "sha256": "0123456789abcdef0123456789abcdef",
              "status": "draft",
              "version": "1"
            },
            "sourceId": "source_01",
            "sourceKinds": [
              "medical_record"
            ]
          },
          "manual": false,
          "maxAge": 0,
          "medications": [
            {
              "actions": [
                "start"
              ],
              "codes": [
                "example"
              ],
              "event": "prescribed",
              "op": "present",
              "source": {
                "document": "example",
                "locator": "example",
                "reviewedAt": "2026-10-14T13:00:00Z",
                "reviewedBy": "example",
                "sha256": "0123456789abcdef0123456789abcdef",
                "status": "draft",
                "version": "1"
              },
              "sourceKinds": [
                "medical_record"
              ],
              "withinDays": 0
            }
          ],
          "minAge": 0,
          "observations": [
            {
              "code": "example",
              "count": 0,
              "minSpacingDays": 0,
              "op": "gte",
              "source": {
                "document": "example",
                "locator": "example",
                "reviewedAt": "2026-10-14T13:00:00Z",
                "reviewedBy": "example",
                "sha256": "0123456789abcdef0123456789abcdef",
                "status": "draft",
                "version": "1"
              },
              "unit": "example",
              "value": 1,
              "withinDays": 0
            }
          ],
          "portfolioId": "portfolio_01",
          "requiresAll": false,
          "requiresCoverage": [
            "dispensingIncluded"
          ],
          "sex": "female"
        }
      ],
      "ruledOut": [
        {
          "diagnosisPrefixes": [
            "example"
          ],
          "diagnosisRanges": [
            {
              "from": "example",
              "to": "example"
            }
          ],
          "excludeDiagnosisCombinations": [
            [
              "example"
            ]
          ],
          "excludeDiagnosisPrefixes": [
            "example"
          ],
          "interventions": [
            {
              "codes": [
                "example"
              ],
              "op": "present",
              "source": {
                "document": "example",
                "locator": "example",
                "reviewedAt": "2026-10-14T13:00:00Z",
                "reviewedBy": "example",
                "sha256": "0123456789abcdef0123456789abcdef",
                "status": "draft",
                "version": "1"
              },
              "withinDays": 0
            }
          ],
          "longitudinalReview": {
            "actions": [
              "start"
            ],
            "adjustmentSelection": "latest_two_distinct",
            "applicability": "example",
            "atc": "example",
            "observation": {
              "code": "example",
              "target": {
                "op": "gte",
                "value": 1
              },
              "unit": "example"
            },
            "responseWindow": {
              "maxDays": 0,
              "minDays": 0
            },
            "resultSelection": "latest_in_response_window",
            "reviewWindow": {
              "amount": 0,
              "unit": "days"
            },
            "source": {
              "document": "example",
              "locator": "example",
              "reviewedAt": "2026-10-14T13:00:00Z",
              "reviewedBy": "example",
              "sha256": "0123456789abcdef0123456789abcdef",
              "status": "draft",
              "version": "1"
            },
            "sourceId": "source_01",
            "sourceKinds": [
              "medical_record"
            ]
          },
          "manual": false,
          "maxAge": 0,
          "medications": [
            {
              "actions": [
                "start"
              ],
              "codes": [
                "example"
              ],
              "event": "prescribed",
              "op": "present",
              "source": {
                "document": "example",
                "locator": "example",
                "reviewedAt": "2026-10-14T13:00:00Z",
                "reviewedBy": "example",
                "sha256": "0123456789abcdef0123456789abcdef",
                "status": "draft",
                "version": "1"
              },
              "sourceKinds": [
                "medical_record"
              ],
              "withinDays": 0
            }
          ],
          "minAge": 0,
          "observations": [
            {
              "code": "example",
              "count": 0,
              "minSpacingDays": 0,
              "op": "gte",
              "source": {
                "document": "example",
                "locator": "example",
                "reviewedAt": "2026-10-14T13:00:00Z",
                "reviewedBy": "example",
                "sha256": "0123456789abcdef0123456789abcdef",
                "status": "draft",
                "version": "1"
              },
              "unit": "example",
              "value": 1,
              "withinDays": 0
            }
          ],
          "portfolioId": "portfolio_01",
          "requiresAll": false,
          "requiresCoverage": [
            "dispensingIncluded"
          ],
          "sex": "female"
        }
      ]
    }
  },
  "requestKey": "0123456789abcdef0123456789abcdef",
  "status": "draft",
  "title": "example"
}
'
```

### TypeScript

```typescript
const url = 'https://api-ambar.getarbol.com/v1/cohort-workspaces/save';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    expectedVersion: '1',
    id: 'example_01',
    policy: {
      confirmation: 'automatic',
      medicalProposal: {activityCode: 'example', reason: 'example'},
      rules: [
        {
          diagnosisPrefixes: ['example'],
          diagnosisRanges: [{from: 'example', to: 'example'}],
          excludeDiagnosisCombinations: [['example']],
          excludeDiagnosisPrefixes: ['example'],
          interventions: [
            {
              codes: ['example'],
              op: 'present',
              source: {
                document: 'example',
                locator: 'example',
                reviewedAt: '2026-10-14T13:00:00Z',
                reviewedBy: 'example',
                sha256: '0123456789abcdef0123456789abcdef',
                status: 'draft',
                version: '1'
              },
              withinDays: 0
            }
          ],
          longitudinalReview: {
            actions: ['start'],
            adjustmentSelection: 'latest_two_distinct',
            applicability: 'example',
            atc: 'example',
            observation: {code: 'example', target: {op: 'gte', value: 1}, unit: 'example'},
            responseWindow: {maxDays: 0, minDays: 0},
            resultSelection: 'latest_in_response_window',
            reviewWindow: {amount: 0, unit: 'days'},
            source: {
              document: 'example',
              locator: 'example',
              reviewedAt: '2026-10-14T13:00:00Z',
              reviewedBy: 'example',
              sha256: '0123456789abcdef0123456789abcdef',
              status: 'draft',
              version: '1'
            },
            sourceId: 'source_01',
            sourceKinds: ['medical_record']
          },
          manual: false,
          maxAge: 0,
          medications: [
            {
              actions: ['start'],
              codes: ['example'],
              event: 'prescribed',
              op: 'present',
              source: {
                document: 'example',
                locator: 'example',
                reviewedAt: '2026-10-14T13:00:00Z',
                reviewedBy: 'example',
                sha256: '0123456789abcdef0123456789abcdef',
                status: 'draft',
                version: '1'
              },
              sourceKinds: ['medical_record'],
              withinDays: 0
            }
          ],
          minAge: 0,
          observations: [
            {
              code: 'example',
              count: 0,
              minSpacingDays: 0,
              op: 'gte',
              source: {
                document: 'example',
                locator: 'example',
                reviewedAt: '2026-10-14T13:00:00Z',
                reviewedBy: 'example',
                sha256: '0123456789abcdef0123456789abcdef',
                status: 'draft',
                version: '1'
              },
              unit: 'example',
              value: 1,
              withinDays: 0
            }
          ],
          portfolioId: 'portfolio_01',
          requiresAll: false,
          requiresCoverage: ['dispensingIncluded'],
          sex: 'female'
        }
      ],
      sensitivity: 'standard',
      sortOrder: 0,
      terminologyReleases: [{system: 'example', units: ['example'], version: '1'}],
      tiers: {
        possible: [
          {
            diagnosisPrefixes: ['example'],
            diagnosisRanges: [{from: 'example', to: 'example'}],
            excludeDiagnosisCombinations: [['example']],
            excludeDiagnosisPrefixes: ['example'],
            interventions: [
              {
                codes: ['example'],
                op: 'present',
                source: {
                  document: 'example',
                  locator: 'example',
                  reviewedAt: '2026-10-14T13:00:00Z',
                  reviewedBy: 'example',
                  sha256: '0123456789abcdef0123456789abcdef',
                  status: 'draft',
                  version: '1'
                },
                withinDays: 0
              }
            ],
            longitudinalReview: {
              actions: ['start'],
              adjustmentSelection: 'latest_two_distinct',
              applicability: 'example',
              atc: 'example',
              observation: {code: 'example', target: {op: 'gte', value: 1}, unit: 'example'},
              responseWindow: {maxDays: 0, minDays: 0},
              resultSelection: 'latest_in_response_window',
              reviewWindow: {amount: 0, unit: 'days'},
              source: {
                document: 'example',
                locator: 'example',
                reviewedAt: '2026-10-14T13:00:00Z',
                reviewedBy: 'example',
                sha256: '0123456789abcdef0123456789abcdef',
                status: 'draft',
                version: '1'
              },
              sourceId: 'source_01',
              sourceKinds: ['medical_record']
            },
            manual: false,
            maxAge: 0,
            medications: [
              {
                actions: ['start'],
                codes: ['example'],
                event: 'prescribed',
                op: 'present',
                source: {
                  document: 'example',
                  locator: 'example',
                  reviewedAt: '2026-10-14T13:00:00Z',
                  reviewedBy: 'example',
                  sha256: '0123456789abcdef0123456789abcdef',
                  status: 'draft',
                  version: '1'
                },
                sourceKinds: ['medical_record'],
                withinDays: 0
              }
            ],
            minAge: 0,
            observations: [
              {
                code: 'example',
                count: 0,
                minSpacingDays: 0,
                op: 'gte',
                source: {
                  document: 'example',
                  locator: 'example',
                  reviewedAt: '2026-10-14T13:00:00Z',
                  reviewedBy: 'example',
                  sha256: '0123456789abcdef0123456789abcdef',
                  status: 'draft',
                  version: '1'
                },
                unit: 'example',
                value: 1,
                withinDays: 0
              }
            ],
            portfolioId: 'portfolio_01',
            requiresAll: false,
            requiresCoverage: ['dispensingIncluded'],
            sex: 'female'
          }
        ],
        probable: [
          {
            diagnosisPrefixes: ['example'],
            diagnosisRanges: [{from: 'example', to: 'example'}],
            excludeDiagnosisCombinations: [['example']],
            excludeDiagnosisPrefixes: ['example'],
            interventions: [
              {
                codes: ['example'],
                op: 'present',
                source: {
                  document: 'example',
                  locator: 'example',
                  reviewedAt: '2026-10-14T13:00:00Z',
                  reviewedBy: 'example',
                  sha256: '0123456789abcdef0123456789abcdef',
                  status: 'draft',
                  version: '1'
                },
                withinDays: 0
              }
            ],
            longitudinalReview: {
              actions: ['start'],
              adjustmentSelection: 'latest_two_distinct',
              applicability: 'example',
              atc: 'example',
              observation: {code: 'example', target: {op: 'gte', value: 1}, unit: 'example'},
              responseWindow: {maxDays: 0, minDays: 0},
              resultSelection: 'latest_in_response_window',
              reviewWindow: {amount: 0, unit: 'days'},
              source: {
                document: 'example',
                locator: 'example',
                reviewedAt: '2026-10-14T13:00:00Z',
                reviewedBy: 'example',
                sha256: '0123456789abcdef0123456789abcdef',
                status: 'draft',
                version: '1'
              },
              sourceId: 'source_01',
              sourceKinds: ['medical_record']
            },
            manual: false,
            maxAge: 0,
            medications: [
              {
                actions: ['start'],
                codes: ['example'],
                event: 'prescribed',
                op: 'present',
                source: {
                  document: 'example',
                  locator: 'example',
                  reviewedAt: '2026-10-14T13:00:00Z',
                  reviewedBy: 'example',
                  sha256: '0123456789abcdef0123456789abcdef',
                  status: 'draft',
                  version: '1'
                },
                sourceKinds: ['medical_record'],
                withinDays: 0
              }
            ],
            minAge: 0,
            observations: [
              {
                code: 'example',
                count: 0,
                minSpacingDays: 0,
                op: 'gte',
                source: {
                  document: 'example',
                  locator: 'example',
                  reviewedAt: '2026-10-14T13:00:00Z',
                  reviewedBy: 'example',
                  sha256: '0123456789abcdef0123456789abcdef',
                  status: 'draft',
                  version: '1'
                },
                unit: 'example',
                value: 1,
                withinDays: 0
              }
            ],
            portfolioId: 'portfolio_01',
            requiresAll: false,
            requiresCoverage: ['dispensingIncluded'],
            sex: 'female'
          }
        ],
        ruledOut: [
          {
            diagnosisPrefixes: ['example'],
            diagnosisRanges: [{from: 'example', to: 'example'}],
            excludeDiagnosisCombinations: [['example']],
            excludeDiagnosisPrefixes: ['example'],
            interventions: [
              {
                codes: ['example'],
                op: 'present',
                source: {
                  document: 'example',
                  locator: 'example',
                  reviewedAt: '2026-10-14T13:00:00Z',
                  reviewedBy: 'example',
                  sha256: '0123456789abcdef0123456789abcdef',
                  status: 'draft',
                  version: '1'
                },
                withinDays: 0
              }
            ],
            longitudinalReview: {
              actions: ['start'],
              adjustmentSelection: 'latest_two_distinct',
              applicability: 'example',
              atc: 'example',
              observation: {code: 'example', target: {op: 'gte', value: 1}, unit: 'example'},
              responseWindow: {maxDays: 0, minDays: 0},
              resultSelection: 'latest_in_response_window',
              reviewWindow: {amount: 0, unit: 'days'},
              source: {
                document: 'example',
                locator: 'example',
                reviewedAt: '2026-10-14T13:00:00Z',
                reviewedBy: 'example',
                sha256: '0123456789abcdef0123456789abcdef',
                status: 'draft',
                version: '1'
              },
              sourceId: 'source_01',
              sourceKinds: ['medical_record']
            },
            manual: false,
            maxAge: 0,
            medications: [
              {
                actions: ['start'],
                codes: ['example'],
                event: 'prescribed',
                op: 'present',
                source: {
                  document: 'example',
                  locator: 'example',
                  reviewedAt: '2026-10-14T13:00:00Z',
                  reviewedBy: 'example',
                  sha256: '0123456789abcdef0123456789abcdef',
                  status: 'draft',
                  version: '1'
                },
                sourceKinds: ['medical_record'],
                withinDays: 0
              }
            ],
            minAge: 0,
            observations: [
              {
                code: 'example',
                count: 0,
                minSpacingDays: 0,
                op: 'gte',
                source: {
                  document: 'example',
                  locator: 'example',
                  reviewedAt: '2026-10-14T13:00:00Z',
                  reviewedBy: 'example',
                  sha256: '0123456789abcdef0123456789abcdef',
                  status: 'draft',
                  version: '1'
                },
                unit: 'example',
                value: 1,
                withinDays: 0
              }
            ],
            portfolioId: 'portfolio_01',
            requiresAll: false,
            requiresCoverage: ['dispensingIncluded'],
            sex: 'female'
          }
        ]
      }
    },
    requestKey: '0123456789abcdef0123456789abcdef',
    status: 'draft',
    title: 'example'
  })
};

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/cohort-workspaces/save"

payload = {
    "expectedVersion": "1",
    "id": "example_01",
    "policy": {
        "confirmation": "automatic",
        "medicalProposal": {
            "activityCode": "example",
            "reason": "example"
        },
        "rules": [
            {
                "diagnosisPrefixes": ["example"],
                "diagnosisRanges": [
                    {
                        "from": "example",
                        "to": "example"
                    }
                ],
                "excludeDiagnosisCombinations": [["example"]],
                "excludeDiagnosisPrefixes": ["example"],
                "interventions": [
                    {
                        "codes": ["example"],
                        "op": "present",
                        "source": {
                            "document": "example",
                            "locator": "example",
                            "reviewedAt": "2026-10-14T13:00:00Z",
                            "reviewedBy": "example",
                            "sha256": "0123456789abcdef0123456789abcdef",
                            "status": "draft",
                            "version": "1"
                        },
                        "withinDays": 0
                    }
                ],
                "longitudinalReview": {
                    "actions": ["start"],
                    "adjustmentSelection": "latest_two_distinct",
                    "applicability": "example",
                    "atc": "example",
                    "observation": {
                        "code": "example",
                        "target": {
                            "op": "gte",
                            "value": 1
                        },
                        "unit": "example"
                    },
                    "responseWindow": {
                        "maxDays": 0,
                        "minDays": 0
                    },
                    "resultSelection": "latest_in_response_window",
                    "reviewWindow": {
                        "amount": 0,
                        "unit": "days"
                    },
                    "source": {
                        "document": "example",
                        "locator": "example",
                        "reviewedAt": "2026-10-14T13:00:00Z",
                        "reviewedBy": "example",
                        "sha256": "0123456789abcdef0123456789abcdef",
                        "status": "draft",
                        "version": "1"
                    },
                    "sourceId": "source_01",
                    "sourceKinds": ["medical_record"]
                },
                "manual": False,
                "maxAge": 0,
                "medications": [
                    {
                        "actions": ["start"],
                        "codes": ["example"],
                        "event": "prescribed",
                        "op": "present",
                        "source": {
                            "document": "example",
                            "locator": "example",
                            "reviewedAt": "2026-10-14T13:00:00Z",
                            "reviewedBy": "example",
                            "sha256": "0123456789abcdef0123456789abcdef",
                            "status": "draft",
                            "version": "1"
                        },
                        "sourceKinds": ["medical_record"],
                        "withinDays": 0
                    }
                ],
                "minAge": 0,
                "observations": [
                    {
                        "code": "example",
                        "count": 0,
                        "minSpacingDays": 0,
                        "op": "gte",
                        "source": {
                            "document": "example",
                            "locator": "example",
                            "reviewedAt": "2026-10-14T13:00:00Z",
                            "reviewedBy": "example",
                            "sha256": "0123456789abcdef0123456789abcdef",
                            "status": "draft",
                            "version": "1"
                        },
                        "unit": "example",
                        "value": 1,
                        "withinDays": 0
                    }
                ],
                "portfolioId": "portfolio_01",
                "requiresAll": False,
                "requiresCoverage": ["dispensingIncluded"],
                "sex": "female"
            }
        ],
        "sensitivity": "standard",
        "sortOrder": 0,
        "terminologyReleases": [
            {
                "system": "example",
                "units": ["example"],
                "version": "1"
            }
        ],
        "tiers": {
            "possible": [
                {
                    "diagnosisPrefixes": ["example"],
                    "diagnosisRanges": [
                        {
                            "from": "example",
                            "to": "example"
                        }
                    ],
                    "excludeDiagnosisCombinations": [["example"]],
                    "excludeDiagnosisPrefixes": ["example"],
                    "interventions": [
                        {
                            "codes": ["example"],
                            "op": "present",
                            "source": {
                                "document": "example",
                                "locator": "example",
                                "reviewedAt": "2026-10-14T13:00:00Z",
                                "reviewedBy": "example",
                                "sha256": "0123456789abcdef0123456789abcdef",
                                "status": "draft",
                                "version": "1"
                            },
                            "withinDays": 0
                        }
                    ],
                    "longitudinalReview": {
                        "actions": ["start"],
                        "adjustmentSelection": "latest_two_distinct",
                        "applicability": "example",
                        "atc": "example",
                        "observation": {
                            "code": "example",
                            "target": {
                                "op": "gte",
                                "value": 1
                            },
                            "unit": "example"
                        },
                        "responseWindow": {
                            "maxDays": 0,
                            "minDays": 0
                        },
                        "resultSelection": "latest_in_response_window",
                        "reviewWindow": {
                            "amount": 0,
                            "unit": "days"
                        },
                        "source": {
                            "document": "example",
                            "locator": "example",
                            "reviewedAt": "2026-10-14T13:00:00Z",
                            "reviewedBy": "example",
                            "sha256": "0123456789abcdef0123456789abcdef",
                            "status": "draft",
                            "version": "1"
                        },
                        "sourceId": "source_01",
                        "sourceKinds": ["medical_record"]
                    },
                    "manual": False,
                    "maxAge": 0,
                    "medications": [
                        {
                            "actions": ["start"],
                            "codes": ["example"],
                            "event": "prescribed",
                            "op": "present",
                            "source": {
                                "document": "example",
                                "locator": "example",
                                "reviewedAt": "2026-10-14T13:00:00Z",
                                "reviewedBy": "example",
                                "sha256": "0123456789abcdef0123456789abcdef",
                                "status": "draft",
                                "version": "1"
                            },
                            "sourceKinds": ["medical_record"],
                            "withinDays": 0
                        }
                    ],
                    "minAge": 0,
                    "observations": [
                        {
                            "code": "example",
                            "count": 0,
                            "minSpacingDays": 0,
                            "op": "gte",
                            "source": {
                                "document": "example",
                                "locator": "example",
                                "reviewedAt": "2026-10-14T13:00:00Z",
                                "reviewedBy": "example",
                                "sha256": "0123456789abcdef0123456789abcdef",
                                "status": "draft",
                                "version": "1"
                            },
                            "unit": "example",
                            "value": 1,
                            "withinDays": 0
                        }
                    ],
                    "portfolioId": "portfolio_01",
                    "requiresAll": False,
                    "requiresCoverage": ["dispensingIncluded"],
                    "sex": "female"
                }
            ],
            "probable": [
                {
                    "diagnosisPrefixes": ["example"],
                    "diagnosisRanges": [
                        {
                            "from": "example",
                            "to": "example"
                        }
                    ],
                    "excludeDiagnosisCombinations": [["example"]],
                    "excludeDiagnosisPrefixes": ["example"],
                    "interventions": [
                        {
                            "codes": ["example"],
                            "op": "present",
                            "source": {
                                "document": "example",
                                "locator": "example",
                                "reviewedAt": "2026-10-14T13:00:00Z",
                                "reviewedBy": "example",
                                "sha256": "0123456789abcdef0123456789abcdef",
                                "status": "draft",
                                "version": "1"
                            },
                            "withinDays": 0
                        }
                    ],
                    "longitudinalReview": {
                        "actions": ["start"],
                        "adjustmentSelection": "latest_two_distinct",
                        "applicability": "example",
                        "atc": "example",
                        "observation": {
                            "code": "example",
                            "target": {
                                "op": "gte",
                                "value": 1
                            },
                            "unit": "example"
                        },
                        "responseWindow": {
                            "maxDays": 0,
                            "minDays": 0
                        },
                        "resultSelection": "latest_in_response_window",
                        "reviewWindow": {
                            "amount": 0,
                            "unit": "days"
                        },
                        "source": {
                            "document": "example",
                            "locator": "example",
                            "reviewedAt": "2026-10-14T13:00:00Z",
                            "reviewedBy": "example",
                            "sha256": "0123456789abcdef0123456789abcdef",
                            "status": "draft",
                            "version": "1"
                        },
                        "sourceId": "source_01",
                        "sourceKinds": ["medical_record"]
                    },
                    "manual": False,
                    "maxAge": 0,
                    "medications": [
                        {
                            "actions": ["start"],
                            "codes": ["example"],
                            "event": "prescribed",
                            "op": "present",
                            "source": {
                                "document": "example",
                                "locator": "example",
                                "reviewedAt": "2026-10-14T13:00:00Z",
                                "reviewedBy": "example",
                                "sha256": "0123456789abcdef0123456789abcdef",
                                "status": "draft",
                                "version": "1"
                            },
                            "sourceKinds": ["medical_record"],
                            "withinDays": 0
                        }
                    ],
                    "minAge": 0,
                    "observations": [
                        {
                            "code": "example",
                            "count": 0,
                            "minSpacingDays": 0,
                            "op": "gte",
                            "source": {
                                "document": "example",
                                "locator": "example",
                                "reviewedAt": "2026-10-14T13:00:00Z",
                                "reviewedBy": "example",
                                "sha256": "0123456789abcdef0123456789abcdef",
                                "status": "draft",
                                "version": "1"
                            },
                            "unit": "example",
                            "value": 1,
                            "withinDays": 0
                        }
                    ],
                    "portfolioId": "portfolio_01",
                    "requiresAll": False,
                    "requiresCoverage": ["dispensingIncluded"],
                    "sex": "female"
                }
            ],
            "ruledOut": [
                {
                    "diagnosisPrefixes": ["example"],
                    "diagnosisRanges": [
                        {
                            "from": "example",
                            "to": "example"
                        }
                    ],
                    "excludeDiagnosisCombinations": [["example"]],
                    "excludeDiagnosisPrefixes": ["example"],
                    "interventions": [
                        {
                            "codes": ["example"],
                            "op": "present",
                            "source": {
                                "document": "example",
                                "locator": "example",
                                "reviewedAt": "2026-10-14T13:00:00Z",
                                "reviewedBy": "example",
                                "sha256": "0123456789abcdef0123456789abcdef",
                                "status": "draft",
                                "version": "1"
                            },
                            "withinDays": 0
                        }
                    ],
                    "longitudinalReview": {
                        "actions": ["start"],
                        "adjustmentSelection": "latest_two_distinct",
                        "applicability": "example",
                        "atc": "example",
                        "observation": {
                            "code": "example",
                            "target": {
                                "op": "gte",
                                "value": 1
                            },
                            "unit": "example"
                        },
                        "responseWindow": {
                            "maxDays": 0,
                            "minDays": 0
                        },
                        "resultSelection": "latest_in_response_window",
                        "reviewWindow": {
                            "amount": 0,
                            "unit": "days"
                        },
                        "source": {
                            "document": "example",
                            "locator": "example",
                            "reviewedAt": "2026-10-14T13:00:00Z",
                            "reviewedBy": "example",
                            "sha256": "0123456789abcdef0123456789abcdef",
                            "status": "draft",
                            "version": "1"
                        },
                        "sourceId": "source_01",
                        "sourceKinds": ["medical_record"]
                    },
                    "manual": False,
                    "maxAge": 0,
                    "medications": [
                        {
                            "actions": ["start"],
                            "codes": ["example"],
                            "event": "prescribed",
                            "op": "present",
                            "source": {
                                "document": "example",
                                "locator": "example",
                                "reviewedAt": "2026-10-14T13:00:00Z",
                                "reviewedBy": "example",
                                "sha256": "0123456789abcdef0123456789abcdef",
                                "status": "draft",
                                "version": "1"
                            },
                            "sourceKinds": ["medical_record"],
                            "withinDays": 0
                        }
                    ],
                    "minAge": 0,
                    "observations": [
                        {
                            "code": "example",
                            "count": 0,
                            "minSpacingDays": 0,
                            "op": "gte",
                            "source": {
                                "document": "example",
                                "locator": "example",
                                "reviewedAt": "2026-10-14T13:00:00Z",
                                "reviewedBy": "example",
                                "sha256": "0123456789abcdef0123456789abcdef",
                                "status": "draft",
                                "version": "1"
                            },
                            "unit": "example",
                            "value": 1,
                            "withinDays": 0
                        }
                    ],
                    "portfolioId": "portfolio_01",
                    "requiresAll": False,
                    "requiresCoverage": ["dispensingIncluded"],
                    "sex": "female"
                }
            ]
        }
    },
    "requestKey": "0123456789abcdef0123456789abcdef",
    "status": "draft",
    "title": "example"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

#### Example

```json
{
  "data": {
    "cohort": {
      "createdAt": "2026-10-14T13:00:00Z",
      "definition": {
        "kind": "curated"
      },
      "definitionVersion": "1",
      "id": "example_01",
      "status": "draft",
      "title": "example",
      "version": "1"
    },
    "counts": {
      "asOf": "example",
      "memberCount": 0,
      "qualifiedCount": 0,
      "reviewRequiredCount": 0,
      "scope": "complete_patient_registry"
    },
    "policy": {
      "confirmation": "automatic",
      "medicalProposal": {
        "activityCode": "example",
        "reason": "example"
      },
      "rules": [
        {
          "diagnosisPrefixes": [
            "example"
          ],
          "diagnosisRanges": [
            {
              "from": "example",
              "to": "example"
            }
          ],
          "excludeDiagnosisCombinations": [
            [
              "example"
            ]
          ],
          "excludeDiagnosisPrefixes": [
            "example"
          ],
          "interventions": [
            {
              "codes": [
                "example"
              ],
              "op": "present",
              "source": {
                "document": "example",
                "locator": "example",
                "reviewedAt": "2026-10-14T13:00:00Z",
                "reviewedBy": "example",
                "sha256": "0123456789abcdef0123456789abcdef",
                "status": "draft",
                "version": "1"
              },
              "withinDays": 0
            }
          ],
          "longitudinalReview": {
            "actions": [
              "start"
            ],
            "adjustmentSelection": "latest_two_distinct",
            "applicability": "example",
            "atc": "example",
            "observation": {
              "code": "example",
              "target": {
                "op": "gte",
                "value": 1
              },
              "unit": "example"
            },
            "responseWindow": {
              "maxDays": 0,
              "minDays": 0
            },
            "resultSelection": "latest_in_response_window",
            "reviewWindow": {
              "amount": 0,
              "unit": "days"
            },
            "source": {
              "document": "example",
              "locator": "example",
              "reviewedAt": "2026-10-14T13:00:00Z",
              "reviewedBy": "example",
              "sha256": "0123456789abcdef0123456789abcdef",
              "status": "draft",
              "version": "1"
            },
            "sourceId": "source_01",
            "sourceKinds": [
              "medical_record"
            ]
          },
          "manual": false,
          "maxAge": 0,
          "medications": [
            {
              "actions": [
                "start"
              ],
              "codes": [
                "example"
              ],
              "event": "prescribed",
              "op": "present",
              "source": {
                "document": "example",
                "locator": "example",
                "reviewedAt": "2026-10-14T13:00:00Z",
                "reviewedBy": "example",
                "sha256": "0123456789abcdef0123456789abcdef",
                "status": "draft",
                "version": "1"
              },
              "sourceKinds": [
                "medical_record"
              ],
              "withinDays": 0
            }
          ],
          "minAge": 0,
          "observations": [
            {
              "code": "example",
              "count": 0,
              "minSpacingDays": 0,
              "op": "gte",
              "source": {
                "document": "example",
                "locator": "example",
                "reviewedAt": "2026-10-14T13:00:00Z",
                "reviewedBy": "example",
                "sha256": "0123456789abcdef0123456789abcdef",
                "status": "draft",
                "version": "1"
              },
              "unit": "example",
              "value": 1,
              "withinDays": 0
            }
          ],
          "portfolioId": "portfolio_01",
          "requiresAll": false,
          "requiresCoverage": [
            "dispensingIncluded"
          ],
          "sex": "female"
        }
      ],
      "sensitivity": "standard",
      "sortOrder": 0,
      "terminologyReleases": [
        {
          "system": "example",
          "units": [
            "example"
          ],
          "version": "1"
        }
      ],
      "tiers": {
        "possible": [
          {
            "diagnosisPrefixes": [
              "example"
            ],
            "diagnosisRanges": [
              {
                "from": "example",
                "to": "example"
              }
            ],
            "excludeDiagnosisCombinations": [
              [
                "example"
              ]
            ],
            "excludeDiagnosisPrefixes": [
              "example"
            ],
            "interventions": [
              {
                "codes": [
                  "example"
                ],
                "op": "present",
                "source": {
                  "document": "example",
                  "locator": "example",
                  "reviewedAt": "2026-10-14T13:00:00Z",
                  "reviewedBy": "example",
                  "sha256": "0123456789abcdef0123456789abcdef",
                  "status": "draft",
                  "version": "1"
                },
                "withinDays": 0
              }
            ],
            "longitudinalReview": {
              "actions": [
                "start"
              ],
              "adjustmentSelection": "latest_two_distinct",
              "applicability": "example",
              "atc": "example",
              "observation": {
                "code": "example",
                "target": {
                  "op": "gte",
                  "value": 1
                },
                "unit": "example"
              },
              "responseWindow": {
                "maxDays": 0,
                "minDays": 0
              },
              "resultSelection": "latest_in_response_window",
              "reviewWindow": {
                "amount": 0,
                "unit": "days"
              },
              "source": {
                "document": "example",
                "locator": "example",
                "reviewedAt": "2026-10-14T13:00:00Z",
                "reviewedBy": "example",
                "sha256": "0123456789abcdef0123456789abcdef",
                "status": "draft",
                "version": "1"
              },
              "sourceId": "source_01",
              "sourceKinds": [
                "medical_record"
              ]
            },
            "manual": false,
            "maxAge": 0,
            "medications": [
              {
                "actions": [
                  "start"
                ],
                "codes": [
                  "example"
                ],
                "event": "prescribed",
                "op": "present",
                "source": {
                  "document": "example",
                  "locator": "example",
                  "reviewedAt": "2026-10-14T13:00:00Z",
                  "reviewedBy": "example",
                  "sha256": "0123456789abcdef0123456789abcdef",
                  "status": "draft",
                  "version": "1"
                },
                "sourceKinds": [
                  "medical_record"
                ],
                "withinDays": 0
              }
            ],
            "minAge": 0,
            "observations": [
              {
                "code": "example",
                "count": 0,
                "minSpacingDays": 0,
                "op": "gte",
                "source": {
                  "document": "example",
                  "locator": "example",
                  "reviewedAt": "2026-10-14T13:00:00Z",
                  "reviewedBy": "example",
                  "sha256": "0123456789abcdef0123456789abcdef",
                  "status": "draft",
                  "version": "1"
                },
                "unit": "example",
                "value": 1,
                "withinDays": 0
              }
            ],
            "portfolioId": "portfolio_01",
            "requiresAll": false,
            "requiresCoverage": [
              "dispensingIncluded"
            ],
            "sex": "female"
          }
        ],
        "probable": [
          {
            "diagnosisPrefixes": [
              "example"
            ],
            "diagnosisRanges": [
              {
                "from": "example",
                "to": "example"
              }
            ],
            "excludeDiagnosisCombinations": [
              [
                "example"
              ]
            ],
            "excludeDiagnosisPrefixes": [
              "example"
            ],
            "interventions": [
              {
                "codes": [
                  "example"
                ],
                "op": "present",
                "source": {
                  "document": "example",
                  "locator": "example",
                  "reviewedAt": "2026-10-14T13:00:00Z",
                  "reviewedBy": "example",
                  "sha256": "0123456789abcdef0123456789abcdef",
                  "status": "draft",
                  "version": "1"
                },
                "withinDays": 0
              }
            ],
            "longitudinalReview": {
              "actions": [
                "start"
              ],
              "adjustmentSelection": "latest_two_distinct",
              "applicability": "example",
              "atc": "example",
              "observation": {
                "code": "example",
                "target": {
                  "op": "gte",
                  "value": 1
                },
                "unit": "example"
              },
              "responseWindow": {
                "maxDays": 0,
                "minDays": 0
              },
              "resultSelection": "latest_in_response_window",
              "reviewWindow": {
                "amount": 0,
                "unit": "days"
              },
              "source": {
                "document": "example",
                "locator": "example",
                "reviewedAt": "2026-10-14T13:00:00Z",
                "reviewedBy": "example",
                "sha256": "0123456789abcdef0123456789abcdef",
                "status": "draft",
                "version": "1"
              },
              "sourceId": "source_01",
              "sourceKinds": [
                "medical_record"
              ]
            },
            "manual": false,
            "maxAge": 0,
            "medications": [
              {
                "actions": [
                  "start"
                ],
                "codes": [
                  "example"
                ],
                "event": "prescribed",
                "op": "present",
                "source": {
                  "document": "example",
                  "locator": "example",
                  "reviewedAt": "2026-10-14T13:00:00Z",
                  "reviewedBy": "example",
                  "sha256": "0123456789abcdef0123456789abcdef",
                  "status": "draft",
                  "version": "1"
                },
                "sourceKinds": [
                  "medical_record"
                ],
                "withinDays": 0
              }
            ],
            "minAge": 0,
            "observations": [
              {
                "code": "example",
                "count": 0,
                "minSpacingDays": 0,
                "op": "gte",
                "source": {
                  "document": "example",
                  "locator": "example",
                  "reviewedAt": "2026-10-14T13:00:00Z",
                  "reviewedBy": "example",
                  "sha256": "0123456789abcdef0123456789abcdef",
                  "status": "draft",
                  "version": "1"
                },
                "unit": "example",
                "value": 1,
                "withinDays": 0
              }
            ],
            "portfolioId": "portfolio_01",
            "requiresAll": false,
            "requiresCoverage": [
              "dispensingIncluded"
            ],
            "sex": "female"
          }
        ],
        "ruledOut": [
          {
            "diagnosisPrefixes": [
              "example"
            ],
            "diagnosisRanges": [
              {
                "from": "example",
                "to": "example"
              }
            ],
            "excludeDiagnosisCombinations": [
              [
                "example"
              ]
            ],
            "excludeDiagnosisPrefixes": [
              "example"
            ],
            "interventions": [
              {
                "codes": [
                  "example"
                ],
                "op": "present",
                "source": {
                  "document": "example",
                  "locator": "example",
                  "reviewedAt": "2026-10-14T13:00:00Z",
                  "reviewedBy": "example",
                  "sha256": "0123456789abcdef0123456789abcdef",
                  "status": "draft",
                  "version": "1"
                },
                "withinDays": 0
              }
            ],
            "longitudinalReview": {
              "actions": [
                "start"
              ],
              "adjustmentSelection": "latest_two_distinct",
              "applicability": "example",
              "atc": "example",
              "observation": {
                "code": "example",
                "target": {
                  "op": "gte",
                  "value": 1
                },
                "unit": "example"
              },
              "responseWindow": {
                "maxDays": 0,
                "minDays": 0
              },
              "resultSelection": "latest_in_response_window",
              "reviewWindow": {
                "amount": 0,
                "unit": "days"
              },
              "source": {
                "document": "example",
                "locator": "example",
                "reviewedAt": "2026-10-14T13:00:00Z",
                "reviewedBy": "example",
                "sha256": "0123456789abcdef0123456789abcdef",
                "status": "draft",
                "version": "1"
              },
              "sourceId": "source_01",
              "sourceKinds": [
                "medical_record"
              ]
            },
            "manual": false,
            "maxAge": 0,
            "medications": [
              {
                "actions": [
                  "start"
                ],
                "codes": [
                  "example"
                ],
                "event": "prescribed",
                "op": "present",
                "source": {
                  "document": "example",
                  "locator": "example",
                  "reviewedAt": "2026-10-14T13:00:00Z",
                  "reviewedBy": "example",
                  "sha256": "0123456789abcdef0123456789abcdef",
                  "status": "draft",
                  "version": "1"
                },
                "sourceKinds": [
                  "medical_record"
                ],
                "withinDays": 0
              }
            ],
            "minAge": 0,
            "observations": [
              {
                "code": "example",
                "count": 0,
                "minSpacingDays": 0,
                "op": "gte",
                "source": {
                  "document": "example",
                  "locator": "example",
                  "reviewedAt": "2026-10-14T13:00:00Z",
                  "reviewedBy": "example",
                  "sha256": "0123456789abcdef0123456789abcdef",
                  "status": "draft",
                  "version": "1"
                },
                "unit": "example",
                "value": 1,
                "withinDays": 0
              }
            ],
            "portfolioId": "portfolio_01",
            "requiresAll": false,
            "requiresCoverage": [
              "dispensingIncluded"
            ],
            "sex": "female"
          }
        ]
      }
    },
    "policyVersion": "1",
    "snapshotId": "snapshot_01"
  },
  "metadata": {
    "requestId": "request_01"
  },
  "success": true
}
```

- `data` (`saveCohortWorkspace.response.200.data`; object, required) — A cohort with its review policy, latest snapshot and member counts.
  - `cohort` (`saveCohortWorkspace.response.200.data.cohort`; object, required) — Cohort revision read or saved.
    - `createdAt` (`saveCohortWorkspace.response.200.data.cohort.createdAt`; string, required) — When this revision was saved (RFC 3339, UTC, millisecond precision).
    - `definition` (`saveCohortWorkspace.response.200.data.cohort.definition`; CohortDefinition, required) — Rule that selects the cohort's patients.
      - one of:
        - `object`
          - `kind` (`saveCohortWorkspace.response.200.data.cohort.definition.1.kind`; string, required)
            - one of `"curated"`
        - `object`
          - `concepts` (`saveCohortWorkspace.response.200.data.cohort.definition.2.concepts`; array<object>, required) — 1 to 8 distinct concepts; a patient needs accepted, affirmed evidence for all of them.
            - `code` (`saveCohortWorkspace.response.200.data.cohort.definition.2.concepts.code`; string, required) — Code within that system and edition (1-128 characters, matched exactly).
            - `codeSystem` (`saveCohortWorkspace.response.200.data.cohort.definition.2.concepts.codeSystem`; string, required) — Code system URI exactly as recorded on the evidence (1-200 characters).
            - `codeVersion` (`saveCohortWorkspace.response.200.data.cohort.definition.2.concepts.codeVersion`; string, required) — Code system edition exactly as recorded on the evidence (1-64 characters).
          - `kind` (`saveCohortWorkspace.response.200.data.cohort.definition.2.kind`; string, required)
            - one of `"accepted_concepts"`
    - `definitionVersion` (`saveCohortWorkspace.response.200.data.cohort.definitionVersion`; string, required) — Revision at which the status or definition last changed; title-only edits keep it.
    - `id` (`saveCohortWorkspace.response.200.data.cohort.id`; string, required) — Cohort identifier chosen at creation (opaque; lowercase letters, digits, `_`, `-`).
    - `status` (`saveCohortWorkspace.response.200.data.cohort.status`; string, required) — Lifecycle status of the current revision.
      - one of `"draft"`, `"active"`, `"retired"`
    - `title` (`saveCohortWorkspace.response.200.data.cohort.title`; string, required) — Display title (1-120 characters).
    - `version` (`saveCohortWorkspace.response.200.data.cohort.version`; string, required) — Current revision as a decimal string; each save adds 1. Send it as `expectedVersion`.
  - `counts` (`saveCohortWorkspace.response.200.data.counts`; object, required) — Member counts.
    - `asOf` (`saveCohortWorkspace.response.200.data.counts.asOf`; string, required) — Server time of the counts (RFC 3339).
    - `memberCount` (`saveCohortWorkspace.response.200.data.counts.memberCount`; integer | null, required) — Cohort: members of the latest snapshot. Program: patients currently `enrolled`. `null` when the cohort has no snapshot or the revision read is not the current one.
      - format `int64`; min 0
    - `qualifiedCount` (`saveCohortWorkspace.response.200.data.counts.qualifiedCount`; integer | null, required) — Members or enrollments whose qualification is still current; `null` as above.
      - format `int64`; min 0
    - `reviewRequiredCount` (`saveCohortWorkspace.response.200.data.counts.reviewRequiredCount`; integer | null, required) — `memberCount` minus `qualifiedCount`: entries that need review; `null` as above.
      - format `int64`; min 0
    - `scope` (`saveCohortWorkspace.response.200.data.counts.scope`; string, required) — Which patients your access covers.
      - one of `"complete_patient_registry"`, `"authorized_patients"`
  - `policy` (`saveCohortWorkspace.response.200.data.policy`; one of, required)
    - one of: `CohortPolicy`, `null`
  - `policyVersion` (`saveCohortWorkspace.response.200.data.policyVersion`; string | null, required) — Cohort revision that holds the policy; `null` without one. Send it as `policyVersion`.
  - `snapshotId` (`saveCohortWorkspace.response.200.data.snapshotId`; string | null, required) — Latest snapshot of the cohort; `null` when none. Send it as `baseSnapshotId`.
- `metadata` (`saveCohortWorkspace.response.200.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`saveCohortWorkspace.response.200.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`saveCohortWorkspace.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` (`saveCohortWorkspace.response.400.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`saveCohortWorkspace.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` (`saveCohortWorkspace.response.400.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`saveCohortWorkspace.response.400.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`saveCohortWorkspace.response.400.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`saveCohortWorkspace.response.400.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`saveCohortWorkspace.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` (`saveCohortWorkspace.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` (`saveCohortWorkspace.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` (`saveCohortWorkspace.response.400.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`saveCohortWorkspace.response.400.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`saveCohortWorkspace.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` (`saveCohortWorkspace.response.401.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`saveCohortWorkspace.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` (`saveCohortWorkspace.response.401.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`saveCohortWorkspace.response.401.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`saveCohortWorkspace.response.401.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`saveCohortWorkspace.response.401.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`saveCohortWorkspace.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` (`saveCohortWorkspace.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` (`saveCohortWorkspace.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` (`saveCohortWorkspace.response.401.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`saveCohortWorkspace.response.401.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`saveCohortWorkspace.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` (`saveCohortWorkspace.response.403.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`saveCohortWorkspace.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` (`saveCohortWorkspace.response.403.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`saveCohortWorkspace.response.403.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`saveCohortWorkspace.response.403.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`saveCohortWorkspace.response.403.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`saveCohortWorkspace.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` (`saveCohortWorkspace.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` (`saveCohortWorkspace.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` (`saveCohortWorkspace.response.403.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`saveCohortWorkspace.response.403.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`saveCohortWorkspace.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` (`saveCohortWorkspace.response.404.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`saveCohortWorkspace.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` (`saveCohortWorkspace.response.404.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`saveCohortWorkspace.response.404.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`saveCohortWorkspace.response.404.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`saveCohortWorkspace.response.404.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`saveCohortWorkspace.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` (`saveCohortWorkspace.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` (`saveCohortWorkspace.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` (`saveCohortWorkspace.response.404.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`saveCohortWorkspace.response.404.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`saveCohortWorkspace.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` (`saveCohortWorkspace.response.409.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`saveCohortWorkspace.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` (`saveCohortWorkspace.response.409.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`saveCohortWorkspace.response.409.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`saveCohortWorkspace.response.409.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`saveCohortWorkspace.response.409.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`saveCohortWorkspace.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` (`saveCohortWorkspace.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` (`saveCohortWorkspace.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` (`saveCohortWorkspace.response.409.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`saveCohortWorkspace.response.409.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`saveCohortWorkspace.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` (`saveCohortWorkspace.response.413.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`saveCohortWorkspace.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` (`saveCohortWorkspace.response.413.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`saveCohortWorkspace.response.413.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`saveCohortWorkspace.response.413.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`saveCohortWorkspace.response.413.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`saveCohortWorkspace.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` (`saveCohortWorkspace.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` (`saveCohortWorkspace.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` (`saveCohortWorkspace.response.413.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`saveCohortWorkspace.response.413.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`saveCohortWorkspace.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` (`saveCohortWorkspace.response.422.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`saveCohortWorkspace.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` (`saveCohortWorkspace.response.422.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`saveCohortWorkspace.response.422.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`saveCohortWorkspace.response.422.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`saveCohortWorkspace.response.422.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`saveCohortWorkspace.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` (`saveCohortWorkspace.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` (`saveCohortWorkspace.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` (`saveCohortWorkspace.response.422.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`saveCohortWorkspace.response.422.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`saveCohortWorkspace.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` (`saveCohortWorkspace.response.500.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`saveCohortWorkspace.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` (`saveCohortWorkspace.response.500.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`saveCohortWorkspace.response.500.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`saveCohortWorkspace.response.500.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`saveCohortWorkspace.response.500.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`saveCohortWorkspace.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` (`saveCohortWorkspace.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` (`saveCohortWorkspace.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` (`saveCohortWorkspace.response.500.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`saveCohortWorkspace.response.500.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`saveCohortWorkspace.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` (`saveCohortWorkspace.response.503.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`saveCohortWorkspace.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` (`saveCohortWorkspace.response.503.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`saveCohortWorkspace.response.503.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`saveCohortWorkspace.response.503.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`saveCohortWorkspace.response.503.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`saveCohortWorkspace.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` (`saveCohortWorkspace.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` (`saveCohortWorkspace.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` (`saveCohortWorkspace.response.503.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`saveCohortWorkspace.response.503.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`saveCohortWorkspace.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` (`saveCohortWorkspace.response.default.error`; object, required) — The stable failure code, its message and optional details.
  - `code` (`saveCohortWorkspace.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` (`saveCohortWorkspace.response.default.error.message`; string, required) — Fixed English explanation for people; it may change without notice.
  - `details` (`saveCohortWorkspace.response.default.error.details`; object, optional) — Extra data for the codes that need it; absent for every other code.
    - `commandId` (`saveCohortWorkspace.response.default.error.details.commandId`; string, optional) — Identifier (`tcm_` prefix) of the earlier team command to reconcile before retrying.
    - `lineIds` (`saveCohortWorkspace.response.default.error.details.lineIds`; array<string>, optional) — Unassigned invoice lines that prevent a unique component proposal; at most 100.
    - `module` (`saveCohortWorkspace.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` (`saveCohortWorkspace.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` (`saveCohortWorkspace.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` (`saveCohortWorkspace.response.default.metadata`; object, required) — Request metadata, including the request identifier.
  - `requestId` (`saveCohortWorkspace.response.default.metadata.requestId`; string, required) — Server-assigned request identifier (opaque). Quote it when reporting a problem.
- `success` (`saveCohortWorkspace.response.default.success`; boolean, required) — Always `false` in a failure envelope.
  - one of `false`


Source: https://docs.getarbol.com/api/ambar/save-cohort-workspace/index.md
