Skip to content
PingbackDocs
DevelopersBuild

Customer Conversations API

Build chat into your own site or app while Pingback runs Theo and routes replies from your team.

Scale · Server key + visitor token

When to use it

Use this API when you want chat inside your own product instead of the floating widget. Each conversation is stored in Pingback, Theo replies as usual and your team sees it in Inbox.

Set up your widget

Create a website widget in Channels › Website and set its domain to the site that hosts your chat. Your server starts each visitor conversation with a Scale Developer API key and hands only that conversation's token to the signed-in customer. Browser requests must come from the widget's domain.

Start a conversation

POST · from your server
POST https://api.pingback.live/api/v1/public/conversations
Authorization: Bearer pb_live_YOUR_SERVER_KEY
Content-Type: application/json

{
  "widget_id": "wdg_your_public_widget_id",
  "customer_name": "A customer",
  "customer_email": "[email protected]"
}
201 Created
{
  "conversation_id": "conv_api_example",
  "session_token": "pbcs_ONE_TIME_VISITOR_TOKEN",
  "expires_at": "2026-12-15T12:00:00+00:00",
  "status": "open",
  "owner": "theo"
}

Send a message

POST · safe to retry
POST https://api.pingback.live/api/v1/public/conversations/{conversation_id}/messages
Authorization: Bearer pbcs_VISITOR_TOKEN
Idempotency-Key: unique-message-id
Content-Type: application/json

{ "content": "Where is my order?" }

Messages can be up to 10,000 characters. You get 202 Accepted once it's saved. Retry with the same Idempotency-Key; reusing a key with different content returns 409.

Read replies

GET · poll for updates
GET https://api.pingback.live/api/v1/public/conversations/{conversation_id}?limit=50
Authorization: Bearer pbcs_VISITOR_TOKEN
Response
{
  "conversation_id": "conv_api_example",
  "status": "open",
  "owner": "human",
  "handoff_requested": true,
  "assigned": true,
  "messages": [
    {
      "id": "msg_example",
      "sender_type": "theo",
      "content": "I can help with that.",
      "created_at": "2026-11-15T10:00:00+00:00",
      "attachments": []
    }
  ],
  "next_after_id": "msg_example"
}

Poll with ?after_id=<next_after_id> for newer messages. You'll get customer, Theo and agent messages, plus whether Theo or a person owns the conversation. Internal notes are left out. Retry-After suggests a two-second interval.

Live updates with SSE

GET · short-lived stream
GET https://api.pingback.live/api/v1/public/conversations/{conversation_id}/stream?after_id=msg_previous
Authorization: Bearer pbcs_VISITOR_TOKEN
Accept: text/event-stream

The stream sends state changes, messages and keepalives, then closes after about 50 seconds. Reconnect with the last message ID. In browsers, use fetch-based SSE, because EventSource can't send the Authorization header.

Send a file

POST · multipart upload
POST https://api.pingback.live/api/v1/public/conversations/{conversation_id}/attachments
Authorization: Bearer pbcs_VISITOR_TOKEN
Idempotency-Key: unique-upload-id
Content-Type: multipart/form-data

file=<file>
content=Optional message text

The Idempotency-Key is required. Your plan's upload limit applies.

Let the customer resolve

POST
POST https://api.pingback.live/api/v1/public/conversations/{conversation_id}/resolve
Authorization: Bearer pbcs_VISITOR_TOKEN

This closes the conversation. After that, new customer messages are rejected.

Security

ControlBehaviour
WorkspaceTaken from the widget. Callers can't choose a workspace.
Visitor tokenRandom, stored hashed, for one conversation, expires after 30 days
OriginsBrowser requests must match the widget's domain
Suspended workspacesWrites are rejected

Customer email is optional and unverified. Sign customers in on your side before attaching account data.