# Generate a note asynchronously

```
POST 
/generate-note-async
```

Creates an asynchronous task (also called asynchronous request) that will generate a structured clinical note given the transcript, then keeps the response for a short period to be fetched using the poll endpoint.

## Request[​](#request "Direct link to Request")

* application/json

### Body**required**

* **note\_locale**copilot\_note\_locale (string)required

  Locale of the note.

  **Possible values:** \[`en-US`, `en-GB`, `fr-FR`]

  **Example:<!-- -->&#x20;**`en-US`

  ******transcript\_items** object\[]required

  The transcript from which to generate the note. You don't need to specify each item's start or end time, but make sure they are sorted. In fact, due to its asynchronous nature, our \[real-time transcription API]\(/core-api/reference/2024-04-22/server/copilot-listen-ws) does not guarantee its results order. Thus, before calling this note-generation API please \*\*filter-out non-final items and sort them by \`start\_offset\_ms\`\*\*.

  Array \[

* **text**stringrequired

  The transcribed text.

  **Example:<!-- -->&#x20;**`Also, I’m allergic to peanuts.`

  **speaker**copilot\_speaker (string)required

  Who said the text in this transcript item.

  **Possible values:** \[`doctor`, `patient`, `unspecified`]

  **Example:<!-- -->&#x20;**`doctor`

  ]

* **note\_template**copilot\_note\_template (string)

  The template used to generate the note.

  Some templates are **only available in specific languages**. Check [Note template](/core-api/guides/note-templates-sections-legacy-2024-10-01) for details.

  **Possible values:** \[`GENERAL_MEDICINE`, `GENERAL_MEDICINE_AP_MERGED`, `CARDIOLOGY`, `PSYCHIATRY`, `DIET`, `PSYCHOLOGY`, `SOAP`, `GENERAL_MEDICINE_WCC`, `SOAP_WCC`, `GENERAL_MEDICINE_EMERGENCY`, `SOAP_EMERGENCY`]

  **Example:<!-- -->&#x20;**`GENERAL_MEDICINE`

  ******note\_sections\_customization** object\[]

  Advanced per-section customization options for the chosen template. You should \*\*only specify sections that belong to the given template\*\*, and \*\*only specify customization options that are supported for the given section\*\*. Also, only specify sections you want to customize, no need to be exhaustive. Check \[Note templates sections]\(/core-api/guides/note-templates-sections-legacy-2024-10-01#per-section-customization-options) for compatibility matrix.

  Array \[

* **section\_key**copilot\_note\_section\_key (string)required

  A key identifying a section of a note. The set of possible keys depend on the template that is used. Check [Note template](/core-api/guides/note-templates-sections-legacy-2024-10-01) for possible values.

  **Possible values:** \[`ALLERGIES`, `APPOINTMENTS`, `ASSESSMENT`, `ASSESSMENT_AND_PLAN`, `CARDIOVASCULAR_RISKS`, `CHIEF_COMPLAINT`, `CURRENT_MEDICATIONS`, `DIET_APPOINTMENTS`, `DIET_CHIEF_COMPLAINT`, `DIET_HABITS`, `DIET_LIFESTYLE`, `DIET_MEDICAL_HISTORY`, `DIET_OBJECTIVES`, `DIET_VITALS`, `FAMILY_HISTORY`, `HISTORY_OF_PRESENT_ILLNESS`, `IMAGING_RESULTS`, `IMMUNIZATIONS`, `LAB_RESULTS`, `MENTAL_HEALTH_EXAM`, `MENTAL_HEALTH_HISTORY`, `PAST_MEDICAL_HISTORY`, `PAST_OBSTETRIC_HISTORY`, `PAST_SURGICAL_HISTORY`, `PHYSICAL_EXAM`, `PLAN`, `PRESCRIPTION`, `PSYCHOLOGY_HISTORY_OF_COMPLAINT`, `SOAP_ASSESSMENT`, `SOAP_OBJECTIVE`, `SOAP_PLAN`, `SOAP_SUBJECTIVE`, `SOCIAL_HISTORY`, `VITALS`, `WELL_CHILD_CARE`]

  **Example:<!-- -->&#x20;**`CHIEF_COMPLAINT`

  **style**copilot\_note\_section\_customization\_section\_style (string)

  Specifies the desired style for the note section:

  • `PARAGRAPH`: Prioritizes generating paragraphs;

  • `BULLET_POINTS`: Prioritizes structuring content using bullet points.

  • `AUTO`: Automatically picks the most natural formatting option.

  Default is `AUTO`.

  **Possible values:** \[`AUTO`, `PARAGRAPH`, `BULLET_POINTS`]

  **Example:<!-- -->&#x20;**`PARAGRAPHS`

  **level\_of\_detail**copilot\_note\_section\_customization\_level\_of\_detail (string)

  Specifies the desired level of details. Use `detailed` to get more details in the note section.

  **Possible values:** \[`DEFAULT`, `DETAILED`]

  **split\_by\_problem**boolean

  Flag to structure the content of the note sections according to distinct clinical problems or topics addressed during the consultation.

  ]

* ******previous\_note** object

  Optional initial Note to be enhanced using the new \`transcript\_items\`. This is useful if you generate notes gradually to avoid accumulating a very long transcript items list. Typically, this will be the last note Nabla generated for you along with the new \`transcript\_items\` that did not serve for its generation. \*\*Important\*\*: This is expected to be a recent (up to few-hours old) Nabla-generated note. If the note is too old or altered, you might get an error.

  ******sections** object\[]required

  Sections of the note.

  Array \[

* **key**copilot\_note\_section\_key (string)required

  A key identifying a section of a note. The set of possible keys depend on the template that is used. Check [Note template](/core-api/guides/note-templates-sections-legacy-2024-10-01) for possible values.

  **Possible values:** \[`ALLERGIES`, `APPOINTMENTS`, `ASSESSMENT`, `ASSESSMENT_AND_PLAN`, `CARDIOVASCULAR_RISKS`, `CHIEF_COMPLAINT`, `CURRENT_MEDICATIONS`, `DIET_APPOINTMENTS`, `DIET_CHIEF_COMPLAINT`, `DIET_HABITS`, `DIET_LIFESTYLE`, `DIET_MEDICAL_HISTORY`, `DIET_OBJECTIVES`, `DIET_VITALS`, `FAMILY_HISTORY`, `HISTORY_OF_PRESENT_ILLNESS`, `IMAGING_RESULTS`, `IMMUNIZATIONS`, `LAB_RESULTS`, `MENTAL_HEALTH_EXAM`, `MENTAL_HEALTH_HISTORY`, `PAST_MEDICAL_HISTORY`, `PAST_OBSTETRIC_HISTORY`, `PAST_SURGICAL_HISTORY`, `PHYSICAL_EXAM`, `PLAN`, `PRESCRIPTION`, `PSYCHOLOGY_HISTORY_OF_COMPLAINT`, `SOAP_ASSESSMENT`, `SOAP_OBJECTIVE`, `SOAP_PLAN`, `SOAP_SUBJECTIVE`, `SOCIAL_HISTORY`, `VITALS`, `WELL_CHILD_CARE`]

  **Example:<!-- -->&#x20;**`CHIEF_COMPLAINT`

  **title**stringrequired

  The section title.

  **Example:<!-- -->&#x20;**`Chief complaint`

  **text**string

  Content of the note section (required).

  **Example:<!-- -->&#x20;**`Sleep disorder`

  ]

  **patient\_context**string

  Some contextual information that will be used to generate the note (for example name, gender, age, pronouns, medical history) \[BETA].

  **Possible values:** `<= 700 characters`

  **client\_request\_id**copilot\_client\_request\_id (string)

  An optional unique client-made id for this request. When specified, this id is included in the Json payload that will be sent asynchronously. This can help clients both guarantee idempotency and correlate asynchronous responses with their requests.

  *Note*: this id must be different for every request. It is recommended to use a randomly generated UUID.

  **Possible values:** `<= 128 characters`

## Responses[​](#responses "Direct link to Responses")

* 200

Request received and processing started.

* application/json

- Schema
- Example (from schema)

**Schema**

* oneOf

  * async\_request\_ongoing
  * async\_request\_failed
  * async\_note\_generation\_succeeded

  **id**uuidrequired

  The id of the asynchronous request.

  **Example:<!-- -->&#x20;**`98FCE1EF-DBCA-41EF-8BC7-4D1621AC07C6`

  **client\_request\_id**copilot\_client\_request\_id (string)

  An optional unique client-made id for this request. When specified, this id is included in the Json payload that will be sent asynchronously. This can help clients both guarantee idempotency and correlate asynchronous responses with their requests.

  *Note*: this id must be different for every request. It is recommended to use a randomly generated UUID.

  **Possible values:** `<= 128 characters`

  **status**async\_request\_status (string)required

  **Possible values:** \[`ongoing`, `failed`, `succeeded`]

  **id**uuidrequired

  The id of the asynchronous request.

  **Example:<!-- -->&#x20;**`98FCE1EF-DBCA-41EF-8BC7-4D1621AC07C6`

  **client\_request\_id**copilot\_client\_request\_id (string)

  An optional unique client-made id for this request. When specified, this id is included in the Json payload that will be sent asynchronously. This can help clients both guarantee idempotency and correlate asynchronous responses with their requests.

  *Note*: this id must be different for every request. It is recommended to use a randomly generated UUID.

  **Possible values:** `<= 128 characters`

  **status**async\_request\_status (string)required

  **Possible values:** \[`ongoing`, `failed`, `succeeded`]

  ******payload**objectrequired

  **error\_code**integerrequired

  **Example:<!-- -->&#x20;**`422`

  **error\_message**string

  **Example:<!-- -->&#x20;**`We can't generate the note when the transcript is too short.`

  **id**uuidrequired

  The id of the asynchronous request.

  **Example:<!-- -->&#x20;**`98FCE1EF-DBCA-41EF-8BC7-4D1621AC07C6`

  **client\_request\_id**copilot\_client\_request\_id (string)

  An optional unique client-made id for this request. When specified, this id is included in the Json payload that will be sent asynchronously. This can help clients both guarantee idempotency and correlate asynchronous responses with their requests.

  *Note*: this id must be different for every request. It is recommended to use a randomly generated UUID.

  **Possible values:** `<= 128 characters`

  **status**async\_request\_status (string)required

  **Possible values:** \[`ongoing`, `failed`, `succeeded`]

  ******payload**object

  The generated note.

  ******note**objectrequired

  The generated note.

  **title**string

  Title of the note.

  **Example:<!-- -->&#x20;**`Fever and strong headache`

  ******sections**object\[]required

  Content of the note structured in multiple sections.

  Array \[

* **key**copilot\_note\_section\_key (string)required

  A key identifying a section of a note. The set of possible keys depend on the template that is used. Check [Note template](/core-api/guides/note-templates-sections-legacy-2024-10-01) for possible values.

  **Possible values:** \[`ALLERGIES`, `APPOINTMENTS`, `ASSESSMENT`, `ASSESSMENT_AND_PLAN`, `CARDIOVASCULAR_RISKS`, `CHIEF_COMPLAINT`, `CURRENT_MEDICATIONS`, `DIET_APPOINTMENTS`, `DIET_CHIEF_COMPLAINT`, `DIET_HABITS`, `DIET_LIFESTYLE`, `DIET_MEDICAL_HISTORY`, `DIET_OBJECTIVES`, `DIET_VITALS`, `FAMILY_HISTORY`, `HISTORY_OF_PRESENT_ILLNESS`, `IMAGING_RESULTS`, `IMMUNIZATIONS`, `LAB_RESULTS`, `MENTAL_HEALTH_EXAM`, `MENTAL_HEALTH_HISTORY`, `PAST_MEDICAL_HISTORY`, `PAST_OBSTETRIC_HISTORY`, `PAST_SURGICAL_HISTORY`, `PHYSICAL_EXAM`, `PLAN`, `PRESCRIPTION`, `PSYCHOLOGY_HISTORY_OF_COMPLAINT`, `SOAP_ASSESSMENT`, `SOAP_OBJECTIVE`, `SOAP_PLAN`, `SOAP_SUBJECTIVE`, `SOCIAL_HISTORY`, `VITALS`, `WELL_CHILD_CARE`]

  **Example:<!-- -->&#x20;**`CHIEF_COMPLAINT`

  **title**stringrequired

  The section title.

  **Example:<!-- -->&#x20;**`Chief complaint`

  **text**stringrequired

  Content of the note section.

  **Example:<!-- -->&#x20;**`Sleep disorder`

  ]

* ******suggested\_dot\_phrases**object\[]

  A collection of Dot Phrases that were successfully matched to the encounter's transcript, given the Dot Phrases defined on the calling user. Will be null in the context of a Server API call (i.e. no calling user). This functionality enriches the generated note by expanding concise key sentences (triggers) into a more detailed format following the given Dot Phrase definition. Thus, enhancing the depth and utility of the note and facilitating a comprehensive review of patient assessments in a structured and conventional manner.

  Array \[

* ******dot\_phrase**object

  Dot phrase, also referred to as EHR (Electronic Health Record) macro, is a concise abbreviation (\`trigger\`) that unfolds into a predefined, extended text (\`replacement\`).

  **id**uuidrequired

  Unique identifier of the Dot Phrase.

  **title**stringrequired

  A user-friendly title for the Dot Phrase. Does not impact the matching logic.

  **Example:<!-- -->&#x20;**`Normal physical exam`

  **trigger**stringrequired

  The text which, if present in the transcript, will prompt the suggestion of this Dot Phrase.

  **Example:<!-- -->&#x20;**`Your physical exam is normal`

  **content\_auto\_update\_enabled**booleanrequired

  If true, whenever this dot phrase is suggested, the replacement text will be automatically updated based on the encounter discussion.

  **Example:<!-- -->&#x20;**`false`

  **replacement**stringrequired

  The replacement text for this Dot Phrase. If the Dot Phrase's trigger is detected, this text will be suggested in the note generation's response.

  **Example:<!-- -->&#x20;**`- Heart Examination: Normal, with regular rate and rhythm, no murmurs. - Lung Assessment: Normal breath sounds, no wheezes, crackles, or rhonchi. - Abdominal Evaluation: Normal, no tenderness, masses, or hepatosplenomegaly.`

  ******note\_section**object

  **key**copilot\_note\_section\_key (string)required

  A key identifying a section of a note. The set of possible keys depend on the template that is used. Check [Note template](/core-api/guides/note-templates-sections-legacy-2024-10-01) for possible values.

  **Possible values:** \[`ALLERGIES`, `APPOINTMENTS`, `ASSESSMENT`, `ASSESSMENT_AND_PLAN`, `CARDIOVASCULAR_RISKS`, `CHIEF_COMPLAINT`, `CURRENT_MEDICATIONS`, `DIET_APPOINTMENTS`, `DIET_CHIEF_COMPLAINT`, `DIET_HABITS`, `DIET_LIFESTYLE`, `DIET_MEDICAL_HISTORY`, `DIET_OBJECTIVES`, `DIET_VITALS`, `FAMILY_HISTORY`, `HISTORY_OF_PRESENT_ILLNESS`, `IMAGING_RESULTS`, `IMMUNIZATIONS`, `LAB_RESULTS`, `MENTAL_HEALTH_EXAM`, `MENTAL_HEALTH_HISTORY`, `PAST_MEDICAL_HISTORY`, `PAST_OBSTETRIC_HISTORY`, `PAST_SURGICAL_HISTORY`, `PHYSICAL_EXAM`, `PLAN`, `PRESCRIPTION`, `PSYCHOLOGY_HISTORY_OF_COMPLAINT`, `SOAP_ASSESSMENT`, `SOAP_OBJECTIVE`, `SOAP_PLAN`, `SOAP_SUBJECTIVE`, `SOCIAL_HISTORY`, `VITALS`, `WELL_CHILD_CARE`]

  **Example:<!-- -->&#x20;**`CHIEF_COMPLAINT`

  **title**stringrequired

  Section title.

  **Example:<!-- -->&#x20;**`Assessment & Plan.`

  **text\_to\_insert**stringrequired

  The actual suggested content, to be inserted in the corresponding note section. Please note that the content might be different from the replacement in the original Dot Phrase definition. In fact, the `text_to_insert` takes into account the contextual information of the encounter and might change the original Dot Phrase replacement text, for instance to include exceptions.

  **Example:<!-- -->&#x20;**`- Heart Examination: Normal, with regular rate and rhythm, no murmurs. - Lung Assessment: Normal breath sounds, no wheezes, crackles, or rhonchi. - Abdominal Evaluation: Normal, no tenderness, masses, or hepatosplenomegaly.`

  ]

```
{}
```

## Operation spec

```json
{
  "method": "post",
  "path": "/generate-note-async",
  "operationId": "generate-note-async",
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "allOf": [
            {
              "type": "object",
              "description": "Input for note generation.",
              "properties": {
                "note_locale": {
                  "type": "string",
                  "description": "Locale of the note.",
                  "enum": [
                    "en-US",
                    "en-GB",
                    "fr-FR"
                  ],
                  "example": "en-US",
                  "title": "copilot_note_locale"
                },
                "transcript_items": {
                  "type": "array",
                  "description": "The transcript from which to generate the note.\n\nYou don't need to specify each item's start or end time, but make sure they are sorted. In fact, due to its asynchronous nature, our [real-time transcription API](/server/copilot-listen-ws) does not guarantee its results order. Thus, before calling this note-generation API please **filter-out non-final items and sort them by `start_offset_ms`**.",
                  "items": {
                    "type": "object",
                    "description": "A portion of the transcribed consultation.",
                    "properties": {
                      "text": {
                        "type": "string",
                        "description": "The transcribed text.",
                        "example": "Also, I’m allergic to peanuts."
                      },
                      "speaker": {
                        "type": "string",
                        "enum": [
                          "doctor",
                          "patient",
                          "unspecified"
                        ],
                        "description": "Who said the text in this transcript item.",
                        "example": "doctor",
                        "title": "copilot_speaker"
                      }
                    },
                    "required": [
                      "text",
                      "speaker"
                    ],
                    "title": "copilot_transcript_item_request"
                  }
                },
                "note_template": {
                  "type": "string",
                  "enum": [
                    "GENERAL_MEDICINE",
                    "GENERAL_MEDICINE_AP_MERGED",
                    "CARDIOLOGY",
                    "PSYCHIATRY",
                    "DIET",
                    "PSYCHOLOGY",
                    "SOAP",
                    "GENERAL_MEDICINE_WCC",
                    "SOAP_WCC",
                    "GENERAL_MEDICINE_EMERGENCY",
                    "SOAP_EMERGENCY"
                  ],
                  "description": "The desired template of the generated note.\n\nSome templates are **only available in specific languages**. Check [Note template](/guides/note-templates-sections) for details.",
                  "example": "GENERAL_MEDICINE",
                  "title": "copilot_note_template"
                },
                "note_sections_customization": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "section_key": {
                        "type": "string",
                        "description": "A key identifying a section of a note.\nThe set of possible keys depend on the template that is used. Check [Note template](/guides/note-templates-sections) for possible values.",
                        "example": "CHIEF_COMPLAINT",
                        "enum": [
                          "ALLERGIES",
                          "APPOINTMENTS",
                          "ASSESSMENT",
                          "ASSESSMENT_AND_PLAN",
                          "CARDIOVASCULAR_RISKS",
                          "CHIEF_COMPLAINT",
                          "CURRENT_MEDICATIONS",
                          "DIET_APPOINTMENTS",
                          "DIET_CHIEF_COMPLAINT",
                          "DIET_HABITS",
                          "DIET_LIFESTYLE",
                          "DIET_MEDICAL_HISTORY",
                          "DIET_OBJECTIVES",
                          "DIET_VITALS",
                          "FAMILY_HISTORY",
                          "HISTORY_OF_PRESENT_ILLNESS",
                          "IMAGING_RESULTS",
                          "IMMUNIZATIONS",
                          "LAB_RESULTS",
                          "MENTAL_HEALTH_EXAM",
                          "MENTAL_HEALTH_HISTORY",
                          "PAST_MEDICAL_HISTORY",
                          "PAST_OBSTETRIC_HISTORY",
                          "PAST_SURGICAL_HISTORY",
                          "PHYSICAL_EXAM",
                          "PLAN",
                          "PRESCRIPTION",
                          "PSYCHOLOGY_HISTORY_OF_COMPLAINT",
                          "SOAP_ASSESSMENT",
                          "SOAP_OBJECTIVE",
                          "SOAP_PLAN",
                          "SOAP_SUBJECTIVE",
                          "SOCIAL_HISTORY",
                          "VITALS",
                          "WELL_CHILD_CARE"
                        ],
                        "title": "copilot_note_section_key"
                      },
                      "style": {
                        "type": "string",
                        "enum": [
                          "AUTO",
                          "PARAGRAPH",
                          "BULLET_POINTS"
                        ],
                        "example": "PARAGRAPHS",
                        "description": "Specifies the desired style for the note section:\n\n  • `PARAGRAPH`: Prioritizes generating paragraphs;\n\n  • `BULLET_POINTS`: Prioritizes structuring content using bullet points.\n\n  • `AUTO`: Automatically picks the most natural formatting option.\n\nDefault is `AUTO`.",
                        "title": "copilot_note_section_customization_section_style"
                      },
                      "level_of_detail": {
                        "type": "string",
                        "enum": [
                          "DEFAULT",
                          "DETAILED"
                        ],
                        "description": "Specifies the desired level of details. Use `detailed` to get more details in the note section.",
                        "title": "copilot_note_section_customization_level_of_detail"
                      },
                      "split_by_problem": {
                        "type": "boolean",
                        "description": "Flag to structure the content of the note sections according to distinct clinical problems or topics addressed during the consultation."
                      }
                    },
                    "required": [
                      "section_key"
                    ],
                    "title": "copilot_note_section_customization_request"
                  },
                  "description": "Advanced per-section customization options for the chosen template.\n\nYou should **only specify sections that belong to the given template**, and **only specify customization options that are supported for the given section**. Also, only specify sections you want to customize, no need to be exhaustive.\n\n\nCheck [Note templates sections](/guides/note-templates-sections#per-section-customization-options) for compatibility matrix."
                },
                "previous_note": {
                  "description": "Optional initial Note to be enhanced using the new `transcript_items`.\nThis is useful if you generate notes gradually to avoid accumulating a very long transcript items list.\nTypically, this will be the last note Nabla generated for you along with the new `transcript_items` that did not serve for its generation.\n**Important**: This is expected to be a recent (up to few-hours old) Nabla-generated note. If the note is too old or altered, you might get an error.",
                  "type": "object",
                  "properties": {
                    "sections": {
                      "type": "array",
                      "description": "Sections of the note.",
                      "items": {
                        "type": "object",
                        "description": "A note section.",
                        "properties": {
                          "key": {
                            "type": "string",
                            "description": "A key identifying a section of a note.\nThe set of possible keys depend on the template that is used. Check [Note template](/guides/note-templates-sections) for possible values.",
                            "example": "CHIEF_COMPLAINT",
                            "enum": [
                              "ALLERGIES",
                              "APPOINTMENTS",
                              "ASSESSMENT",
                              "ASSESSMENT_AND_PLAN",
                              "CARDIOVASCULAR_RISKS",
                              "CHIEF_COMPLAINT",
                              "CURRENT_MEDICATIONS",
                              "DIET_APPOINTMENTS",
                              "DIET_CHIEF_COMPLAINT",
                              "DIET_HABITS",
                              "DIET_LIFESTYLE",
                              "DIET_MEDICAL_HISTORY",
                              "DIET_OBJECTIVES",
                              "DIET_VITALS",
                              "FAMILY_HISTORY",
                              "HISTORY_OF_PRESENT_ILLNESS",
                              "IMAGING_RESULTS",
                              "IMMUNIZATIONS",
                              "LAB_RESULTS",
                              "MENTAL_HEALTH_EXAM",
                              "MENTAL_HEALTH_HISTORY",
                              "PAST_MEDICAL_HISTORY",
                              "PAST_OBSTETRIC_HISTORY",
                              "PAST_SURGICAL_HISTORY",
                              "PHYSICAL_EXAM",
                              "PLAN",
                              "PRESCRIPTION",
                              "PSYCHOLOGY_HISTORY_OF_COMPLAINT",
                              "SOAP_ASSESSMENT",
                              "SOAP_OBJECTIVE",
                              "SOAP_PLAN",
                              "SOAP_SUBJECTIVE",
                              "SOCIAL_HISTORY",
                              "VITALS",
                              "WELL_CHILD_CARE"
                            ],
                            "title": "copilot_note_section_key"
                          },
                          "title": {
                            "type": "string",
                            "description": "The section title.",
                            "example": "Chief complaint"
                          },
                          "text": {
                            "type": "string",
                            "description": "Content of the note section (required).",
                            "example": "Sleep disorder"
                          }
                        },
                        "required": [
                          "key",
                          "title"
                        ],
                        "title": "copilot_note_section_request"
                      }
                    }
                  },
                  "required": [
                    "sections"
                  ],
                  "title": "copilot_note_request"
                },
                "patient_context": {
                  "type": "string",
                  "description": "Some contextual information that will be used to generate the note (for example name, gender, age, pronouns, medical history) [BETA].",
                  "maxLength": 700
                }
              },
              "required": [
                "transcript_items",
                "note_locale"
              ],
              "title": "generate_note_request"
            },
            {
              "type": "object",
              "properties": {
                "client_request_id": {
                  "type": "string",
                  "maxLength": 128,
                  "description": "An optional unique client-made id for this request. When specified, this id is included in  the Json payload that will be sent asynchronously. This can help clients both guarantee idempotency and correlate asynchronous responses with their requests.\n\n_Note_: this id must be different for every request. It is recommended to use a randomly generated UUID.",
                  "title": "copilot_client_request_id"
                }
              }
            }
          ],
          "title": "generate_note_async_request"
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "Request received and processing started.",
      "content": {
        "application/json": {
          "schema": {
            "oneOf": [
              {
                "type": "object",
                "required": [
                  "id",
                  "status"
                ],
                "title": "async_request_ongoing"
              },
              {
                "type": "object",
                "required": [
                  "id",
                  "status",
                  "payload"
                ],
                "title": "async_request_failed"
              },
              {
                "type": "object",
                "required": [
                  "id",
                  "status"
                ],
                "title": "async_note_generation_succeeded"
              }
            ],
            "discriminator": {
              "propertyName": "status",
              "mapping": {
                "ongoing": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "description": "The id of the asynchronous request.",
                      "type": "string",
                      "format": "uuid",
                      "example": "98FCE1EF-DBCA-41EF-8BC7-4D1621AC07C6",
                      "title": "uuid"
                    },
                    "client_request_id": {
                      "type": "string",
                      "maxLength": 128,
                      "description": "An optional unique client-made id for this request. When specified, this id is included in  the Json payload that will be sent asynchronously. This can help clients both guarantee idempotency and correlate asynchronous responses with their requests.\n\n_Note_: this id must be different for every request. It is recommended to use a randomly generated UUID.",
                      "title": "copilot_client_request_id"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "ongoing",
                        "failed",
                        "succeeded"
                      ],
                      "title": "async_request_status"
                    }
                  },
                  "required": [
                    "id",
                    "status"
                  ],
                  "title": "async_request_ongoing"
                },
                "failed": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "description": "The id of the asynchronous request.",
                      "type": "string",
                      "format": "uuid",
                      "example": "98FCE1EF-DBCA-41EF-8BC7-4D1621AC07C6",
                      "title": "uuid"
                    },
                    "client_request_id": {
                      "type": "string",
                      "maxLength": 128,
                      "description": "An optional unique client-made id for this request. When specified, this id is included in  the Json payload that will be sent asynchronously. This can help clients both guarantee idempotency and correlate asynchronous responses with their requests.\n\n_Note_: this id must be different for every request. It is recommended to use a randomly generated UUID.",
                      "title": "copilot_client_request_id"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "ongoing",
                        "failed",
                        "succeeded"
                      ],
                      "title": "async_request_status"
                    },
                    "payload": {
                      "type": "object",
                      "properties": {
                        "error_code": {
                          "type": "integer",
                          "example": 422
                        },
                        "error_message": {
                          "type": "string",
                          "example": "We can't generate the note when the transcript is too short."
                        }
                      },
                      "required": [
                        "error_code"
                      ],
                      "title": "async_request_failed_payload"
                    }
                  },
                  "required": [
                    "id",
                    "status",
                    "payload"
                  ],
                  "title": "async_request_failed"
                },
                "succeeded": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "description": "The id of the asynchronous request.",
                      "type": "string",
                      "format": "uuid",
                      "example": "98FCE1EF-DBCA-41EF-8BC7-4D1621AC07C6",
                      "title": "uuid"
                    },
                    "client_request_id": {
                      "type": "string",
                      "maxLength": 128,
                      "description": "An optional unique client-made id for this request. When specified, this id is included in  the Json payload that will be sent asynchronously. This can help clients both guarantee idempotency and correlate asynchronous responses with their requests.\n\n_Note_: this id must be different for every request. It is recommended to use a randomly generated UUID.",
                      "title": "copilot_client_request_id"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "ongoing",
                        "failed",
                        "succeeded"
                      ],
                      "title": "async_request_status"
                    },
                    "payload": {
                      "type": "object",
                      "description": "The generated note.",
                      "required": [
                        "note"
                      ],
                      "properties": {
                        "note": {
                          "type": "object",
                          "description": "The generated note.",
                          "properties": {
                            "title": {
                              "type": "string",
                              "description": "Title of the note.",
                              "example": "Fever and strong headache"
                            },
                            "sections": {
                              "type": "array",
                              "description": "Content of the note structured in multiple sections.",
                              "items": {
                                "type": "object",
                                "description": "A note section.",
                                "properties": {
                                  "key": {
                                    "type": "string",
                                    "description": "A key identifying a section of a note.\nThe set of possible keys depend on the template that is used. Check [Note template](/guides/note-templates-sections) for possible values.",
                                    "example": "CHIEF_COMPLAINT",
                                    "enum": [
                                      "ALLERGIES",
                                      "APPOINTMENTS",
                                      "ASSESSMENT",
                                      "ASSESSMENT_AND_PLAN",
                                      "CARDIOVASCULAR_RISKS",
                                      "CHIEF_COMPLAINT",
                                      "CURRENT_MEDICATIONS",
                                      "DIET_APPOINTMENTS",
                                      "DIET_CHIEF_COMPLAINT",
                                      "DIET_HABITS",
                                      "DIET_LIFESTYLE",
                                      "DIET_MEDICAL_HISTORY",
                                      "DIET_OBJECTIVES",
                                      "DIET_VITALS",
                                      "FAMILY_HISTORY",
                                      "HISTORY_OF_PRESENT_ILLNESS",
                                      "IMAGING_RESULTS",
                                      "IMMUNIZATIONS",
                                      "LAB_RESULTS",
                                      "MENTAL_HEALTH_EXAM",
                                      "MENTAL_HEALTH_HISTORY",
                                      "PAST_MEDICAL_HISTORY",
                                      "PAST_OBSTETRIC_HISTORY",
                                      "PAST_SURGICAL_HISTORY",
                                      "PHYSICAL_EXAM",
                                      "PLAN",
                                      "PRESCRIPTION",
                                      "PSYCHOLOGY_HISTORY_OF_COMPLAINT",
                                      "SOAP_ASSESSMENT",
                                      "SOAP_OBJECTIVE",
                                      "SOAP_PLAN",
                                      "SOAP_SUBJECTIVE",
                                      "SOCIAL_HISTORY",
                                      "VITALS",
                                      "WELL_CHILD_CARE"
                                    ],
                                    "title": "copilot_note_section_key"
                                  },
                                  "title": {
                                    "type": "string",
                                    "description": "The section title.",
                                    "example": "Chief complaint"
                                  },
                                  "text": {
                                    "type": "string",
                                    "description": "Content of the note section.",
                                    "example": "Sleep disorder"
                                  }
                                },
                                "required": [
                                  "key",
                                  "title",
                                  "text"
                                ],
                                "title": "copilot_note_section"
                              }
                            }
                          },
                          "required": [
                            "sections"
                          ],
                          "example": [
                            {
                              "key": "CHIEF_COMPLAINT",
                              "title": "Chief complaint",
                              "text": "Fatigue and headaches"
                            },
                            {
                              "key": "SYMPTOMS",
                              "title": "Symptoms",
                              "text": "- Tiredness all day long\n- Mild headaches on the right side"
                            }
                          ],
                          "title": "copilot_note"
                        },
                        "suggested_dot_phrases": {
                          "type": "array",
                          "description": "A collection of Dot Phrases that were successfully matched to the encounter's transcript, given the Dot Phrases defined on the calling user. Will be null in the context of a Server API call (i.e. no calling user).\nThis functionality enriches the generated note by expanding concise key sentences (triggers) into a more detailed format following the given Dot Phrase definition.  Thus, enhancing the depth and utility of the note and facilitating a comprehensive review of patient assessments in a structured and conventional manner.",
                          "items": {
                            "type": "object",
                            "description": "Suggested Dot Phrase.",
                            "required": [
                              "text_to_insert"
                            ],
                            "properties": {
                              "dot_phrase": {
                                "type": "object",
                                "description": "Dot phrase, also referred to as EHR (Electronic Health Record) macro, is a concise abbreviation (`trigger`) that unfolds into a predefined, extended text (`replacement`).",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "Unique identifier of the Dot Phrase."
                                  },
                                  "title": {
                                    "type": "string",
                                    "description": "A user-friendly title for the Dot Phrase. Does not impact the matching logic.",
                                    "example": "Normal physical exam"
                                  },
                                  "trigger": {
                                    "type": "string",
                                    "description": "The text which, if present in the transcript, will prompt the suggestion of this Dot Phrase.",
                                    "example": "Your physical exam is normal"
                                  },
                                  "content_auto_update_enabled": {
                                    "type": "boolean",
                                    "description": "If true, whenever this dot phrase is suggested, the replacement text will be automatically updated based on the encounter discussion.",
                                    "example": false
                                  },
                                  "replacement": {
                                    "type": "string",
                                    "description": "The replacement text for this Dot Phrase. If the Dot Phrase's trigger is detected, this text will be suggested in the note generation's response.",
                                    "example": "- Heart Examination: Normal, with regular rate and rhythm, no murmurs. - Lung Assessment: Normal breath sounds, no wheezes, crackles, or rhonchi. - Abdominal Evaluation: Normal, no tenderness, masses, or hepatosplenomegaly."
                                  }
                                },
                                "required": [
                                  "id",
                                  "title",
                                  "trigger",
                                  "content_auto_update_enabled",
                                  "replacement"
                                ],
                                "title": "copilot_api_dot_phrase"
                              },
                              "note_section": {
                                "type": "object",
                                "description": "The key and the title of the section in the note where this Dot Phrase is suggested to go. There are three possible scenarios:\n\n  • No suggested section: Given the Dot Phrase's content, we found no appropriate section to suggest. You should decide for a default (for instance: any kind of \"free text\" area you might have).\n\n  • Suggested section already present in the note: We recommend you append the Dot Phrase's suggested `text_to_insert` to the section's content.\n\n  • Suggested section is not present in the note: Add a new section to the note with the provided key and title and use the Dot Phrase's suggested `text_to_insert` as the section's content.",
                                "required": [
                                  "key",
                                  "title"
                                ],
                                "properties": {
                                  "key": {
                                    "type": "string",
                                    "description": "A key identifying a section of a note.\nThe set of possible keys depend on the template that is used. Check [Note template](/guides/note-templates-sections) for possible values.",
                                    "example": "CHIEF_COMPLAINT",
                                    "enum": [
                                      "ALLERGIES",
                                      "APPOINTMENTS",
                                      "ASSESSMENT",
                                      "ASSESSMENT_AND_PLAN",
                                      "CARDIOVASCULAR_RISKS",
                                      "CHIEF_COMPLAINT",
                                      "CURRENT_MEDICATIONS",
                                      "DIET_APPOINTMENTS",
                                      "DIET_CHIEF_COMPLAINT",
                                      "DIET_HABITS",
                                      "DIET_LIFESTYLE",
                                      "DIET_MEDICAL_HISTORY",
                                      "DIET_OBJECTIVES",
                                      "DIET_VITALS",
                                      "FAMILY_HISTORY",
                                      "HISTORY_OF_PRESENT_ILLNESS",
                                      "IMAGING_RESULTS",
                                      "IMMUNIZATIONS",
                                      "LAB_RESULTS",
                                      "MENTAL_HEALTH_EXAM",
                                      "MENTAL_HEALTH_HISTORY",
                                      "PAST_MEDICAL_HISTORY",
                                      "PAST_OBSTETRIC_HISTORY",
                                      "PAST_SURGICAL_HISTORY",
                                      "PHYSICAL_EXAM",
                                      "PLAN",
                                      "PRESCRIPTION",
                                      "PSYCHOLOGY_HISTORY_OF_COMPLAINT",
                                      "SOAP_ASSESSMENT",
                                      "SOAP_OBJECTIVE",
                                      "SOAP_PLAN",
                                      "SOAP_SUBJECTIVE",
                                      "SOCIAL_HISTORY",
                                      "VITALS",
                                      "WELL_CHILD_CARE"
                                    ],
                                    "title": "copilot_note_section_key"
                                  },
                                  "title": {
                                    "type": "string",
                                    "description": "Section title.",
                                    "example": "Assessment & Plan."
                                  }
                                },
                                "title": "copilot_dot_phrase_section"
                              },
                              "text_to_insert": {
                                "type": "string",
                                "description": "The actual suggested content, to be inserted in the corresponding note section. Please note that the content might be different from the replacement in the original Dot Phrase definition. In fact, the `text_to_insert` takes into account the contextual information of the encounter and might change the original Dot Phrase replacement text, for instance to include exceptions.",
                                "example": "- Heart Examination: Normal, with regular rate and rhythm, no murmurs.\n- Lung Assessment: Normal breath sounds, no wheezes, crackles, or rhonchi.\n- Abdominal Evaluation: Normal, no tenderness, masses, or hepatosplenomegaly.\n"
                              }
                            },
                            "title": "copilot_suggested_dot_phrase"
                          },
                          "title": "copilot_suggested_dot_phrases"
                        }
                      },
                      "title": "async_note_generation_succeeded_payload"
                    }
                  },
                  "required": [
                    "id",
                    "status"
                  ],
                  "title": "async_note_generation_succeeded"
                }
              }
            },
            "title": "async_note_generation"
          }
        }
      }
    }
  }
}
```
