Authentication
This endpoint requires user authentication. You must be a member of the workspace to access its messages.
Path Parameters
The unique identifier of the workspace
Query Parameters
The page number for pagination (default: 1)
The number of messages per page (default: 50, max: 100)
Filter by message direction: “inbound” or “outbound”
Filter by message status: “queued”, “sent”, “delivered”, “failed”, etc.
Filter by sender phone number
Filter by recipient phone number
Filter messages after this date (ISO 8601 format)
Filter messages before this date (ISO 8601 format)
Response
Unique identifier of the message
Direction of the message: “inbound” or “outbound”
Current status of the message
Provider’s unique identifier for the message
Timestamp when the message was created
Whether there are more pages
{
"messages": [
{
"id": "msg_abc123",
"direction": "outbound",
"to": "+15551234567",
"from": "+15559876543",
"body": "Hello, this is a test message",
"status": "delivered",
"provider_sid": "SMxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"created_at": "2024-01-15T10:30:00Z"
}
],
"pagination": {
"currentPage": 1,
"totalPages": 5,
"totalMessages": 234,
"hasNext": true
}
}
curl "https://api.example.com/api/ui/workspaces/workspace_123/messages?page=1&limit=50&direction=outbound" \
-H "Authorization: Bearer YOUR_SESSION_TOKEN"