> For the complete documentation index, see [llms.txt](https://atlas.anywhere.now/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://atlas.anywhere.now/developer-docs/generic-dialogue-provider/dialogues.md).

# Generic Dialogue Provider API dialogues

Create, retrieve, connect, and disconnect Generic Dialogue Provider dialogues.

Use these endpoints to manage dialogues. For shared path parameters and error behavior, see [Messages, dialogues, and attachments](/developer-docs/generic-dialogue-provider/messages-and-dialogues.md).

## POST /api/v1/dialogue

Create a dialogue.

### Request

This endpoint does not require a request body.

### Response

#### Success: 201 Created

```json
{
  "id": "4c61290a-b6f6-4db1-b97f-7732764fbb53"
}
```

| Field | Type   | Description          |
| ----- | ------ | -------------------- |
| `id`  | string | Created dialogue ID. |

#### Error responses

| Status                      | Description                                           |
| --------------------------- | ----------------------------------------------------- |
| `401 Unauthorized`          | The bearer token is missing or invalid.               |
| `409 Conflict`              | Generic Dialogue Provider settings are not available. |
| `500 Internal Server Error` | The service could not process the request.            |

## GET /api/v1/dialogue/{dialogueId}

Retrieve a dialogue and the message IDs linked to it.

### URL parameters

| Parameter    | Type   | Required | Description                 |
| ------------ | ------ | -------- | --------------------------- |
| `dialogueId` | string | Yes      | Dialogue ID in GUID format. |

### Response

#### Success: 200 OK

```json
{
  "id": "4c61290a-b6f6-4db1-b97f-7732764fbb53",
  "messages": [
    {
      "id": "3657e938-d1ae-42f6-8b89-75e5e39f1be9"
    },
    {
      "id": "bb539d7c-67fd-4b2b-9a82-9283443c1c57"
    }
  ]
}
```

| Field           | Type   | Description                                              |
| --------------- | ------ | -------------------------------------------------------- |
| `id`            | string | Dialogue ID.                                             |
| `messages`      | array  | Messages linked to the dialogue. The array can be empty. |
| `messages[].id` | string | Message ID.                                              |

#### Error responses

| Status                      | Description                                           |
| --------------------------- | ----------------------------------------------------- |
| `400 Bad Request`           | `dialogueId` is not in GUID format.                   |
| `401 Unauthorized`          | The bearer token is missing or invalid.               |
| `404 Not Found`             | The dialogue could not be found.                      |
| `409 Conflict`              | Generic Dialogue Provider settings are not available. |
| `500 Internal Server Error` | The service could not process the request.            |

## POST /api/v1/dialogue/{dialogueId}/connect

Connect a dialogue to a UCC.

### URL parameters

| Parameter    | Type   | Required | Description                 |
| ------------ | ------ | -------- | --------------------------- |
| `dialogueId` | string | Yes      | Dialogue ID in GUID format. |

### Request body

```json
{
  "uccId": "ucc_example"
}
```

| Field   | Type   | Required | Description                                                  |
| ------- | ------ | -------- | ------------------------------------------------------------ |
| `uccId` | string | Yes      | UCC ID. Must be lowercase. Maximum length is 255 characters. |

### Rules

* At least one new inbound message must be linked to the dialogue.
* The `uccId` value must be lowercase.
* Subscribe before an agent accepts the queue item if events must be received.

### Response

#### Success: 200 OK

The response body is not guaranteed; do not depend on a response body for this status.

#### Error responses

| Status                      | Description                                                                                                                |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `304 Not Modified`          | The dialogue is already being processed or the session was already started.                                                |
| `400 Bad Request`           | `dialogueId` is not in GUID format, `uccId` is not lowercase, or the request body is invalid.                              |
| `401 Unauthorized`          | The bearer token is missing or invalid.                                                                                    |
| `404 Not Found`             | The dialogue could not be found.                                                                                           |
| `409 Conflict`              | The UCC could not be found, the dialogue has no inbound messages, or Generic Dialogue Provider settings are not available. |
| `500 Internal Server Error` | The service could not process the request.                                                                                 |

## POST /api/v1/dialogue/{dialogueId}/disconnect

Disconnect a connected dialogue.

### URL parameters

| Parameter    | Type   | Required | Description                 |
| ------------ | ------ | -------- | --------------------------- |
| `dialogueId` | string | Yes      | Dialogue ID in GUID format. |

### Response

#### Success: 200 OK

The response body is not guaranteed; do not depend on a response body for this status.

Disconnecting a dialogue has the same effect as an agent closing the conversation. The dialogue is no longer visible in WebAgent, the queue item disappears, the dialogue closes, and GDP sends a `Closed` event to subscribed callback URLs.

#### Error responses

| Status                      | Description                                           |
| --------------------------- | ----------------------------------------------------- |
| `304 Not Modified`          | The dialogue is not connected.                        |
| `400 Bad Request`           | `dialogueId` is not in GUID format.                   |
| `401 Unauthorized`          | The bearer token is missing or invalid.               |
| `404 Not Found`             | The dialogue could not be found.                      |
| `409 Conflict`              | Generic Dialogue Provider settings are not available. |
| `500 Internal Server Error` | The service could not process the request.            |

## Related topics

* [Messages, dialogues, and attachments](/developer-docs/generic-dialogue-provider/messages-and-dialogues.md)
* [Messages](/developer-docs/generic-dialogue-provider/messages.md)
* [Attachments](/developer-docs/generic-dialogue-provider/attachments.md)
* [Authentication](/developer-docs/generic-dialogue-provider/authentication.md)
* [Event subscriptions and callbacks](/developer-docs/generic-dialogue-provider/events.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://atlas.anywhere.now/developer-docs/generic-dialogue-provider/dialogues.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
