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

---
id: cdeef676-ae3d-4e5b-8d81-beca5da23897
---

# Conversations API

> Use the conversations API to manage inboxes, channels, threads, and messages.

export const PostmanCard = ({title, collectionId}) => {
  return <div className="card-condensed-cta">
      <Card title={title ? title : "Postman collection"} href={`https://app.getpostman.com/run-collection/${collectionId}`} horizontal={true} cta="Run in Postman" icon={<svg xmlns="http://www.w3.org/2000/svg" width={25} height={25} preserveAspectRatio="xMidYMid" viewBox="0 0 256 256">
              <path fill="#FF6C37" d="M254.953 144.253c8.959-70.131-40.569-134.248-110.572-143.206C74.378-7.912 10.005 41.616 1.047 111.619c-8.959 70.003 40.569 134.248 110.572 143.334 70.131 8.959 134.248-40.569 143.334-110.7Z" />
              <path fill="#FFF" d="m174.2 82.184-54.007 54.007-15.229-15.23c53.11-53.11 58.358-48.503 69.236-38.777Z" />
              <path fill="#FF6C37" d="M120.193 137.47c-.384 0-.64-.128-.895-.384l-15.358-15.229a1.237 1.237 0 0 1 0-1.792c54.007-54.006 59.638-48.887 71.028-38.649.255.256.383.512.383.896s-.128.64-.383.896l-54.007 53.878c-.128.256-.512.384-.768.384Zm-13.437-16.509 13.437 13.438 52.087-52.087c-9.47-8.446-15.87-11.006-65.524 38.65Z" />
              <path fill="#FFF" d="m135.679 151.676-14.718-14.718 54.007-54.006c14.46 14.59-7.167 38.265-39.29 68.724Z" />
              <path fill="#FF6C37" d="M135.679 152.956c-.384 0-.64-.128-.896-.384l-14.718-14.718c-.256-.256-.256-.512-.256-.896s.128-.64.384-.895L174.2 82.056a1.237 1.237 0 0 1 1.791 0 15.58 15.58 0 0 1 4.991 11.902c-.256 14.206-16.38 32.25-44.28 58.614-.383.256-.767.384-1.023.384Zm-12.926-15.998c8.19 8.319 11.646 11.646 12.926 12.926 21.5-20.476 42.36-41.464 42.488-55.926.128-3.327-1.152-6.655-3.327-9.214l-52.087 52.214Z" />
              <path fill="#FFF" d="m105.22 121.345 10.878 10.878c.256.256.256.512 0 .768-.128.128-.128.128-.256.128l-22.524 4.863c-1.152.128-2.175-.64-2.431-1.791-.128-.64.128-1.28.512-1.664l13.053-13.054c.256-.256.64-.384.768-.128Z" />
              <path fill="#FF6C37" d="M92.934 139.262c-1.92 0-3.327-1.536-3.327-3.455 0-.896.384-1.792 1.024-2.432l13.053-13.054c.768-.64 1.792-.64 2.56 0l10.878 10.878c.768.64.768 1.792 0 2.56-.256.256-.512.384-.896.512l-22.524 4.863c-.256 0-.512.128-.768.128Zm11.902-16.51-12.542 12.543c-.256.256-.383.64-.128 1.024.128.383.512.511.896.383l21.116-4.607-9.342-9.342Z" />
              <path fill="#FFF" d="M202.739 52.238c-8.191-7.935-21.373-7.679-29.307.64-7.935 8.318-7.679 21.372.64 29.306A20.678 20.678 0 0 0 199.155 85l-14.59-14.59 18.174-18.172Z" />
              <path fill="#FF6C37" d="M188.405 89.223c-12.158 0-22.012-9.854-22.012-22.012 0-12.158 9.854-22.012 22.012-22.012 5.631 0 11.134 2.176 15.23 6.143.255.256.383.512.383.896s-.128.64-.384.895L186.357 70.41l13.566 13.566c.512.512.512 1.28 0 1.792l-.256.256c-3.327 2.047-7.295 3.199-11.262 3.199Zm0-41.337c-10.75 0-19.452 8.703-19.324 19.453 0 10.75 8.702 19.452 19.452 19.324 2.944 0 5.887-.64 8.575-2.047l-13.438-13.31c-.256-.256-.384-.512-.384-.896s.128-.64.384-.895l17.149-17.15c-3.456-2.943-7.807-4.479-12.414-4.479Z" />
              <path fill="#FFF" d="m203.122 52.622-.255-.256-18.301 18.044 14.461 14.462c1.408-.896 2.816-1.92 3.967-3.072a20.51 20.51 0 0 0 .128-29.178Z" />
              <path fill="#FF6C37" d="M199.155 86.28c-.384 0-.64-.128-.896-.384l-14.589-14.59c-.256-.256-.384-.512-.384-.896s.128-.64.384-.895l18.173-18.173a1.237 1.237 0 0 1 1.791 0l.384.256c8.575 8.574 8.575 22.396.128 31.098-1.28 1.28-2.687 2.432-4.223 3.328-.384.128-.64.256-.768.256Zm-12.798-15.87 12.926 12.926c1.024-.64 2.048-1.536 2.816-2.304 7.294-7.294 7.678-19.196.64-26.875L186.357 70.41Z" />
              <path fill="#FFF" d="M176.375 84.488a7.879 7.879 0 0 0-11.134 0l-48.247 48.247 8.063 8.063 51.062-44.792c3.328-2.816 3.584-7.807.768-11.134-.256-.128-.384-.256-.512-.384Z" />
              <path fill="#FF6C37" d="M124.929 142.077c-.384 0-.64-.128-.896-.383l-8.063-8.063a1.237 1.237 0 0 1 0-1.792l48.247-48.247a9.115 9.115 0 0 1 12.926 0 9.115 9.115 0 0 1 0 12.926l-.384.384-51.063 44.792c-.128.255-.384.383-.767.383Zm-6.143-9.342 6.27 6.271 50.167-44.024c2.816-2.304 3.072-6.527.768-9.342-2.303-2.816-6.526-3.072-9.342-.768-.128.128-.256.256-.512.384l-47.351 47.48Z" />
              <path fill="#FFF" d="M80.009 187.637c-.512.256-.768.768-.64 1.28l2.175 9.214c.512 1.28-.256 2.816-1.663 3.2-1.024.384-2.176 0-2.816-.768l-14.077-13.95 45.943-45.943 15.87.256 10.75 10.75c-2.56 2.175-18.045 17.149-55.542 35.961Z" />
              <path fill="#FF6C37" d="M78.985 202.61c-1.024 0-2.048-.383-2.688-1.151l-13.95-13.95c-.255-.256-.383-.512-.383-.896 0-.383.128-.64.384-.895l45.944-45.944c.256-.256.64-.384.895-.384l15.87.256c.383 0 .64.128.895.384l10.75 10.75c.256.256.384.64.384 1.024s-.128.64-.512.896l-.895.767c-13.566 11.902-31.995 23.804-54.902 35.194l2.175 9.086c.384 1.664-.384 3.456-1.92 4.352-.767.384-1.407.512-2.047.512Zm-14.078-15.997 13.182 13.054c.384.64 1.152.896 1.792.512.64-.384.896-1.152.512-1.792l-2.176-9.214c-.256-1.152.256-2.176 1.28-2.688 22.652-11.39 40.952-23.163 54.39-34.81l-9.47-9.47-14.718-.256-44.792 44.664Z" />
              <path fill="#FFF" d="m52.11 197.62 11.006-11.007 16.38 16.381-26.107-1.791c-1.151-.128-1.92-1.152-1.791-2.304 0-.512.128-1.024.512-1.28Z" />
              <path fill="#FF6C37" d="m79.497 204.146-26.236-1.791c-1.92-.128-3.199-1.792-3.071-3.712.128-.768.384-1.535 1.024-2.047L62.22 185.59a1.237 1.237 0 0 1 1.792 0l16.38 16.38c.385.385.512.897.257 1.408-.256.512-.64.768-1.152.768Zm-16.381-15.74-10.11 10.11c-.384.255-.384.895 0 1.151.127.128.255.256.511.256l22.652 1.536-13.053-13.054ZM104.452 146.557c-.768 0-1.28-.64-1.28-1.28 0-.384.128-.64.384-.896l12.414-12.414a1.237 1.237 0 0 1 1.792 0l8.062 8.063c.384.384.512.768.384 1.28-.128.384-.512.767-1.023.895l-20.477 4.352h-.256Zm12.414-11.902-8.446 8.446 13.821-2.943-5.375-5.503Z" />
              <path fill="#FFF" d="m124.8 140.926-14.077 3.071c-1.024.256-2.048-.384-2.303-1.408-.128-.64 0-1.28.511-1.791l7.807-7.807 8.063 7.935Z" />
              <path fill="#FF6C37" d="M110.467 145.277a3.168 3.168 0 0 1-3.2-3.2c0-.895.385-1.663.897-2.303l7.806-7.807a1.237 1.237 0 0 1 1.792 0l8.062 8.063c.384.384.512.768.384 1.28-.128.384-.512.767-1.023.895l-14.078 3.072h-.64Zm6.399-10.622-6.91 6.91c-.257.257-.257.512-.129.768s.384.384.768.384l11.774-2.56-5.503-5.502ZM203.25 64.907c-.256-.767-1.151-1.151-1.92-.895-.767.255-1.151 1.151-.895 1.92 0 .127.128.255.128.383.768 1.536.512 3.455-.512 4.863-.512.64-.384 1.536.128 2.048.64.512 1.536.384 2.048-.256 1.92-2.432 2.303-5.503 1.023-8.063Z" />
            </svg>} />
    </div>;
};

export const ScopesList = ({scopes = [], description = "This API requires one of the following scopes:"}) => {
  if (!scopes || scopes.length === 0) {
    return null;
  }
  const sortedScopes = scopes.sort((a, b) => a.localeCompare(b));
  return <div>
      <div className="text-sm mb-2">{description}</div>
      <div>
        {sortedScopes.map((scope, index) => <div key={index}>
            <code>
              <span className="text-xs">{scope}</span>
            </code>
          </div>)}
      </div>
    </div>;
};

<PostmanCard collectionId="26126890-d0340d5d-abd4-4fa6-83ec-4cdcb9bbbcea" />

<Accordion title="Scope requirements">
  <ScopesList
    scopes={[
  'conversations.read',
  'conversations.write'
]}
  />
</Accordion>

The conversations APIs enable you to manage and interact with the [conversations inbox](https://knowledge.hubspot.com/inbox/overview-of-the-conversations-inbox) and [help desk](https://knowledge.hubspot.com/help-desk/overview-of-the-help-desk-workspace), including connected channels and their associated messages. For example, you can use these APIs to:

* Get and sort conversations inboxes, channels, threads, and messages.
* Update thread statuses.
* Delete and restore threads.
* Send outbound messages via existing conversations channels.
* Send an internal comment to an agent.
* Retrieve conversation data to create advanced reports and analytics in external tools.

You could also use these APIs to integrate existing channels with other apps such as [Slack](https://knowledge.hubspot.com/integrations/how-do-i-use-the-slack-integration) or Microsoft Teams to send replies or receive notifications.

You can also use webhooks with the conversations API. Learn more about the [available webhook events](#webhooks).

<Warning>
  **Please note:**

  If you're planning on defining a custom channel that users can connect to their HubSpot account, check out the [custom channels API](/api-reference/legacy/conversations/guide).
</Warning>

## Scope requirements

For any requests to the `GET` endpoints, or a `POST` batch read request to the [get actors endpoint](/api-reference/legacy/conversations/conversations/actors/get-actor), you must have `conversations.read` access. All other endpoints require `conversations.write` access.

Learn more about authorizing [scopes](/apps/developer-platform/build-apps/authentication/scopes) for your app.

## Filter and sort results

When retrieving inboxes, channels, channel accounts, threads, and messages using the endpoints outlined in this article, you can use different query parameters to filter and sort your responses.

| Parameter | Type    | Description                                                                                                                                                           |
| --------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `sort`    | String  | Set the sort order of the response. You can sort by multiple properties.                                                                                              |
| `after`   | String  | The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. |
| `limit`   | Integer | The maximum number of results to display per page.                                                                                                                    |

You can also sort your results by any field on the channel, channel accounts, or inbox objects. For example, you could sort inboxes by name, or channel accounts by both channel ID and name.

## Inboxes

To retrieve a list of inboxes set up in your account, make a `GET` request to `/conversations/v3/conversations/inboxes`.

When you make a successful request, the response will include the inbox IDs of the different inboxes set up in your account. Each entry in the response will also include a `type` property, which can be either `INBOX` or `HELP_DESK`, depending on whether you connected the inbox to a [conversations inbox](https://knowledge.hubspot.com/inbox/use-the-conversations-inbox) or the [help desk workspace](https://knowledge.hubspot.com/help-desk/overview-of-the-help-desk-workspace).

An example response is shown below:

```json theme={null}
{
  "total": 3,
  "results": [
    {
      "id": "481939",
      "name": "Main website chatflow inbox",
      "createdAt": "2019-07-06T21:18:14.342Z",
      "updatedAt": "2022-08-19T20:03:44.993Z",
      "type": "INBOX",
      "archived": false
    },
    {
      "id": "273071781",
      "name": "T1 support helpdesk",
      "createdAt": "2023-05-31T21:53:12.704Z",
      "updatedAt": "2023-05-31T21:53:12.704Z",
      "type": "HELP_DESK",
      "archived": false
    }
  ]
}
```

You can also retrieve details about a specific inbox by using the inbox ID to make a `GET` request to `/conversations/v3/conversations/inboxes/{inboxId}`.

## Channels

You can retrieve a list of the channels connected to your inboxes by making a `GET` request to `/conversations/v3/conversations/channels`.

When you make a successful request, the response will include the channel IDs for the different channels connected to your inbox. To retrieve a specific channel, use the channel ID to make a `GET` request to `/conversations/v3/conversations/channels/{channelId}`.

You can also retrieve channel accounts, which are instances of a channel that are used to send and receive messages, like a specific chatflow created for one of your chat channels or a team email address connected as an email channel.

To retrieve a list of channel accounts, make a `GET` request to `/conversations/v3/conversations/channel-accounts`. You can limit the results by including the following parameters in the request URL:

| Parameter   | Description                                                                |
| ----------- | -------------------------------------------------------------------------- |
| `channelId` | The ID of the channel type for which you're retrieving a channel instance. |
| `inboxId`   | The ID of the inbox that the channel is connected to.                      |

For example, your request may look similar to the following: `https://api.hubspot.com/conversations/v3/conversations/channel-accounts?channelId=1000&inboxId=448`.

When you make a successful request, the response will include an `id` property, which is the channel account ID.

For example, the response may resemble the following:

```json theme={null}
{
  "total": 1,
  "results": [
    {
      "id": "148662",
      "channelId": "1000",
      "name": "New chatflow",
      "inboxId": "481939",
      "active": false,
      "authorized": true,
      "createdAt": "2019-10-04T15:24:39.136Z",
      "archived": false
    }
  ]
}
```

You can use the channel account ID to retrieve a single channel account, such as a specific chatflow. To retrieve a specific channel account, make a `GET` request to `/conversations/v3/conversations/channel-accounts/{channelAccountId}`.

## Threads & messages

### Retrieve threads

Threads are a group of related messages that make up a conversation in the inbox. To retrieve a list of all threads in your conversations inbox, make a `GET` request to `/conversations/v3/conversations/threads`. To filter and search your results, you can use the following query parameters in your request:

| Parameter                     | Type    | Description                                                                                                                                                                                                                                                                                                 |
| ----------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `after`                       | String  | The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. Use this parameter when sorting by ID.                                                                                                |
| `archived`                    | Boolean | To retrieve archived threads, use the value `true`.                                                                                                                                                                                                                                                         |
| `associatedContactId`         | String  | Filter threads by a [specific contact ID](#retrieve-a-subset-of-messages-associated-with-a-specific-contact-or-ticket).                                                                                                                                                                                     |
| `associatedTicketId`          | String  | Filter threads to only include threads that are associated with the [provided ticket ID](#retrieve-a-subset-of-messages-associated-with-a-specific-contact-or-ticket).                                                                                                                                      |
| `association`                 | String  | If you provide `association=TICKET` as a query parameter, any threads in the response will include a `threadAssociations` object if they have a ticket association. The `threadsAssociations` property includes a single nested `associatedTicketId` field, which provides the ID of the associated ticket. |
| `inboxId`                     | String  | Filter threads by a specific inbox ID. Note that you can only filter a single inbox ID (multiple instances of this query parameter are *not* supported).                                                                                                                                                    |
| `latestMessageTimestampAfter` | String  | The minimum `latestMessageTimestamp`. This is required only when sorting by `latestMessageTimestamp`.                                                                                                                                                                                                       |
| `limit`                       | String  | The total number of results to display per page. The maximum limit is 500.                                                                                                                                                                                                                                  |
| `sort`                        | String  | Set the sort order of the response. Valid options include `id` , which is the default, and `latestMessageTimestamp` , which requires the `latestMessageTimestampAfter` field to also be set. Results are always returned in ascending order.                                                                |

When you make a successful request, the response will include the thread ID, which you can use to retrieve, update, or create a new message in a thread.

For example, if you make a `GET` request to `/conversations/v3/conversations/threads?association=TICKET`, the response would resemble the following:

```json expandable theme={null}
{
  "results": [
    {
      "id": "176347007",
      "createdAt": "2019-11-18T18:47:59.865Z",
      "closedAt": "2019-11-18T18:50:06.872Z",
      "status": "CLOSED",
      "originalChannelId": "1000",
      "originalChannelAccountId": "148662",
      "latestMessageTimestamp": "2019-11-18T18:50:00.279Z",
      "latestMessageSentTimestamp": "2019-11-18T18:48:38.788Z",
      "latestMessageReceivedTimestamp": "2019-11-18T18:50:00.279Z",
      "assignedTo": "A-2620022",
      "spam": false,
      "inboxId": "481939",
      "associatedContactId": "1401",
      "archived": false,
      "threadAssociations": {
        "associatedTicketId": "57774743"
      }
    },
    {
      "id": "176350633",
      "createdAt": "2019-11-18T18:53:05.680Z",
      "closedAt": "2019-11-18T18:53:59.783Z",
      "status": "CLOSED",
      "originalChannelId": "1000",
      "originalChannelAccountId": "148662",
      "latestMessageTimestamp": "2019-11-18T18:53:56.694Z",
      "latestMessageSentTimestamp": "2019-11-18T18:53:56.694Z",
      "latestMessageReceivedTimestamp": "2019-11-18T18:53:52.199Z",
      "assignedTo": "A-2620022",
      "spam": false,
      "inboxId": "481939",
      "associatedContactId": "1451",
      "archived": false
    }
  ]
}
```

To retrieve a specific thread by thread ID, make a `GET` request to `/conversations/v3/conversations/threads/{threadId}`. Available query parameters include:

| Parameter     | Type    | Description                                                                                                                                                                                                                                                                      |
| ------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `archived`    | Boolean | To retrieve archived threads, use the value `true`.                                                                                                                                                                                                                              |
| `association` | String  | If you provide `association=TICKET` as a query parameter and the thread has an associated ticket, the response will include a `threadAssociations` object, which in turn includes a single nested `associatedTicketId` property, which provides the ID of the associated ticket. |
| `property`    | String  | A comma-separated list of properties to include (e.g., `?property=spam,inboxId`).                                                                                                                                                                                                |

### Retrieve messages

To get the entire message history, make a `GET` request to `/conversations/v3/conversations/threads/{threadId}/messages`.

When you make a successful request, the response will include the message ID, which you can use to retrieve a specific message. To do so, make a `GET` request to `/conversations/v3/conversations/threads/{threadId}/messages/{messageId}`.

For email messages, HubSpot cuts off the reply history section of an email. This is similar to how common mail clients handle reply history and longer emails.

* When you retrieve a message, the response will include a `truncationStatus` field. The value will either be `NOT_TRUNCATED`, `TRUNCATED_TO_MOST_RECENT_REPLY`, or `TRUNCATED`.
* If a message is truncated, you can retrieve the full version of the message by making a `GET` request to the [original content](/api-reference/legacy/conversations/conversations/messages/get-conversation) endpoint.

### Retrieve a subset of messages associated with a specific contact or ticket

You can also fetch messages associated with a single contact or ticket, which can be helpful if you're creating a view where a customer can review the conversations they've had with your business, or you want to find all conversations associated with a specific ticket.

To filter for messages associated with a contact, provide the ID of the contact as the `associatedContactId` as a query parameter in the URL of your request, along with a `threadStatus` parameter, which can be either `OPEN` or `CLOSED`.

For example, to retrieve open threads associated with a contact whose ID is `53701`, you'd make a `GET` request to the following URL:

`https://api.hubspot.com/conversations/v3/conversations/threads?associatedContactId=53701&threadStatus=OPEN`

To filter for messages associated with a specific ticket, provide ticket ID as the `associatedTicketId` query parameter in the URL of your request.

For example, to retrieve messages associated with a ticket ID of `12345`, you'd make the following `GET` request:

`https://api.hubspot.com/conversations/v3/conversations/threads?associatedTicketId=53701`

### Get actors

Actors are entities that interact with conversations, like a HubSpot user responding to a message or a visitor sending a message. When you make a request to retrieve threads or messages, the response will include actor IDs.

All actor IDs are a single letter representing the actor type, followed by a hyphen, followed by an identifier for the actor. The identifier could be a number, a string, etc. depending on the actor type. In the table below, learn more about the different actor IDs:

| Actor Type | Identifier                 | Description                                                                                                                                                                                                                                                                                                                                                                       |
| ---------- | -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `A-`       | HubSpot user ID (number)   | Agent actor, i.e. a user in the account.                                                                                                                                                                                                                                                                                                                                          |
| `E-`       | Email address (string)     | Email actor. This is used for email addresses that HubSpot didn't try to resolve to an agent actor or a visitor actor. For example, HubSpot will generally resolve the from email address to a contact, but if an incoming email has any additional email addresses included in the *To* field, *CC* field, etc., HubSpot won't try to resolve those email addresses to contacts. |
| `I-`       | App ID (number)            | Integration actor. This is used for actions taken by an integration.                                                                                                                                                                                                                                                                                                              |
| `L-`       | Customer Agent ID (number) | Customer agent actor. This is used for actions taken by [Breeze Customer Agent](https://knowledge.hubspot.com/customer-agent/set-up-the-customer-agent).                                                                                                                                                                                                                          |
| `S-`       | S-hubspot (string)         | System actor. This is used for actions taken by the HubSpot system itself.                                                                                                                                                                                                                                                                                                        |
| `V-`       | Contact ID (number)        | Visitor actor. Keep in mind that it's possible the visitor isn't a contact yet.                                                                                                                                                                                                                                                                                                   |

For example, if you make a `GET` request to `/conversations/v3/conversations/threads/{threadId}/messages`, the response will include a `sender` and `recipient` fields. These fields will include the actor IDs for the visitor or agent. For example, your response may look similar to the following:

```json theme={null}
{
  "results": [
    {
      "id": "3ad3474b08dd408ca57a8454e355e942",
      "conversationsThreadId": "176347007",
      "createdAt": "2019-11-18T18:47:59.949Z",
      "updatedAt": "2019-11-18T18:47:59.949Z",
      "createdBy": "V-1401",
      "client": {
        "clientType": "SYSTEM"
      },
      "senders": [
        {
          "actorId": "V-1401",
          "deliveryIdentifier": {
            "type": "CHANNEL_SPECIFIC_OPAQUE_ID",
            "value": "0232d1661ef84248bd4923cce9d3b917"
          }
        }
      ],
      "recipients": [],
      "archived": false,
      "text": "hi yes hello",
      "richText": "<div>hi yes hello</div>",
      "attachments": [],
      "truncationStatus": "NOT_TRUNCATED",
      "status": {
        "statusType": "RECEIVED"
      },
      "direction": "INCOMING",
      "channelId": "1000",
      "channelAccountId": "148662",
      "type": "MESSAGE"
    },
    {
      "id": "0c9b86b11210479eb1ae193ec5add0b7",
      "conversationsThreadId": "176347007",
      "createdAt": "2019-11-18T18:47:59.947Z",
      "createdBy": "S-hubspot",
      "client": {
        "clientType": "SYSTEM"
      },
      "senders": [
        {
          "actorId": "S-hubspot"
        }
      ],
      "recipients": [
        {
          "actorId": "V-1401",
          "deliveryIdentifier": {
            "type": "CHANNEL_SPECIFIC_OPAQUE_ID",
            "value": "0232d1661ef84248bd4923cce9d3b917"
          }
        }
      ],
      "archived": false,
      "text": "Got any questions? I'm happy to help.",
      "channelId": "1000",
      "channelAccountId": "148662",
      "type": "WELCOME_MESSAGE"
    }
  ]
}
```

To retrieve a single actor, make a `GET` request to `/conversations/v3/conversations/actors/{actorId}`. You will need the `actorId`, which is included in the response to a request to get a message or thread. The response will return details like the actor name, email address, avatar, and actor type.

### Update or restore threads

You can update a thread's status by making a `PATCH` request to `/conversations/v3/conversations/threads/{threadId}`. In the request body, include the thread properties to update.

| Field    | Description                                                |
| -------- | ---------------------------------------------------------- |
| `status` | The status of the thread, which can be `OPEN` or `CLOSED`. |

To restore any soft-deleted threads, make a `PATCH` request to `/conversations/v3/conversations/threads/{threadId}?archived=true` to retrieve the archived thread, then in the request body set the archived property to `false`.

| Field      | Description                         |
| ---------- | ----------------------------------- |
| `archived` | Set to `false` to restore a thread. |

<Warning>
  **Please note:** at this time you can only update the thread's status or restore a thread when making a `PATCH` request to this endpoint.
</Warning>

### Archive threads

You can archive a thread by making a `DELETE` request to `/conversations/v3/conversations/threads/{threadId}`.

If you use this endpoint to archive a thread, the thread will be moved to the trash and will be permanently deleted after 30 days. In the section above, learn how to restore a thread before it is permanently deleted.

### Add comments to threads

To add a comment to an existing thread, make a `POST` request to `/conversations/v3/conversations/threads/{threadId}/messages`. Comments only appear in the inbox and are not sent to visitors.

You can include the following fields in the request body when sending a comment:

| Field         | Description                                                                                                                                                                                                                                                 |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `type`        | The type of message you're sending. This value can either be `MESSAGE` or `COMMENT`.                                                                                                                                                                        |
| `text`        | The content of the message.                                                                                                                                                                                                                                 |
| `richText`    | The content of the message in HTML format. This is optional.                                                                                                                                                                                                |
| `attachments` | Any attachments to attach to the comment, specified as an object containing a `fileId`. If you want to include a specific attachment, you can upload it using the [Files API](/api-reference/legacy/files/guide) before making the call to add the comment. |

For example, your request body may look similar to the following:

```json theme={null}
{
  "type": "COMMENT",
  "text": "Can you follow up?",
  "richText": "<p>Can you follow up?</p>"
}
```

### Send messages to threads

Using this endpoint, an integration can send outgoing messages as a user in a HubSpot account. These messages are sent from the channel, just like if a user typed and sent a response in the inbox. To send a message to an existing thread, make a `POST` request to `/conversations/v3/conversations/threads/{threadId}/messages`.

<Warning>
  **Please note:** sending WhatsApp messages via a [connected WhatsApp business account](https://knowledge.hubspot.com/inbox/connect-whatsapp-to-the-conversations-inbox) is <u>not</u> supported using the conversations API.
</Warning>

When sending a message to a thread, you can include the following fields. You can include both the message details, as well as recipient information, in the request body.

| Field              | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `type`             | The type of message you're sending. This value can either be `MESSAGE` or `COMMENT`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `text`             | The content of the message.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `richText`         | The content of the message in HTML format. This is optional.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `recipients`       | An object representing the recipients of the message. This is the most important for email, where you can specify multiple recipients. This object includes the following fields: <ul><li>`actorID`: the ID associated with the message recipient.</li><li>`name`: the name of the recipient.</li><li>`recipientField`: for email messages, this is the type of recipient. Available values are `TO`, `CC`, or `BCC`.</li><li>`deliveryIdentifiers`: for email messages, this indicates the email addresses used for the visitor and agent.</li></ul> |
| `senderActorId`    | This must be an agent actor ID that is associated to the HubSpot user in the account who is sending the message.                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `channelId`        | The ID of a generic channel returned from the channels endpoint, like `1000` for live chat, `1001` for Facebook Messenger, `1002` for email, etc.                                                                                                                                                                                                                                                                                                                                                                                                     |
| `channelAccountId` | The ID of an account that is part of the `channelId` channel. On an existing thread, it is recommended to copy the `channelId` and `channelAccountId` of the most recent message on the thread.                                                                                                                                                                                                                                                                                                                                                       |
| `subject`          | The subject line of the email. This is ignored when sending a message to a non-email channel.                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `attachments`      | Any attachments to attach to the message, which can be specified as an object that contains a URL to a file hosted in your HubSpot account, or a list of quick replies if you're sending a message via Facebook Messenger or LiveChat. Learn more about how to include attachments [in the section below.](#include-attachments-in-messages)                                                                                                                                                                                                          |

For example, your request body may look similar to the following:

```json theme={null}
{
  "type": "MESSAGE",
  "text": "Hey there, following up",
  "richText": "<p>Hey there, following up</p>",
  "recipients": [
    {
      "actorId": "E-user@hubspot.com",
      "name": "Leslie Knope",
      "recipientField": "TO",
      "deliveryIdentifiers": [
        {
          "type": "HS_EMAIL_ADDRESS",
          "value": "lknope@hubspot.com"
        }
      ]
    }
  ],
  "senderActorId": "A-3892666",
  "channelId": "1002",
  "channelAccountId": "42423411",
  "subject": "Follow up"
}
```

If you make a successful request, the new message will be sent to the visitor. This can appear as a message in the chat widget, an email in the thread, a message in Facebook Messenger, etc.

### Assign or unassign a user to a thread

You can assign a specific user to a thread by making a `POST` request to `conversations/v3/conversations/threads/{threadId}/assignee`, then including the user's `actorId` in the request body.

For example, if you wanted to assign a user with an email address of `jdoe@hubspot.com` to a thread with an ID of `12345`, you'd make a `POST` request to `conversations/v3/conversations/threads/12345/assignee` with the following request body:

```json theme={null}
{
  "actorId": "jdoe@hubspot.com"
}
```

You can unassign a user from a thread by making a `DELETE` request to `conversations/v3/conversations/threads/{threadId}/assignee`.

## Include attachments in messages

Attachments can be links to a file hosted in the HubSpot files tool, or a set of quick replies if you're sending a message using Facebook Messenger or LiveChat.

To include an attachment from a file in your HubSpot account, provide the absolute URL as the `fileId` in the `attachments` field of the request body. For example, the corresponding part of the request body is shown in lines `16-18` below:

```json theme={null}
{
  "type": "MESSAGE",
  "text": "Hey there, following up",
  "recipients": {
    "actorID": "E-user@hubspot.com",
    "name": "Leslie Knope",
    "recipientField": "TO",
    "deliveryIdentifiers": [{ "type": "HS_EMAIL_ADDRESS", "value": "lknope@hubspot.com" }]
  },
  "senderActorId": "A-3892666",
  "channelId": "1002",
  "channelAccountId": "424232411",
  "subject": "Follow up",
  "attachments": {
    "fileId": "https://12345678.fs1.hubspotusercontent-na1.net/hubfs/12345678/doggo_video.mp4"
  }
}
```

If you connected Facebook Messenger or LiveChat as a channel, you can also specify a set of quick replies within the `attachments` field, which prompt the recipient with certain options that appear as tappable buttons below a message. Once tapped, the corresponding value of that option will be recorded.

Quick replies should be provided as a list of objects that each contain the following fields:

* `label`: the visible text that appears to the recipient (e.g., *Red*)
* `value`: the associated value of the button that you want to record (e.g., `RED`)
* `valueType`: the type of the quick reply option, which can be either `TEXT` or `URL`.

The example request body below demonstrates how to specify two quick reply options, *Yes* and *No*, on lines `21-32`:

```json theme={null}
{
  "type": "MESSAGE",
  "text": "Did that answer your question?",
  "recipients": {
    "actorID": "E-user@hubspot.com",
    "name": "Leslie Knope",
    "recipientField": "TO",
    "deliveryIdentifiers": [
      {
        "type": "HS_EMAIL_ADDRESS",
        "value": "lknope@hubspot.com"
      }
    ]
  },
  "senderActorId": "A-3892666",
  "channelId": "1002",
  "channelAccountId": "424232411",
  "subject": "Follow up",
  "attachments": [
    "type": "QUICK_REPLIES",
    "quickReplies": [
      {
        "label": "Yes",
         "value": "Yes",
         "valueType": "URL"
      },
      {
        "label": "No",
        "value": "No",
        "valueType": "TEXT"
      }
    ]
  ]
}
```

## Webhooks

Webhooks for conversations are also supported and can be used in tandem with the conversations API. You can use webhooks to subscribe to events about conversations, including thread creation, thread status and assignment changes, and new messages on threads. Learn more about using [webhooks](/api-reference/legacy/webhooks).

You must have the `conversations.read` scope to get access to following webhooks.

The available conversation webhook events are:

| Event                          | Description                                |
| ------------------------------ | ------------------------------------------ |
| `conversation.creation`        | A new thread has been created.             |
| `conversation.deletion`        | A thread has been archived.                |
| `conversation.privacyDeletion` | A thread has been permanently deleted.     |
| `conversation.propertyChange`  | A property of a thread has been updated.   |
| `conversation.newMessage`      | A new message has been posted on a thread. |

The available properties included in the payload for each event type are:

| Event                         | Properties                                                                                                                                                                                                                                                                                                                                                         |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `All events`                  | `objectId`: the ID of the Conversations thread that the webhook corresponds to.                                                                                                                                                                                                                                                                                    |
| `conversation.propertyChange` | <ul><li>`assignedTo`: a thread's assignment has changed. The value is the user ID of the new assignee, unless the owner was removed.</li><li>`status`: a thread's status has changed, either to `OPEN` or `CLOSED`.</li><li>`isArchived`: when a thread is restored a `conversation.propertyChange` webhook will be sent and the value will be `false`. </li></ul> |
| `conversation.newMessage`     | <ul><li>`messageId`: the ID of the new message.</li><li>`messageType`: the type of the new message. One of `MESSAGE`, `COMMENT`, `WELCOME_MESSAGE`.</li></ul>                                                                                                                                                                                                      |
