API Reference

The Dexra API allows you to programmatically manage conversations, users, and messages. All requests use standard HTTP methods and return JSON responses.

Base URL

bash
https://api.dexra.net/v1

Headers

Authorization: Bearer <YOUR_API_KEY>

Content-Type: application/json

Authentication

Dexra uses API keys to authenticate requests. You can view and manage your API keys in theDeveloper Settingsof your dashboard.

Security Notice

Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.

Conversations

Create, retrieve, and update conversation threads.

GET/conversations

List all conversations

Returns a paginated list of conversations for the authenticated workspace.

Parameters

NameTypeDescription
limitintegerMax number of results (default 20, max 100).
cursorstringPagination cursor for the next page.
statusstringFilter by status: "open", "closed", "snoozed".
Example Request
bash
curl -X GET https://api.dexra.net/v1/conversations?limit=10&status=open \
  -H "Authorization: Bearer YOUR_API_KEY"
Response
json
{
  "data": [
    {
      "id": "conv_892ns",
      "status": "open",
      "subject": "Billing Question",
      "created_at": "2023-10-25T10:00:00Z",
      "last_message": {
        "id": "msg_123",
        "text": "Hello, I need help..."
      }
    }
  ],
  "meta": { 
    "total": 154,
    "next_cursor": "dXNlcXHJfaWQ9MTI" 
  }
}
POST/conversations

Create a conversation

Initiates a new conversation thread with a user.

Parameters

NameTypeDescription
user_idREQstringThe unique ID of the user in your system.
subjectstringInitial subject line for the thread.
tagsarrayArray of tag strings to apply.
Example Request
bash
curl -X POST https://api.dexra.net/v1/conversations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ 
    "user_id": "u_9921", 
    "subject": "Login Issue",
    "tags": ["support", "urgent"]
  }'
Response
json
{
  "id": "conv_991ms",
  "status": "open",
  "created_at": "2023-10-25T10:05:00Z"
}
GET/conversations/:id

Retrieve a conversation

Get details of a specific conversation by ID.

Parameters

NameTypeDescription
idREQstringThe conversation ID.
Example Request
bash
curl -X GET https://api.dexra.net/v1/conversations/conv_991ms \
  -H "Authorization: Bearer YOUR_API_KEY"
Response
json
{
  "id": "conv_991ms",
  "status": "open",
  "participants": [...]
}

Messages

Send and receive messages.

POST/messages

Send a message

Post a new message to a specific conversation.

Parameters

NameTypeDescription
conversation_idREQstringTarget conversation ID.
contentREQstringMessage body (Markdown supported).
typestring"text" (default) or "private_note".
Example Request
bash
curl -X POST https://api.dexra.net/v1/messages \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "conversation_id": "conv_892ns",
    "content": "We have processed your refund.",
    "type": "text"
  }'
Response
json
{
  "id": "msg_772ks",
  "conversation_id": "conv_892ns",
  "status": "sent",
  "timestamp": 1698228000
}

Users

Manage customer profiles and attributes.

PATCH/users/:id

Update user attributes

Update custom traits for a user (e.g., plan, location).

Parameters

NameTypeDescription
idREQstringUser ID.
emailstringNew email address.
custom_attributesobjectKey-value pairs of custom data.
Example Request
bash
curl -X PATCH https://api.dexra.net/v1/users/u_9921 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "custom_attributes": {
      "plan": "enterprise",
      "ltv": 1200
    }
  }'
Response
json
{
  "id": "u_9921",
  "email": "jane@example.com",
  "custom_attributes": {
    "plan": "enterprise",
    "ltv": 1200
  }
}