> For the complete documentation index, see [llms.txt](https://docs-en.dydu.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-en.dydu.ai/developers/api-reference/dialogs-export.md).

# Dialogs Export

You can export the dialogs of your bot in XML, CSV or Excel format:

* all the dialogs between two dates;
* a single dialog, from its identifier.

## Send a request

* **Address**: `https://<server>/servlet/dialogexport`, replacing `<server>` with the address of your platform.
* **Method**: `GET` or `POST`.
* **Authentication**: `Authorization` header (see [Authentication](https://docs-en.dydu.ai/developers/api-reference/authentication)). The account used must have the right to export dialogs.

{% hint style="warning" %}
The exported period is limited to one month (32 days), whatever the format. An account can only run one export at a time: if an export is already running, the API returns an "A request is already processing" error.
{% endhint %}

## Parameters

<table><thead><tr><th width="250">Parameter</th><th width="250">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>botUUID</code></td><td>Yes</td><td>Bot identifier. It is displayed on the <strong>Preferences > Api > API access</strong> page.</td></tr><tr><td><code>language</code></td><td>Yes</td><td>Dialog language: "fr", "en", "nl"… The bot must handle this language.</td></tr><tr><td><code>startingDate</code></td><td>Yes</td><td>Start date of the export, in <code>yyyy-MM-dd</code> or <code>yyyy-MM-dd HH:mm:ss</code> format.</td></tr><tr><td><code>endingDate</code></td><td>Yes</td><td>End date of the export, in the same format.</td></tr><tr><td><code>contextId</code></td><td>No</td><td>Identifier of a dialog, to export only this dialog. The dates are still required.</td></tr><tr><td><code>format</code></td><td>No</td><td>Output format: "Xml" (default), "Csv" or "Excel".</td></tr><tr><td><code>exportDialogIds</code></td><td>No</td><td><code>true</code> to export the dialog identifiers, <code>false</code> (default) otherwise.</td></tr><tr><td><code>onlyLivechat</code></td><td>No</td><td><code>true</code> to export only the dialogs that went through the livechat.</td></tr><tr><td><code>currentDialogs</code></td><td>No</td><td><code>true</code> to export the ongoing dialogs (Xml and Csv formats only).</td></tr><tr><td><code>variableName</code>, <code>variableValue</code></td><td>No</td><td>To export only the dialogs where a variable has a given value.</td></tr></tbody></table>

If the dialogs are encrypted, add the `DialogsPassword` header with the decryption password. Without it, the content of the dialogs is hidden in the export.

Example:

```
curl -X GET "https://<server>/servlet/dialogexport?botUUID=ef07a37a-2f38-44f1-a2c4-d2e71e7c6d20&language=en&startingDate=2026-10-01&endingDate=2026-10-31&format=Csv" \
  -H "Authorization: Basic ZGVtb0BkeWR1LmFpOk15UGFzc3dvcmQ=" \
  -o export.zip
```

If an error occurs, the API returns a JSON message, for example `{"type":"error","message":"...","status":"BAD_REQUEST"}`.

## XML format

For an export between two dates, the dialogs are split into one XML file per day, compressed in a zip file. For a single dialog, the XML file is not compressed.

```
<dialogsExport>
  <dialog>
    <length>...</length>
    <businessLength>...</businessLength>
    <userIdentification>...</userIdentification>
    <userLocation>...</userLocation>
    <browser>...</browser>
    <os>...</os>
    <serverName>...</serverName>
    <livechatType>...</livechatType>
    <interactions>
      <interaction>
        <userTalk>...</userTalk>
        <userUrl>...</userUrl>
        <interactionExternValuesString>...</interactionExternValuesString>
        <botAnswer>...</botAnswer>
        <date>...</date>
        <tags><tag>...</tag></tags>
        <typeResponse>...</typeResponse>
        <matches>
          <InteractionMatch>
            <actionId>...</actionId>
            <score>...</score>
            <scoreMatch>...</scoreMatch>
          </InteractionMatch>
        </matches>
        <businessInteraction>...</businessInteraction>
        <durationRuntime>...</durationRuntime>
        <language>...</language>
        <solutionUsed>
          <value>...</value>
          <name>...</name>
          <compatibleSolution>...</compatibleSolution>
        </solutionUsed>
        <encrypted>...</encrypted>
      </interaction>
    </interactions>
    <externValues>
      <externValue>
        <name>...</name>
        <value>...</value>
      </externValue>
    </externValues>
    <startDate>...</startDate>
    <testDialog>...</testDialog>
    <dialogType>...</dialogType>
    <consultationSpace id="...">...</consultationSpace>
    <alreadyCame>...</alreadyCame>
    <qualificationMode>...</qualificationMode>
  </dialog>
</dialogsExport>
```

## CSV format

As with XML, an export between two dates gives a zip file with one CSV file per day. For a single dialog, the CSV file is not compressed. Columns are separated by semicolons.

| Column          | Description                                                                                                                                      |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Date`          | Start date of the dialog.                                                                                                                        |
| `Space`         | Consultation space of the dialog.                                                                                                                |
| `Length`        | Total number of interactions.                                                                                                                    |
| `Qualification` | Result of the dialog (see below).                                                                                                                |
| Variables       | One column per variable found in the exported dialogs (for example `dialog_user_id`). These columns therefore change from one export to another. |
| `Tags`          | Topics used during the dialog, separated by semicolons: they therefore take up several columns.                                                  |

Values of the `Qualification` column:

* **OnlyDirectMatches**: all the user's questions got a direct answer from the bot. The dialog is successful.
* **EndingWithDirectMatch**: some questions led to a rewording or were not understood, but the last question was understood. The dialog is successful.
* **Failed**: the last question was not understood or led to a rewording. The dialog failed.
* **WithLiveChat**: the dialog went through the livechat.
* **Unknown**: the qualification could not be determined.

Examples of variable columns:

| Column                                     | Description                                                      |
| ------------------------------------------ | ---------------------------------------------------------------- |
| `dialog_user_id`                           | User identifier, if provided.                                    |
| `dialog_nb_rewords`                        | Number of rewordings suggested during the dialog.                |
| `dialog_nb_garbages`                       | Number of misunderstood sentences during the dialog.             |
| `dialog_nb_clicked_automatic_rewords`      | Number of rewordings clicked by the user.                        |
| `dialog_nb_clicked_knowledge_redirections` | Number of clicks on a link to another knowledge in a bot answer. |
| `dialog_context_id`                        | Dialog identifier.                                               |
| `dialog_user_question`                     | Last question of the dialog.                                     |

## Excel format

The Excel export gives an `.xlsx` file. It contains up to 10,000 dialogs: beyond that, only the first 10,000 are exported.

Each dialog is exported as follows:

* start date (dd/MM/yyyy HH:mm:ss);
* consultation space;
* for each interaction:
* user's question;
* bot's answer;
* date (dd/MM/yyyy HH:mm:ss);
* qualification;
* satisfaction: positive or negative, if the user gave feedback;
* dissatisfaction reason, if the user chose one;
* dissatisfaction comment, if the user left one.

### Qualifications

The qualification shows how the bot handled the question. Its prefix gives the category:

| Prefix | Meaning                                                   |
| ------ | --------------------------------------------------------- |
| DM     | *Direct Match*: the question was understood.              |
| RW     | *Reword*: the bot suggested a rewording.                  |
| GB     | *Garbage*: the question was not understood.               |
| OP     | *Operator*: the answer comes from a human operator.       |
| NA     | *No Answer*: the bot did not give an answer.              |
| ERR    | *Error*: an error occurred while processing the question. |

Most common qualifications:

| Qualification                   | Description                                                                                                 |
| ------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| DMUnderstoodQuestion            | The question was understood and the bot answered.                                                           |
| DMDisabledKnowledge             | The question was understood but the knowledge is not published: the bot answered that it could not answer.  |
| DMClickRedirectionLink          | The user clicked a URL in the bot's previous answer.                                                        |
| DMPushReplace                   | The bot's answer was fully replaced by a complementary answer.                                              |
| DMRewordClicked                 | The user clicked a link in the bot's previous answer that led to the answer of another knowledge.           |
| DMRewordClickedAuto             | The user clicked a rewording in the bot's previous answer.                                                  |
| DMClickJavascriptLink           | The user clicked a link in the bot's previous answer that runs JavaScript.                                  |
| RWOneReword                     | Rewording with one suggestion.                                                                              |
| RWTwoRewords                    | Rewording with two suggestions.                                                                             |
| RWThreeRewords                  | Rewording with three suggestions.                                                                           |
| GBMisunderstoodQuestion         | The question was not understood.                                                                            |
| GBTooManyMisunderstoodQuestions | The question was not understood, and at least two other questions of the dialog were not understood either. |
| NAWaitingForOperator            | The dialog was transferred to the livechat: the bot tells the user to wait for an operator to connect.      |
| OPRegularOperatorAnswer         | The answer comes from a human operator.                                                                     |
| ERRApplicationException         | An application error occurred.                                                                              |
| ERRAPIException                 | An error occurred while calling an external web service.                                                    |
