---
title: "Set Consultation Context"
method: POST
path: "/v1/set-consultation-context"
tags: ["Consultation"]
---

# Set Consultation Context

`POST /v1/set-consultation-context`

## Request

- Base URL: `https://scribe-api.telepatia.ai`
- URL: `https://scribe-api.telepatia.ai/v1/set-consultation-context`
- Auth: HTTP bearer

Set consultation context for a patient session.

## Request body

- SetConsultationContextRequest: Request body for setting consultation context.
  - `name` string, nullable
  - `idCountry` 'AF' | 'AX' | 'AL' | 'DZ' | 'AS' | 'AD' | 'AO' | 'AI' | 'AQ' | 'AG' | 'AR' | 'AM' | 'AW' | 'AU' | 'AT' | 'AZ' | 'BS' | 'BH' | 'BD' | 'BB' | 'BY' | 'BE' | 'BZ' | 'BJ' | 'BM' | 'BT' | 'BO' | 'BQ' | 'BA' | 'BW' | 'BV' | 'BR' | 'IO' | 'BN' | 'BG' | 'BF' | 'BI' | 'KH' | 'CM' | 'CA' | 'CV' | 'KY' | 'CF' | 'TD' | 'CL' | 'CX' | 'CC' | 'CO' | 'KM' | 'CK' | 'CR' | 'CI' | 'HR' | 'CU' | 'CW' | 'CY' | 'CZ' | 'CD' | 'DK' | 'DJ' | 'DM' | 'DO' | 'EC' | 'EG' | 'SV' | 'GQ' | 'ER' | 'EE' | 'SZ' | 'ET' | 'FK' | 'FO' | 'FJ' | 'FI' | 'FR' | 'GF' | 'PF' | 'TF' | 'GA' | 'GE' | 'DE' | 'GH' | 'GI' | 'GR' | 'GL' | 'GD' | 'GP' | 'GU' | 'GT' | 'GG' | 'GN' | 'GW' | 'GY' | 'HT' | 'HM' | 'VA' | 'HN' | 'HK' | 'HU' | 'IS' | 'IN' | 'ID' | 'IQ' | 'IE' | 'IR' | 'IM' | 'IL' | 'IT' | 'JM' | 'JP' | 'JE' | 'JO' | 'KZ' | 'KE' | 'KI' | 'XK' | 'KW' | 'KG' | 'LA' | 'LV' | 'LB' | 'LS' | 'LR' | 'LY' | 'LI' | 'LT' | 'LU' | 'MO' | 'MG' | 'MW' | 'MY' | 'MV' | 'ML' | 'MT' | 'MH' | 'MQ' | 'MR' | 'MU' | 'YT' | 'MX' | 'FM' | 'MD' | 'MC' | 'MN' | 'ME' | 'MS' | 'MA' | 'MZ' | 'MM' | 'NA' | 'NR' | 'NP' | 'NL' | 'NC' | 'NZ' | 'NI' | 'NE' | 'NG' | 'NU' | 'NF' | 'KP' | 'MP' | 'NO' | 'OM' | 'PK' | 'PW' | 'PA' | 'PG' | 'PY' | 'CN' | 'PE' | 'PH' | 'PN' | 'PL' | 'PT' | 'PR' | 'QA' | 'CG' | 'GM' | 'RE' | 'RO' | 'RU' | 'RW' | 'BL' | 'SH' | 'KN' | 'LC' | 'MF' | 'PM' | 'VC' | 'WS' | 'SM' | 'ST' | 'SA' | 'SN' | 'RS' | 'SC' | 'SL' | 'SG' | 'SX' | 'SK' | 'SI' | 'SB' | 'SO' | 'ZA' | 'GS' | 'KR' | 'SS' | 'ES' | 'LK' | 'PS' | 'SD' | 'SR' | 'SJ' | 'SE' | 'CH' | 'SY' | 'TW' | 'TJ' | 'TH' | 'MK' | 'TL' | 'TG' | 'TK' | 'TO' | 'TT' | 'TN' | 'TR' | 'TM' | 'TC' | 'TV' | 'UG' | 'UA' | 'AE' | 'GB' | 'TZ' | 'UM' | 'US' | 'UY' | 'UZ' | 'VU' | 'VE' | 'VN' | 'VG' | 'VI' | 'WF' | 'EH' | 'YE' | 'ZM' | 'ZW': ISO 3166-1 alpha-2 country codes. Mirrors tanjiro's CountryCodes enum.
  - `idType` 'CC' | 'TI' | 'CE' | 'RC' | 'PASSPORT' | 'RG' | 'CPF' | 'OTHER_DOC': Supported patient identification document types.
  - `idValue` string, nullable
  - `patientId` string, nullable: Public id of an existing patient (sp_...). When provided, the patient's stored identity is used and the inline identity fields (name, idCountry, idType, idValue) must be omitted. Mutually exclusive with the inline identity.
  - `internalCode` string, nullable: Your own patient code, unique per institution. Looks up an existing patient by this code; when none matches, the inline identity (name, idCountry, idType, idValue) creates and tags the patient at session start. Mutually exclusive with patientId.
  - `clinicalContext` ClinicalContext: Structured clinical data of the patient and the encounter: allergies, medications, conditions, the current encounter and previous encounters. See /scribe-api/consultations#clinical-context.
    - `allergies` ClinicalContextItem[]
      - `id` string, required: Your internal id of the item. It does not change between calls and it is unique in one list of one patient. Each call writes the item by this id.
      - `name` string, required: The text the AI shows. For a medication, put the dose and the frequency here.
      - `code` ClinicalContextCode: A code from one of the supported code systems.
        - `system` 'ICD10' | 'ICD11' | 'SNOMED' | 'ATC' | 'RXNORM', required: `ICD10` (conditions and diagnoses), `ICD11`, `SNOMED` (any list), `ATC` (medications and drug allergies) or `RXNORM` (medications).
        - `value` string, required
      - `status` 'ACTIVE' | 'INACTIVE' | 'ENTERED_IN_ERROR': `ACTIVE` (default): the AI shows the item. `INACTIVE`: stopped or resolved; the AI does not show it. `ENTERED_IN_ERROR`: sent by mistake; removes the item.
      - `note` string, nullable: A short note the AI shows after the name.
    - `medications` ClinicalContextItem[]
      - `id` string, required: Your internal id of the item. It does not change between calls and it is unique in one list of one patient. Each call writes the item by this id.
      - `name` string, required: The text the AI shows. For a medication, put the dose and the frequency here.
      - `code` ClinicalContextCode: A code from one of the supported code systems.
        - `system` 'ICD10' | 'ICD11' | 'SNOMED' | 'ATC' | 'RXNORM', required: `ICD10` (conditions and diagnoses), `ICD11`, `SNOMED` (any list), `ATC` (medications and drug allergies) or `RXNORM` (medications).
        - `value` string, required
      - `status` 'ACTIVE' | 'INACTIVE' | 'ENTERED_IN_ERROR': `ACTIVE` (default): the AI shows the item. `INACTIVE`: stopped or resolved; the AI does not show it. `ENTERED_IN_ERROR`: sent by mistake; removes the item.
      - `note` string, nullable: A short note the AI shows after the name.
    - `conditions` ClinicalContextItem[]
      - `id` string, required: Your internal id of the item. It does not change between calls and it is unique in one list of one patient. Each call writes the item by this id.
      - `name` string, required: The text the AI shows. For a medication, put the dose and the frequency here.
      - `code` ClinicalContextCode: A code from one of the supported code systems.
        - `system` 'ICD10' | 'ICD11' | 'SNOMED' | 'ATC' | 'RXNORM', required: `ICD10` (conditions and diagnoses), `ICD11`, `SNOMED` (any list), `ATC` (medications and drug allergies) or `RXNORM` (medications).
        - `value` string, required
      - `status` 'ACTIVE' | 'INACTIVE' | 'ENTERED_IN_ERROR': `ACTIVE` (default): the AI shows the item. `INACTIVE`: stopped or resolved; the AI does not show it. `ENTERED_IN_ERROR`: sent by mistake; removes the item.
      - `note` string, nullable: A short note the AI shows after the name.
    - `noKnownAllergies` boolean: An explicit "no known allergies". Permitted only when `allergies` has no `ACTIVE` item.
    - `noKnownMedications` boolean: An explicit "no known medications". Permitted only when `medications` has no `ACTIVE` item.
    - `currentEncounter` CurrentEncounter: The visit the clinician takes this patient into.
      - `id` string, required: Your encounter id, for example the atendimento number. Unique in your institution. For the current encounter, the `Encounter.id` of the visit you pushed for this patient.
      - `class` 'EMERGENCY' | 'AMBULATORY' | 'INPATIENT', nullable: `EMERGENCY`, `AMBULATORY` or `INPATIENT`. Use `AMBULATORY` for telemedicine. Default, on the first write of the encounter: `AMBULATORY`.
      - `diagnoses` ClinicalContextItem[]
        - `id` string, required: Your internal id of the item. It does not change between calls and it is unique in one list of one patient. Each call writes the item by this id.
        - `name` string, required: The text the AI shows. For a medication, put the dose and the frequency here.
        - `code` ClinicalContextCode: A code from one of the supported code systems.
          - `system` 'ICD10' | 'ICD11' | 'SNOMED' | 'ATC' | 'RXNORM', required: `ICD10` (conditions and diagnoses), `ICD11`, `SNOMED` (any list), `ATC` (medications and drug allergies) or `RXNORM` (medications).
          - `value` string, required
        - `status` 'ACTIVE' | 'INACTIVE' | 'ENTERED_IN_ERROR': `ACTIVE` (default): the AI shows the item. `INACTIVE`: stopped or resolved; the AI does not show it. `ENTERED_IN_ERROR`: sent by mistake; removes the item.
        - `note` string, nullable: A short note the AI shows after the name.
      - `procedures` ClinicalContextProcedure[]
        - `id` string, required
        - `name` string, required
        - `code` ClinicalContextCode: A code from one of the supported code systems.
          - `system` 'ICD10' | 'ICD11' | 'SNOMED' | 'ATC' | 'RXNORM', required: `ICD10` (conditions and diagnoses), `ICD11`, `SNOMED` (any list), `ATC` (medications and drug allergies) or `RXNORM` (medications).
          - `value` string, required
        - `status` 'ENTERED_IN_ERROR', nullable: Only `ENTERED_IN_ERROR`, to remove a procedure sent by mistake.
      - `note` string, nullable: All notes of the encounter, in time order. `null` clears the stored note; an absent `note` keeps it.
      - `startedAt` string, nullable: `YYYY-MM-DD`, or an ISO 8601 date-time with its UTC offset. Default, on the first write of the encounter: the time of the call.
      - `chiefComplaint` string, nullable
      - `triagePriority` string, nullable: In the words of your triage scale.
      - `vitals` EncounterVitals: The latest set of vital signs of the current encounter.
        - `measuredAt` string, date-time, nullable: ISO 8601 date-time with its UTC offset. Default: the time of the call.
        - `systolicBloodPressure` number, nullable: mmHg.
        - `diastolicBloodPressure` number, nullable: mmHg.
        - `heartRate` number, nullable: Beats per minute.
        - `respiratoryRate` number, nullable: Breaths per minute.
        - `temperature` number, nullable: Degrees Celsius.
        - `oxygenSaturation` number, nullable: Percent.
        - `weight` number, nullable: Kilograms.
        - `height` number, nullable: Centimeters.
        - `bloodGlucose` number, nullable: mg/dL.
        - `painScore` number, nullable: A 0 to 10 scale.
    - `previousEncounters` PreviousEncounter[]
      - `id` string, required: Your encounter id, for example the atendimento number. Unique in your institution. For the current encounter, the `Encounter.id` of the visit you pushed for this patient.
      - `class` 'EMERGENCY' | 'AMBULATORY' | 'INPATIENT', nullable: `EMERGENCY`, `AMBULATORY` or `INPATIENT`. Use `AMBULATORY` for telemedicine. Default, on the first write of the encounter: `AMBULATORY`.
      - `diagnoses` ClinicalContextItem[]
        - `id` string, required: Your internal id of the item. It does not change between calls and it is unique in one list of one patient. Each call writes the item by this id.
        - `name` string, required: The text the AI shows. For a medication, put the dose and the frequency here.
        - `code` ClinicalContextCode: A code from one of the supported code systems.
          - `system` 'ICD10' | 'ICD11' | 'SNOMED' | 'ATC' | 'RXNORM', required: `ICD10` (conditions and diagnoses), `ICD11`, `SNOMED` (any list), `ATC` (medications and drug allergies) or `RXNORM` (medications).
          - `value` string, required
        - `status` 'ACTIVE' | 'INACTIVE' | 'ENTERED_IN_ERROR': `ACTIVE` (default): the AI shows the item. `INACTIVE`: stopped or resolved; the AI does not show it. `ENTERED_IN_ERROR`: sent by mistake; removes the item.
        - `note` string, nullable: A short note the AI shows after the name.
      - `procedures` ClinicalContextProcedure[]
        - `id` string, required
        - `name` string, required
        - `code` ClinicalContextCode: A code from one of the supported code systems.
          - `system` 'ICD10' | 'ICD11' | 'SNOMED' | 'ATC' | 'RXNORM', required: `ICD10` (conditions and diagnoses), `ICD11`, `SNOMED` (any list), `ATC` (medications and drug allergies) or `RXNORM` (medications).
          - `value` string, required
        - `status` 'ENTERED_IN_ERROR', nullable: Only `ENTERED_IN_ERROR`, to remove a procedure sent by mistake.
      - `note` string, nullable: All notes of the encounter, in time order. `null` clears the stored note; an absent `note` keeps it.
      - `startedAt` string, required: `YYYY-MM-DD`, or an ISO 8601 date-time with its UTC offset.
  - `notes` string, nullable
  - `pastMedicalHistory` string, nullable
  - `consultationInternalId` string, nullable
  - `scribeSessionModality` 'IN_PERSON' | 'TELEMEDICINE' | 'DICTATION': Supported scribe session modalities.
  - `institutionalBranchId` string, nullable: Id of the institution branch for this consultation, returned by the create-branch endpoint. Stamped onto the scribe session at creation. Provide the id or the name.
  - `institutionalBranch` string, nullable: Name of the institution branch for this consultation. Resolved when institutionalBranchId is not provided. Provide the id or the name.
  - `scribeSessionConfigurationId` string, nullable: Public id of a scribe session configuration (`ssc_` + 16 chars `[a-z0-9]`). Mutually exclusive with `medicalRecordConfigurationId` and `medicalRecordConfiguration`.
  - `medicalRecordConfigurationId` string, nullable: Public id of a medical record configuration (`mrc_` + 16 chars `[a-z0-9]`). Mutually exclusive with `scribeSessionConfigurationId` and `medicalRecordConfiguration`.
  - `medicalRecordConfiguration` object, nullable: Inline medical record configuration JSON keyed by section name (e.g. 'chiefComplaint'). Auto-persisted and deduplicated by content hash; the resolved configuration id is attached to the doctor context buffer. Mutually exclusive with `medicalRecordConfigurationId` and `scribeSessionConfigurationId`.

## Response `200`

Successful Response

- SetConsultationContextResponse: Response body for setting consultation context.
  - `success` boolean, required
  - `consultationInternalId` string, required

## Other responses

- `400`: Bad Request — invalid parameters, validation failures, or missing fields.
- `401`: Unauthorized — missing or invalid API key.
- `403`: Forbidden — the API key is not allowed to perform this operation.
- `404`: Not Found — the requested resource does not exist.
- `409`: Conflict — resource already exists or is in a conflicting state.
- `413`: Content Too Large
- `503`: Service Unavailable — an external dependency is down.

---

[API](https://skmtc.dev/telepatia/apis/scribe-public-api.md) - [All operations](https://skmtc.dev/telepatia/apis/scribe-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/telepatia/apis/scribe-public-api/revisions/be963942e472?raw)
