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/v1

Rate Limits

API rate limits vary by plan:

PlanRequests/min
Starter60
Pro500
Enterprise2000

Endpoints

Chatbots

GET/v1/bots

List all chatbots

POST/v1/bots

Create a new chatbot

GET/v1/bots/:id

Get a specific chatbot

PATCH/v1/bots/:id

Update a chatbot

DELETE/v1/bots/:id

Delete a chatbot

Conversations

GET/v1/conversations

List conversations

GET/v1/conversations/:id

Get conversation with messages

Leads

GET/v1/leads

List all leads

GET/v1/leads/:id

Get a specific lead

PATCH/v1/leads/:id

Update lead status or add notes

Analytics

GET/v1/analytics/overview

Get analytics overview

Webhooks

GET/v1/webhooks

List webhooks

POST/v1/webhooks

Create 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.