API Reference
Integrate enuchat into your systems using the Tenant API. Manage conversations, send messages, and access billing data programmatically.
Authentication
All API requests are authenticated using an API key sent in the X-Api-Key header.
Getting your API key
- Go to Settings → API Keys in your dashboard
- Click Create API Key and give it a name
- Copy the key immediately — it's only shown once
- Store it securely (environment variable, secrets manager)
Making requests
Include the key in every request:
curl -H "X-Api-Key: tak_your_key_here" \
https://api.enuchat.com/api/v1/tenant-api/widgetsAll responses are JSON. Successful responses have a data field. Errors have an error field with code and message.
Security: API keys are hashed (SHA-256) in our database. We never store the raw key. Treat your key like a password — don't commit it to code or share it publicly.
Base URL
https://api.enuchat.com/api/v1/tenant-apiAll endpoints below are relative to this base URL.
Endpoints
GET /widgets
List all widgets for your account.
Response
{'{'}
"data": [
{'{'}
"id": "019d19c6-7e0b-...",
"name": "Main Website Chat",
"isActive": true,
"aiEnabled": true,
"translationEnabled": true,
"primaryColor": "#2563eb",
"position": "bottom-right"
}
]
}GET /conversations
List conversations, ordered by most recent message.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
status | string | Filter by status: open, pending, closed |
widgetId | string | Filter by widget UUID |
limit | integer | Max results (default 20, max 100) |
offset | integer | Skip N results |
Example
curl -H "X-Api-Key: tak_..." \
"https://api.enuchat.com/api/v1/tenant-api/conversations?status=open&limit=10"Response
{'{'}
"data": [
{'{'}
"id": "019d6724-000e-...",
"widgetId": "019d19c6-7e0b-...",
"visitorId": "v-abc123",
"visitorName": "John",
"visitorEmail": "john{'@'}example.com",
"visitorLanguage": "en",
"status": "open",
"assignedTo": null,
"lastMessageAt": "2026-04-11T14:30:00+00:00",
"startedAt": "2026-04-11T14:25:00+00:00"
}
]
}GET /conversations/{'{'}id}
Get a conversation with all messages.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
limit | integer | Max messages (default 50, max 200) |
Response
{'{'}
"data": {'{'}
"id": "019d6724-000e-...",
"visitorLanguage": "en",
"status": "open",
"messages": [
{'{'}
"id": "019d6724-1234-...",
"role": "visitor",
"content": "Hello, how much does it cost?",
"contentLanguage": "en",
"translatedContent": "Cześć, ile to kosztuje?",
"translatedLanguage": "pl",
"isAutoReply": false,
"createdAt": "2026-04-11T14:25:30+00:00"
},
{'{'}
"id": "019d6724-5678-...",
"role": "ai",
"content": "Our plans start at €19/month...",
"isAutoReply": true,
"createdAt": "2026-04-11T14:25:32+00:00"
}
]
}
}POST /conversations/{'{'}id}/messages
Send a message to a conversation. The message will be delivered to the visitor in real-time via the chat widget.
Request Body
{'{'}
"content": "Thanks for reaching out! We'll process your request.",
"role": "system"
}| Field | Type | Description |
|---|---|---|
content | string | Required. The message text. |
role | string | system (default) or operator |
Response (201 Created)
{'{'}
"data": {'{'}
"id": "019d6725-abcd-...",
"role": "system",
"content": "Thanks for reaching out!",
"createdAt": "2026-04-11T14:35:00+00:00"
}
}PATCH /conversations/{'{'}id}
Update a conversation's status or assignment.
Request Body
{'{'}
"status": "closed"
}| Field | Type | Description |
|---|---|---|
status | string | open, pending, or closed |
assignedTo | string|null | Operator UUID to assign, or null to unassign |
GET /billing/balance
Get your current plan and credit balance.
Response
{'{'}
"data": {'{'}
"plan": "pro",
"creditBalance": 4500000,
"totalCreditsAdded": 10000000
}
}Error Handling
Errors return a non-2xx status code with a JSON body:
{'{'}
"error": {'{'}
"code": "NOT_FOUND",
"message": "Conversation not found."
}
}| HTTP Status | Meaning |
|---|---|
401 | Invalid, expired, or missing API key |
400 | Invalid request body or parameters |
404 | Resource not found (or belongs to a different tenant) |
500 | Server error |
Common Use Cases
CRM Integration
Poll for new conversations and sync visitor data (name, email, language) to your CRM. Use the conversation ID as the external reference.
Automated Follow-ups
After a conversation is closed, send a follow-up message via the API: "Thanks for chatting! Is there anything else we can help with?"
Webhook Alternative
Until outgoing webhooks are available, poll the conversations endpoint periodically to detect new messages or status changes.
Bulk Operations
Close all conversations older than 7 days, assign conversations to operators based on external logic, or export conversation history for analytics.
Rate Limits
The API allows up to 60 requests per minute per API key. If you exceed this limit, you'll receive a 429 Too Many Requests response. Wait and retry with exponential backoff.