API Overview
Introduction to the CommFlow API for developers building integrations and custom applications.
API Overview#
The CommFlow API allows developers to programmatically interact with CommFlow, enabling custom integrations, automation, and application development.
Introduction#
What Can You Do?#
With the CommFlow API, you can:
- Read data - Access conversations, contacts, tickets
- Create content - Send messages, create tickets
- Update records - Modify status, assignments
- Automate workflows - Trigger actions programmatically
- Build integrations - Connect with other tools
API Style#
CommFlow uses a RESTful API:
- Standard HTTP methods (GET, POST, PUT, DELETE)
- JSON request and response bodies
- Bearer token authentication
- Consistent error handling
Base URL#
All API requests use this base URL:
https://api.commflow.io/v1
Quick Start#
1. Get Your API Key#
- Go to Settings > API
- Click Create API Key
- Name your key
- Copy the key (shown only once)
2. Make Your First Request#
curl -X GET "https://api.commflow.io/v1/me" \
-H "Authorization: Bearer YOUR_API_KEY"Response:
{
"id": "user_123",
"email": "developer@company.com",
"name": "Developer",
"workspace": {
"id": "ws_456",
"name": "My Workspace"
}
}3. Explore Endpoints#
Browse available endpoints in this documentation or use the API playground.
Authentication#
API Keys#
API keys authenticate server-to-server requests:
Authorization: Bearer sk_live_xxxxxxxxxxxxxKey Types:
| Type | Prefix | Usage |
|---|---|---|
| Live | sk_live_ | Production requests |
| Test | sk_test_ | Development/testing |
OAuth 2.0#
For user-authorized applications:
- Redirect to authorization URL
- User grants permission
- Exchange code for access token
- Use token for requests
See Authentication for details.
Scopes#
API keys can be scoped to specific permissions:
| Scope | Access |
|---|---|
read:conversations | Read conversations |
write:conversations | Create/update conversations |
read:contacts | Read contact data |
write:contacts | Create/update contacts |
read:tickets | Read inbox tickets |
write:tickets | Create/update tickets |
Making Requests#
Request Format#
POST /v1/conversations/conv_123/messages HTTP/1.1
Host: api.commflow.io
Authorization: Bearer sk_live_xxxxx
Content-Type: application/json
{
"body": "Hello, how can I help?",
"type": "comment"
}Response Format#
All responses return JSON:
{
"data": {
"id": "msg_789",
"body": "Hello, how can I help?",
"type": "comment",
"created_at": "2026-01-15T10:30:00Z"
}
}HTTP Methods#
| Method | Usage |
|---|---|
| GET | Retrieve resources |
| POST | Create new resources |
| PUT | Update entire resource |
| PATCH | Partial update |
| DELETE | Remove resource |
Pagination#
List endpoints return paginated results:
Request#
GET /v1/conversations?page=1&per_page=25Response#
{
"data": [...],
"meta": {
"current_page": 1,
"per_page": 25,
"total_pages": 10,
"total_count": 250
},
"links": {
"first": "/v1/conversations?page=1",
"prev": null,
"next": "/v1/conversations?page=2",
"last": "/v1/conversations?page=10"
}
}Parameters#
| Parameter | Default | Max |
|---|---|---|
page | 1 | - |
per_page | 25 | 100 |
Filtering & Sorting#
Filtering#
Filter results with query parameters:
GET /v1/tickets?status=open&priority=urgent
GET /v1/contacts?email=*@company.com
GET /v1/conversations?created_after=2026-01-01Sorting#
Sort results:
GET /v1/tickets?sort=created_at&order=desc
GET /v1/contacts?sort=name&order=ascSearch#
Full-text search:
GET /v1/conversations?q=billing+issueError Handling#
Error Response Format#
{
"error": {
"type": "invalid_request_error",
"code": "invalid_parameter",
"message": "The 'email' field is required.",
"param": "email"
}
}HTTP Status Codes#
| Code | Meaning |
|---|---|
200 | Success |
201 | Created |
204 | No content (deleted) |
400 | Bad request |
401 | Unauthorized |
403 | Forbidden |
404 | Not found |
422 | Validation error |
429 | Rate limited |
500 | Server error |
Error Types#
| Type | Description |
|---|---|
invalid_request_error | Invalid parameters |
authentication_error | Auth failed |
authorization_error | No permission |
not_found_error | Resource not found |
rate_limit_error | Too many requests |
api_error | Server error |
Rate Limiting#
Limits#
| Plan | Requests/minute |
|---|---|
| Starter | 60 |
| Professional | 300 |
| Business | 1000 |
Headers#
Rate limit info in response headers:
X-RateLimit-Limit: 300
X-RateLimit-Remaining: 295
X-RateLimit-Reset: 1705320600Handling Rate Limits#
When rate limited (429 response):
- Check
Retry-Afterheader - Wait the specified time
- Retry the request
- Implement exponential backoff
Webhooks#
Receive real-time notifications:
Setting Up Webhooks#
- Go to Settings > API > Webhooks
- Add endpoint URL
- Select events to receive
- Save webhook
Webhook Payload#
{
"event": "ticket.created",
"timestamp": "2026-01-15T10:30:00Z",
"data": {
"id": "ticket_123",
"subject": "Need help with billing",
"status": "open"
}
}Available Events#
| Event | Description |
|---|---|
ticket.created | New ticket |
ticket.updated | Ticket changed |
ticket.assigned | Ticket assigned |
message.created | New message |
contact.created | New contact |
See Webhooks for full documentation.
SDKs & Libraries#
Official SDKs#
| Language | Package |
|---|---|
| Node.js | npm install @commflow/node |
| Python | pip install commflow |
| Ruby | gem install commflow |
| PHP | composer require commflow/commflow-php |
Example (Node.js)#
import CommFlow from '@commflow/node';
const commflow = new CommFlow('sk_live_xxxxx');
// Get a conversation
const conversation = await commflow.conversations.get('conv_123');
// Send a message
await commflow.messages.create('conv_123', {
body: 'Thanks for reaching out!',
type: 'comment'
});API Playground#
Test API calls interactively:
- Go to Settings > API > Playground
- Select endpoint
- Enter parameters
- Execute request
- View response
Best Practices#
Security#
- Keep keys secret - Never expose in client code
- Use environment variables - Don't hardcode keys
- Rotate keys - Periodically regenerate
- Scope appropriately - Minimal required permissions
Performance#
- Cache responses - Reduce API calls
- Use pagination - Don't fetch everything at once
- Handle rate limits - Implement backoff
- Batch requests - When possible
Error Handling#
- Check status codes - Handle all error types
- Log errors - For debugging
- Retry transient errors - 5xx errors
- Fail gracefully - Don't crash on API issues
Getting Help#
Resources#
- API Reference - Full endpoint documentation
- SDKs - Official client libraries
- Changelog - API updates and changes
- Status - API health status
Support#
- Documentation - Search the docs
- Community - Developer forums
- Email - api-support@commflow.io
Next Steps#
- Authentication - Auth deep dive
- Endpoints - Full endpoint reference
Was this page helpful?
Let us know if you found what you were looking for.