Overview
Retrieve a paginated list of SMS messages sent from your project. This endpoint supports filtering by date range and pagination to help you manage and analyze your message history.Endpoint
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | ❌ | Page number for pagination (default: 1) |
per_page | integer | ❌ | Number of messages per page (default: 20, max: 100) |
from | string | ❌ | Start date for filtering (YYYY-MM-DD format) |
to | string | ❌ | End date for filtering (YYYY-MM-DD format) |
Parameter Details
page
page
The page number for pagination.
- Default: 1
- Minimum: 1
- Type: Positive integer
per_page
per_page
Number of messages to return per page.
- Default: 20
- Minimum: 1
- Maximum: 100
- Recommended: 20-50 for optimal performance
from
from
Start date for filtering messages.
- Format: YYYY-MM-DD (e.g., “2024-01-01”)
- Timezone: UTC
- Inclusive: Messages from this date are included
to
to
End date for filtering messages.
- Format: YYYY-MM-DD (e.g., “2024-01-31”)
- Timezone: UTC
- Inclusive: Messages up to this date are included
Response
Success Response (200 OK)
Response Fields
| Field | Type | Description |
|---|---|---|
data | object | Laravel paginator with message records |
Message Object Fields
| Field | Type | Description |
|---|---|---|
short_message | string | Message content |
message_type | string | Always sms for SMS messages |
send_type | string | single or multiple |
contact_group_id | string | Contact group UUID if applicable |
message_consumption | integer | SMS parts consumed for this message |
created_at | string | ISO 8601 timestamp |
updated_at | string | ISO 8601 timestamp |
receiver | array | List of receipt objects for each recipient |
Pagination Object Fields
| Field | Type | Description |
|---|---|---|
current_page | integer | Current page number |
per_page | integer | Messages per page |
last_page | integer | Total number of pages |
total | integer | Total number of messages matching filters |
Summary Object Fields
| Field | Type | Description |
|---|---|---|
total_cost | number | Total cost of all messages in the filtered results |
total_messages | integer | Total number of messages |
delivered | integer | Number of delivered messages |
failed | integer | Number of failed messages |
pending | integer | Number of pending messages |
Error Responses
400 Bad Request
401 Unauthorized
Pagination Examples
Basic Pagination
Date Range Filtering
Use Cases
Message History
Review all messages sent from your project
Cost Analysis
Analyze messaging costs over time periods
Delivery Reports
Generate delivery reports for specific date ranges
Audit Trail
Maintain compliance records of all communications
Best Practices
Performance Tips
- Use date filters to limit the result set
- Implement pagination for large datasets
- Cache results when appropriate
- Use appropriate page sizes based on your use case