List Channels
GET/api/channels
List communication channels with optional filtering and search.
Search will look for matches in channel name, send_from_email, and send_from_phone_number.
Sample API Calls:
- Get first page of all channels:
GET /api/channels?page=1&page_size=20
- Get only SMS channels:
GET /api/channels?channel_type=sms&page=1&page_size=20
- Get available email channels:
GET /api/channels?channel_type=email&status=available&page=1&page_size=20
- Search for channels:
GET /api/channels?search=support&page=1&page_size=20
- Get channels as dropdown options:
GET /api/channels?for_options=true
Sample Response (for_options=false):
{
"channels": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"tenant_id": "123e4567-e89b-12d3-a456-426614174001",
"name": "Support Email",
"channel_type": "email",
"integration_id": "123e4567-e89b-12d3-a456-426614174002",
"send_from_email": "support@example.com",
"email_domain_id": "123e4567-e89b-12d3-a456-426614174003",
"status": "available",
"is_default": true,
"metadata": {},
"created_at": "2024-10-03T12:00:00Z",
"updated_at": "2024-10-03T14:30:00Z"
},
{
"id": "223e4567-e89b-12d3-a456-426614174010",
"tenant_id": "123e4567-e89b-12d3-a456-426614174001",
"name": "SMS - (555) 123-4567",
"channel_type": "sms",
"integration_id": "323e4567-e89b-12d3-a456-426614174011",
"send_from_phone_number": "+15551234567",
"phone_number_id": "423e4567-e89b-12d3-a456-426614174012",
"status": "available",
"is_default": false,
"metadata": {},
"created_at": "2024-10-03T13:00:00Z"
}
],
"total": 15,
"page": 1,
"page_size": 20,
"total_pages": 1
}
Sample Response (for_options=true):
{
"options": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Support Email (support@example.com)",
"identifier": "support@example.com",
"category": "email",
"status": "available"
},
{
"id": "223e4567-e89b-12d3-a456-426614174010",
"name": "SMS - (555) 123-4567 (+15551234567)",
"identifier": "+15551234567",
"category": "sms",
"status": "unavailable",
"disabled_reason": "Phone number sms not enabled"
},
{
"id": "323e4567-e89b-12d3-a456-426614174020",
"name": "Sales Email (sales@example.com)",
"identifier": "sales@example.com",
"category": "email",
"status": "unavailable",
"disabled_reason": "Domain not authorized"
},
{
"id": "423e4567-e89b-12d3-a456-426614174030",
"name": "Old Channel (old@example.com)",
"identifier": "old@example.com",
"category": "email",
"status": "inactive",
"disabled_reason": "User deactivated"
}
],
"total": 4
}
Request
Responses
- 200
- 404
- 422
Successful Response
Not found
Validation Error