---
title: "Get started with the Conversations API"
description: "Learn how the Conversations API works, how access is granted, and how to send your first reply."
url: "https://developers.klaviyo.com/en/docs/get_started_with_the_conversations_api"
category: "Build with Klaviyo"
lastUpdated: "2026-11-06"
related: ["https://developers.klaviyo.com/en/docs/llms.txt"]
---

# Get started with the Conversations API

> This is the Markdown version of https://developers.klaviyo.com/en/docs/get_started_with_the_conversations_api

Learn how the Conversations API works, how access is granted, and how to send your first reply.

When a brand uses Klaviyo for SMS and WhatsApp marketing, customers text back with questions about orders, sizing, and returns. Those replies land in Klaviyo, but many brands handle support in a separate help desk tool (Zowie, Kustomer, Richpanel, Crisp, Gorgias, and others).

The Conversations API is the bridge between the two. It lets an approved help desk or platform reply to a customer through the brand's existing Klaviyo SMS number or WhatsApp sender. The customer sees one continuous thread from one number, while support happens in the help desk.

> [!NOTE]
> The Conversations API sends replies into an existing conversation. To retrieve the full history of messages exchanged with a customer, use the [Events API](https://developers.klaviyo.com/en/reference/get_events.md).

## Before you begin

You'll need:

- The Conversations API enabled for your account or app (see [Request access](#request-access) below).
- A help desk or platform that will send the replies.
- A Klaviyo SMS or WhatsApp sender that the brand already uses.

Also check out our general [API overview](https://developers.klaviyo.com/en/reference.md) to make sure you're ready to get started with specific endpoints.

## How it works

The same flow applies to SMS and WhatsApp:

1. The customer messages the brand's Klaviyo SMS number or WhatsApp sender.
2. Klaviyo notifies the help desk with a webhook.
3. The help desk looks up the conversation's ID for that customer.
4. An agent replies, and the help desk sends that reply to the conversation.
5. Klaviyo accepts the message immediately with a `202 Accepted` response — accepted, but not yet delivered.
6. The customer receives the reply in the same thread, and Klaviyo reports `delivered` or `failed` back to the help desk via [webhook](https://developers.klaviyo.com/en/reference/webhooks.md).

## Request access

The Conversations API is gated: Klaviyo enables it per account or per partner app, and it isn't on by default. Without it enabled, sending a message returns a `403` error. Looking up a conversation does not require this same enablement.

To request access, contact your Klaviyo representative or submit [this form](https://docs.google.com/forms/d/1Km75VfMTGwDwAItezaCHtxlTfsxfuxGqDWqFLOFRdZQ/viewform). Requests may include a short security review before access is granted.

## Authentication

Choose one:

- **Private key** — send `Authorization: Klaviyo-API-Key pk_your_private_key`.
- **OAuth** — build a public OAuth app, obtain an access token through Klaviyo's authorization-code flow, then send `Authorization: Bearer your-access-token`. See [Set up OAuth](https://developers.klaviyo.com/en/docs/set_up_oauth.md) and [Create a public OAuth app](https://developers.klaviyo.com/en/docs/create_a_public_oauth_app.md).

## Scopes

- `profiles:read` and `conversations:read` to look up a conversation ID.
- `conversations:write` to send a message.

## Set up a test conversation

Before you begin, you'll need a conversation in your test account.

For SMS:

1. Text "JOIN" then "YES" to your Klaviyo sending number.
2. Text an unrecognized phrase, such as "I'm having trouble with my order, can you help me?", to your Klaviyo sending number.

For WhatsApp, start a conversation with your WhatsApp sender the same way.

To find your sending number, go to **Account > Settings**, then [SMS settings](https://www.klaviyo.com/settings/sms/sender-information) or [WhatsApp settings](https://www.klaviyo.com/settings/whatsapp).

## Send replies with an AI agent

```prompt Send help desk replies through Klaviyo's Conversations API
Connect this help desk to Klaviyo's Conversations API, so agents' replies reach customers in their existing Klaviyo SMS or WhatsApp thread.

First read https://developers.klaviyo.com/en/docs/get_started_with_the_conversations_api.md.

Ask me for these before you change anything, unless I've already given them:
- Whether Klaviyo has enabled the Conversations API for my account or app. If not, stop: sending returns `403` until I request access, which happens outside the code.
- How to authenticate: a private API key, or the OAuth access tokens this app already stores. Read them from the environment or the token store, and keep them out of source control and logs.
- How the help desk identifies a customer: by Klaviyo profile ID or by email.
- Where in this codebase replies are sent.

Then, following this codebase's language, framework and conventions:
1. On every request, send `Authorization: Klaviyo-API-Key <key>` (or `Authorization: Bearer <access token>`), `revision: 2026-07-15` and `Accept: application/json`. Looking up needs the `profiles:read` and `conversations:read` scopes; sending needs `conversations:write`.
2. Get the conversation ID with `GET https://a.klaviyo.com/api/profiles/<profile ID>/conversations/`, or by email with `GET https://a.klaviyo.com/api/profiles/?filter=equals(email,"<email>")&include=conversations`, reading the top-level `included` array. Choose the conversation whose `channel` (`sms` or `whatsapp`) matches. An email can match more than one profile, so handle that.
3. Send the reply with `POST https://a.klaviyo.com/api/conversation-messages/` and `Content-Type: application/json`. The body's `data.type` is `conversation-message`, with `attributes.body` and `relationships.conversation.data` set to `{ "type": "conversation", "id": "<conversation ID>" }`.
4. Treat `202 Accepted` as accepted, not delivered. Reject replies over 1,600 characters for SMS or 1,024 for WhatsApp before sending, and show clear errors for `400`, `403`, `404` and `413`.

Don't fetch message history through this API; that comes from the Events API.

When you're done, tell me what you changed and how to test it: text "JOIN", then "YES", then a question to the Klaviyo number from a test phone, send a reply, and check it arrives on the phone.
```

## Step 1: Retrieve a conversation ID

You need a conversation ID to send a message. Use whichever method below matches how you identify the customer — both return conversations across all channels, each with a `channel` attribute of `sms` or `whatsapp`.

### By profile ID

```curl Request
curl --location 'https://a.klaviyo.com/api/profiles/01HMYC4DXNQKJFGXDC1493J4QZ/conversations/' \
  --header 'Authorization: Klaviyo-API-Key pk_your_private_key' \
  --header 'revision: 2026-07-15' \
  --header 'Accept: application/json'
```

```json Response
{
  "data": [
    {
      "type": "conversation",
      "id": "01HQ71HFE865V215DE1CTEWH0A",
      "attributes": { "channel": "sms" },
      "relationships": {
        "profile": { "data": { "type": "profile", "id": "01HMYC4DXNQKJFGXDC1493J4QZ" } }
      },
      "links": { "self": null }
    },
    {
      "type": "conversation",
      "id": "01HQVNH9DN65R6PPG2X7R5JQC4",
      "attributes": { "channel": "whatsapp" },
      "relationships": {
        "profile": { "data": { "type": "profile", "id": "01HMYC4DXNQKJFGXDC1493J4QZ" } }
      },
      "links": { "self": null }
    }
  ],
  "links": {
    "self": "https://a.klaviyo.com/api/profiles/01HMYC4DXNQKJFGXDC1493J4QZ/conversations/"
  }
}
```

### By email

```curl Request
curl --location 'https://a.klaviyo.com/api/profiles/?filter=equals(email,%22bill.joel@klaviyo-demo.com%22)&include=conversations' \
  --header 'Authorization: Klaviyo-API-Key pk_your_private_key' \
  --header 'revision: 2026-07-15' \
  --header 'Accept: application/json'
```

Look up a profile by email and get its conversations in the top-level `included` array. This can return more than one profile and conversation, since email addresses are not unique. See [Get Profiles](https://developers.klaviyo.com/en/reference/get_profiles.md) for more.

> [!NOTE]
> To read the messages exchanged in a conversation (its history), use the [Events API](https://developers.klaviyo.com/en/reference/get_events.md) — look for `Sent SMS` and `Received SMS` events.

## Step 2: Send a conversation message

Send a message to the conversation ID from Step 1 — here, the SMS conversation retrieved above.

```curl Request
curl --request POST \
  --url https://a.klaviyo.com/api/conversation-messages/ \
  --header 'Authorization: Klaviyo-API-Key pk_your_private_key' \
  --header 'revision: 2026-07-15' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
    "data": {
      "type": "conversation-message",
      "attributes": { "body": "Let me look into that for you! -Thanks, Bobby" },
      "relationships": {
        "conversation": { "data": { "type": "conversation", "id": "01HQ71HFE865V215DE1CTEWH0A" } }
      }
    }
  }'
```

```json Response (202 Accepted)
{
  "data": {
    "type": "conversation-message",
    "id": "01HQB9CKDTBRZWPHCATWVWA70B",
    "attributes": {}
  }
}
```

A `202 Accepted` response means the message was accepted, not that it was delivered. Klaviyo reports final delivery or failure via [webhook](https://developers.klaviyo.com/en/reference/webhooks.md).

## Common errors

| Status code | Reason |
| :---------- | :----- |
| 400 | Missing or malformed `conversation` relationship. |
| 403 | The Conversations API isn't enabled for your account or app. Request access through your Klaviyo representative. |
| 404 | The profile ID doesn't exist on this account. |
| 413 | Message body exceeds the maximum length (1,600 characters for SMS, 1,024 characters for WhatsApp). |

## Additional resources

- [Conversations API overview](https://developers.klaviyo.com/en/reference/conversations.md)
- [Create Conversation Message](https://developers.klaviyo.com/en/reference/create_conversation_message.md)
- [Get Conversations for Profile](https://developers.klaviyo.com/en/reference/get_conversations_for_profile.md)
- [Set up OAuth](https://developers.klaviyo.com/en/docs/set_up_oauth.md)
- [Rate limits, status codes, and errors](https://developers.klaviyo.com/en/docs/rate_limits_and_error_handling.md)
