Skip to main content

Code Examples

Copy-paste examples for the most common API operations. All examples assume you have already authenticated and have your session token and workspace ID ready. For cURL examples, we assume:
  • Session cookie saved to cookies.txt (via curl -c cookies.txt during sign-in)
  • Workspace ID exported as $WORKSPACE_ID
For Node.js examples, we assume:
  • sessionToken contains your better-auth.session_token value
  • workspaceId contains your workspace UUID

Workflows

List All Workflows

cURL
Node.js

Create a Workflow

cURL
Node.js

Publish a Workflow

cURL
Node.js

Contacts

List Contacts (with Pagination)

cURL
Node.js

Create a Contact

cURL
Node.js

Update a Contact

cURL
Node.js

Conversations

List Conversations

cURL
Node.js

Get Conversation Messages

cURL
Node.js

Send a Message in a Conversation

cURL
Node.js
For WhatsApp conversations, sending messages is subject to the 24-hour customer service window. Messages can only be sent within 24 hours of the customer’s last inbound message. Outside this window, use approved message templates via broadcasts. Other channels (Instagram, Messenger, Live Chat) have their own messaging policies.

Runs

List Recent Runs

cURL
Node.js

Get Run Details and Steps

cURL
Node.js

Replay a Run

cURL
Node.js