# Website chat API for visitor chats

> Otobiz gives you one REST API for Website chat: 19 endpoints for visitor chats, called with one Bearer key.

Page: https://otobiz.ai/website-chat-api

## Three steps to your first call

### Make an API key

In Otobiz, open API keys and make one. It acts with the role you pick, and is shown once. https://app.otobiz.ai/apikeys

```sh
# The key from Otobiz, under API keys
export OTOBIZ_API_KEY="otbz_..."

curl https://app.otobiz.ai/api/v1/account \
  -H "Authorization: Bearer $OTOBIZ_API_KEY"
```

### Connect Website chat on your site

The link opens Connections in Otobiz. Add Website chat there, then paste its one line of code into your site.

```sh
# The answer carries "url": open it to connect Website chat
curl https://app.otobiz.ai/api/v1/connect-sessions \
  -H "Authorization: Bearer $OTOBIZ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "kind": "web_chat" }'
```

### Make one call

Every call is HTTPS and JSON, with the key as a Bearer token.

```sh
# Reply in a Website chat, with two buttons
curl https://app.otobiz.ai/api/v1/conversations/$CHAT_ID/messages \
  -H "Authorization: Bearer $OTOBIZ_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: reply-1042" \
  -d '{ "text": "Which size?", "interactive": { "type": "buttons", "buttons": [{ "title": "Small" }, { "title": "Large" }] } }'
```

## Website chat endpoints by job

19 endpoints work on Website chat, read from the API's own spec. Every path starts with https://app.otobiz.ai/api/v1.

### Chats and messages (19)

| Method | Path | What it does |
|---|---|---|
| POST | `/conversations/{id}/ai-reply/send` | Send the AI's reply |
| GET | `/inbox/availability` | Who is away, and your own availability |
| PATCH | `/inbox/availability` | Set your own availability |
| GET | `/inbox/conversations` | List chats |
| GET | `/inbox/conversations/requests` | List message requests |
| GET | `/inbox/conversations/{conversationId}` | Get a conversation |
| GET | `/inbox/conversations/{conversationId}/contact-profile` | Get a Messenger chat's language, time zone and gender |
| POST | `/inbox/conversations/{conversationId}/events` | Record an event on a chat: a fact the agent grounds on, or one it tells the customer about |
| GET | `/inbox/conversations/{conversationId}/members` | List who is in a group conversation |
| GET | `/inbox/conversations/{conversationId}/messages` | Read a conversation's messages |
| POST | `/inbox/conversations/{conversationId}/messages` | Send a message |
| GET | `/inbox/conversations/{conversationId}/messages/{messageId}` | Get a message |
| PATCH | `/inbox/conversations/{conversationId}/messages/{messageId}` | Edit a sent message, or move a scheduled one |
| POST | `/inbox/conversations/{conversationId}/messages/{messageId}/retry` | Send a failed message again |
| POST | `/inbox/conversations/{conversationId}/typing` | Show the customer you are typing |
| GET | `/inbox/items` | List what waits in the Inbox |
| GET | `/inbox/labels` | List the brand's inbox labels |
| POST | `/inbox/labels` | Create an inbox label |
| POST | `/inbox/messages/search` | Search messages |

### On every channel

The same four jobs sit beside every channel's own endpoints.

| Method | Path | What it does |
|---|---|---|
| POST | `/connect/sessions` | Get the link where a brand member connects a channel, an app or a saved login |
| GET | `/connect/sessions/{sessionId}` | Where a connect link stands, or wait for it to finish |
| GET | `/connections` | List connections |
| POST | `/connections/{connectionId}/disconnect` | Disconnect one connection |
| GET | `/contacts` | List contacts |
| POST | `/contacts` | Create a contact |
| PATCH | `/contacts/{contactId}` | Update a contact |
| PATCH | `/contacts/{contactId}/consent` | Record a contact's marketing opt-in or opt-out |
| POST | `/files` | Add a file |
| GET | `/files/{fileId}` | Get a file |
| POST | `/webhooks/settings` | Register a webhook endpoint |
| POST | `/webhooks/test` | Send webhook_endpoint.tested to an endpoint |
| GET | `/webhooks/logs` | The webhook delivery log |

## What Website chat takes

- **Message text.** Up to 4,096 characters.
- **Buttons.** Up to 10 reply buttons; also a list, a link button and a card carousel.
- **Reply window.** No time limit on replies.
- **Delivery status.** Sent only. The platform reports no delivery or read.

## What every send carries

- **Consent checked.** Every send checks the contact's consent first. A refused send answers 409 with the reason.
- **Opt-outs hold.** A person who opted out is on the suppression list, and no call can message them.
- **No double sends.** Send an Idempotency-Key header and a retry is safe. The key is remembered for 24 hours.
- **One answer per customer.** A send takes the chat over from an automation in flight, so the customer never gets two replies.
- **Approval where you ask.** A send from an AI agent's key waits for a reviewer and answers 202 approval_required.
- **Every send recorded.** Each send lands in your activity feed, and validateOnly=true runs every check without sending.

## What comes back

POST /inbox/conversations/{conversationId}/messages answers:

- 200: Sent, a note or a scheduled message written, or, with validateOnly=true, the passed check
- 202: Accepted: it goes out shortly (status `queued`)
- 402: The brand has no active plan. Replies are paused
- 403: Your role cannot send replies
- 409: An automated reply is mid-send, this Idempotency-Key is in flight, or this person cannot be messaged here (`first_contact_not_allowed`, `suppressed`, `reconnect_required`)
- 429: Too many requests (`rate_limited`)

Event `message.received`:

```json
{
  "id": "evt_00000000008008000000000000",
  "type": "message.received",
  "apiVersion": "v1",
  "createdAt": "2026-10-09T09:30:00.000Z",
  "data": {
    "object": {
      "id": "msg_01j2jxbb4pex5vsknk084sn041",
      "conversationId": "cnv_01j2jxbb4pex5vsknk084sn03g",
      "channel": "web_chat",
      "direction": "inbound",
      "role": "reply",
      "status": "received",
      "body": "Is the large box in stock?",
      "createdAt": "2026-11-18T09:30:00.000Z"
    }
  }
}
```

Event `message.sent`:

```json
{
  "id": "evt_00000000008008000000000000",
  "type": "message.sent",
  "apiVersion": "v1",
  "createdAt": "2026-10-09T09:30:00.000Z",
  "data": {
    "object": {
      "id": "msg_01j2jxbb4pex5vsknk084sn040",
      "conversationId": "cnv_01j2jxbb4pex5vsknk084sn03g",
      "channel": "web_chat",
      "direction": "outbound",
      "role": "reply",
      "status": "delivered",
      "body": "Yes, the large box is in stock. Shall I keep one for you?",
      "createdAt": "2026-11-18T09:31:00.000Z"
    }
  }
}
```

A shortened sample from the API's own examples. The docs list every field.

```sh
# Register where the events go
curl https://app.otobiz.ai/api/v1/webhook-endpoints \
  -H "Authorization: Bearer $OTOBIZ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "My server", "url": "https://example.com/otobiz", "events": ["message.received", "message.sent"] }'
```

## No fee per call. You pay for your plan.

Website chat comes with Growth, Business and Enterprise. A call pays only for what it causes, such as a message sent. The API and the MCP server come with it. Plans: https://otobiz.ai/pricing

## Questions

### How do I send a Website chat message with an API?

Make an Otobiz API key, connect Website chat (paste one line on your site), then call POST /api/v1/conversations/{id}/messages with the key as a Bearer token.

### How do I connect Website chat to the API?

Call POST /api/v1/connect-sessions with the kind web_chat. The answer carries a link: open it, finish the steps, and the channel is connected. The link opens Connections in Otobiz. Add Website chat there, then paste its one line of code into your site.

### What are the Website chat message limits?

Up to 4,096 characters. Replies have no time limit.

### Does the Website chat API cost extra?

No. There is no fee per call. You pay for the Otobiz plan that opens Website chat, and for what a call causes, such as a message sent.

What Otobiz does on Website chat: https://otobiz.ai/connections/website-chat

More: https://otobiz.ai/developers.md
