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

# document.feedbackSubmitted

> Emitted when document feedback is submitted.

## Event Properties

| Field          | Value                          |
| -------------- | ------------------------------ |
| `event`        | `"document.feedbackSubmitted"` |
| `confidential` | `boolean`                      |
| `payload`      | `object`                       |

<Tabs>
  <Tab title="Public Payload">
    | Field              | Type                     | Description                                                                  |
    | ------------------ | ------------------------ | ---------------------------------------------------------------------------- |
    | `score`            | `number`                 | User rating for the document                                                 |
    | `maxScore`         | `number`                 | Max possible rating for the document                                         |
    | `documentId`       | `string`                 | Unique document identifier                                                   |
    | `documentName`     | `string`                 | Document name or title                                                       |
    | `outputLanguage`   | `string`                 | Output language code (e.g., "en", "de")                                      |
    | `templateType`     | `"built-in" \| "custom"` | Type of template used: built-in or custom                                    |
    | `templateId`       | `string`                 | Template identifier (either ref for built-in or customTemplateId for custom) |
    | `interactionId`    | `string`                 | Unique interaction identifier                                                |
    | `interactionState` | `InteractionState`       | Current state of the interaction                                             |

    #### Example

    ```json theme={null}
    {
      "event": "document.feedbackSubmitted",
      "confidential": false,
      "payload": {
        "score": 4,
        "maxScore": 5,
        "documentId": "doc_123",
        "documentName": "SOAP note",
        "outputLanguage": "en",
        "templateType": "built-in",
        "templateId": "soap",
        "interactionId": "int_123",
        "interactionState": "ongoing"
      }
    }
    ```
  </Tab>

  <Tab title="Confidential Payload">
    | Field         | Type                      | Description                                                     |
    | ------------- | ------------------------- | --------------------------------------------------------------- |
    | `score`       | `number`                  | User rating for the document                                    |
    | `maxScore`    | `number`                  | Max possible rating for the document                            |
    | `document`    | `ExternalPatientDocument` | Complete document object with all sections and metadata         |
    | `interaction` | `ExternalInteraction`     | Interaction context including transcripts, documents, and facts |

    <Accordion title="document object properties">
      | Field            | Type                     | Description                                                                  |
      | ---------------- | ------------------------ | ---------------------------------------------------------------------------- |
      | `id`             | `string`                 | Unique document identifier                                                   |
      | `name`           | `string`                 | Document name or title                                                       |
      | `outputLanguage` | `string`                 | Output language code (e.g., "en", "de")                                      |
      | `sections`       | `Section[]`              | Document sections containing the generated content                           |
      | `templateType`   | `"built-in" \| "custom"` | Type of template used: built-in or custom                                    |
      | `templateId`     | `string`                 | Template identifier (either ref for built-in or customTemplateId for custom) |

      **Section properties:**

      | Field  | Type     | Description                               |
      | ------ | -------- | ----------------------------------------- |
      | `key`  | `string` | Unique key identifying the section type   |
      | `name` | `string` | Display name of the section               |
      | `text` | `string` | Section content in markdown or plain text |
    </Accordion>

    <Accordion title="interaction object properties">
      | Field             | Type                     | Description                                         |
      | ----------------- | ------------------------ | --------------------------------------------------- |
      | `id`              | `string`                 | Unique interaction identifier                       |
      | `title`           | `string \| null`         | Interaction title                                   |
      | `state`           | `InteractionState`       | Current state of the interaction                    |
      | `startedAt`       | `string (ISO 8601 date)` | When the interaction started (ISO 8601 date string) |
      | `transcriptCount` | `number`                 | Number of transcripts in the interaction            |
      | `documentCount`   | `number`                 | Number of documents in the interaction              |
      | `facts`           | `Fact[]`                 | Facts extracted during the interaction              |

      **Fact properties:**

      | Field         | Type                           | Description                                              |
      | ------------- | ------------------------------ | -------------------------------------------------------- |
      | `id`          | `string`                       | Unique fact identifier                                   |
      | `text`        | `string`                       | Fact text content                                        |
      | `group`       | `string`                       | Fact group/category name                                 |
      | `source`      | `"core" \| "system" \| "user"` | Source of the fact: core (AI extracted), system, or user |
      | `isDiscarded` | `boolean`                      | Whether the fact has been discarded                      |
    </Accordion>

    #### Example

    ```json theme={null}
    {
      "event": "document.feedbackSubmitted",
      "confidential": true,
      "payload": {
        "score": 4,
        "maxScore": 5,
        "document": {
          "id": "doc_123",
          "name": "SOAP note",
          "outputLanguage": "en",
          "sections": [
            {
              "key": "hpi",
              "name": "HPI",
              "text": "..."
            }
          ],
          "templateType": "built-in",
          "templateId": "soap"
        },
        "interaction": {
          "id": "int_123",
          "title": "Visit",
          "state": "ongoing",
          "startedAt": "2024-01-01T00:00:00.000+00:00",
          "transcriptCount": 0,
          "documentCount": 0,
          "facts": []
        }
      }
    }
    ```
  </Tab>
</Tabs>
