API Reference
Integrate DepartmentAI into your applications with our REST API.
Authentication
All API requests require authentication using an API key. Include your API key in the Authorization header:
curl -X GET "https://api.departmentai.com/v1/bots" \
-H "Authorization: Bearer dept_live_your_api_key"Base URL
https://api.departmentai.com/v1Rate Limits
API rate limits vary by plan:
| Plan | Requests/min |
|---|---|
| Starter | 60 |
| Pro | 500 |
| Enterprise | 2000 |
Endpoints
Chatbots
GET
/v1/botsList all chatbots
POST
/v1/botsCreate a new chatbot
GET
/v1/bots/:idGet a specific chatbot
PATCH
/v1/bots/:idUpdate a chatbot
DELETE
/v1/bots/:idDelete a chatbot
Conversations
GET
/v1/conversationsList conversations
GET
/v1/conversations/:idGet conversation with messages
Leads
GET
/v1/leadsList all leads
GET
/v1/leads/:idGet a specific lead
PATCH
/v1/leads/:idUpdate lead status or add notes
Analytics
GET
/v1/analytics/overviewGet analytics overview
Webhooks
GET
/v1/webhooksList webhooks
POST
/v1/webhooksCreate a webhook
Example Request
Here is an example of creating a new chatbot:
curl -X POST "https://api.departmentai.com/v1/bots" \
-H "Authorization: Bearer dept_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Support Bot",
"description": "Customer support assistant",
"systemPrompt": "You are a helpful support assistant.",
"model": "gpt-4",
"temperature": 0.7,
"settings": {
"greeting": "Hello! How can I help you today?"
}
}'Example Response
{
"success": true,
"bot": {
"id": "bot_abc123",
"name": "Support Bot",
"description": "Customer support assistant",
"systemPrompt": "You are a helpful support assistant.",
"model": "gpt-4",
"temperature": 0.7,
"isActive": true,
"settings": {
"greeting": "Hello! How can I help you today?"
},
"createdAt": "2024-01-15T10:30:00Z"
}
}Need Help?
If you have questions about the API, check our webhook documentation or contact our support team.