Reports API
The Reports API enables you to request a report of activity for your Vonage account.
Depending on your query pattern, you can choose from one of the two versions of the Reports API: asynchronous and synchronous. The asynchronous version is optimized for infrequent and large data queries (from several records to tens of millions). The synchronous version is optimized for frequent and periodic retrievals of small batches of data records (from one record to tens of thousand per query).
Only synchronous version supports retrival of data records by message/record ID.
Vonage recommends that you limit asynchronous queries to a maximum of 7 million records, by setting the start and end dates accordingly. On average, the asynchronous Reports API takes 5 - 10 minutes to generate 1 million records.
Reports API is a paid product. Full pricing is available at https://www.vonage.com/communications-apis/pricing/.
We recommend the unlimited option if you are going to retrieve more than 1M records per month.
Authentication
| Key | Description | Where | Example |
|---|---|---|---|
| Authorization | Base64 encoded API key and secret joined by a colon. | Headers | Basic <base64> |
SMS direction filter (mandatory)
inboundoutboundSMS delivery status filter
deliveredexpiredaccepteddeletedunknownsubmittedfailedrejectedbufferedSender ID
Recipient phone number
Country code
Mobile network code
Client reference
Account reference
Include message content
Show concatenated parts
SMS gateway
Gateway ID
Report identifier
Report status
Request received time
Processing start time
Download URL
Number of records
HAL links
Example Response»SMS report response with SMS-specific request parameters
{
"request_id": "string",
"status": "string",
"receive_time": "2019-08-24T14:15:22Z",
"start_time": "2019-08-24T14:15:22Z",
"download_url": "http://example.com",
"items_count": 0,
"request_params": {
"direction": "inbound",
"status": "delivered",
"from": "string",
"to": "string",
"country": "string",
"network": "string",
"client_ref": "string",
"account_ref": "string",
"include_message": true,
"show_concatenated": true,
"gateway": "string",
"gateway_id": "string"
},
"_links": {
"self": {
"href": "http://example.com"
}
}
}Authentication
| Key | Description | Where | Example |
|---|---|---|---|
| Authorization | Base64 encoded API key and secret joined by a colon. | Headers | Basic <base64> |
SMS direction filter (mandatory)
inboundoutboundSMS delivery status filter
deliveredexpiredaccepteddeletedunknownsubmittedfailedrejectedbufferedSender ID
Recipient phone number
Country code
Mobile network code
Client reference
Account reference
Include message content
Show concatenated parts
SMS gateway
Gateway ID
Report identifier
Report status
Request received time
Processing start time
Download URL
Number of records
HAL links
Example Response»SMS report response with SMS-specific request parameters
{
"request_id": "string",
"status": "string",
"receive_time": "2019-08-24T14:15:22Z",
"start_time": "2019-08-24T14:15:22Z",
"download_url": "http://example.com",
"items_count": 0,
"request_params": {
"direction": "inbound",
"status": "delivered",
"from": "string",
"to": "string",
"country": "string",
"network": "string",
"client_ref": "string",
"account_ref": "string",
"include_message": true,
"show_concatenated": true,
"gateway": "string",
"gateway_id": "string"
},
"_links": {
"self": {
"href": "http://example.com"
}
}
}Authentication
| Key | Description | Where | Example |
|---|---|---|---|
| Authorization | Base64 encoded API key and secret joined by a colon. | Headers | Basic <base64> |
Query Parameters
Account ID to filter reports (required for public endpoints)
Report status to filter by
PENDINGPROCESSINGSUCCESSFAILEDABORTEDStart date for report creation filter (ISO 8601 format)
End date for report creation filter (ISO 8601 format)
Authentication
| Key | Description | Where | Example |
|---|---|---|---|
| Authorization | Base64 encoded API key and secret joined by a colon. | Headers | Basic <base64> |
SMS direction filter (mandatory)
inboundoutboundSMS delivery status filter
deliveredexpiredaccepteddeletedunknownsubmittedfailedrejectedbufferedSender ID
Recipient phone number
Country code
Mobile network code
Client reference
Account reference
Include message content
Show concatenated parts
SMS gateway
Gateway ID
Example Request»SMS API request parameters
{
"direction": "inbound",
"status": "delivered",
"from": "string",
"to": "string",
"country": "string",
"network": "string",
"client_ref": "string",
"account_ref": "string",
"include_message": true,
"show_concatenated": true,
"gateway": "string",
"gateway_id": "string"
}{
"direction": "inbound",
"status": "delivered",
"from": "string",
"to": "string",
"country": "string",
"network": "string",
"client_ref": "string",
"account_ref": "string",
"include_message": true,
"show_concatenated": true,
"gateway": "string",
"gateway_id": "string"
}SMS direction filter (mandatory)
inboundoutboundSMS delivery status filter
deliveredexpiredaccepteddeletedunknownsubmittedfailedrejectedbufferedSender ID
Recipient phone number
Country code
Mobile network code
Client reference
Account reference
Include message content
Show concatenated parts
SMS gateway
Gateway ID
Report identifier
Report status
Request received time
Processing start time
Download URL
Number of records
HAL links
Example Response»SMS report response with SMS-specific request parameters
{
"request_id": "string",
"status": "string",
"receive_time": "2019-08-24T14:15:22Z",
"start_time": "2019-08-24T14:15:22Z",
"download_url": "http://example.com",
"items_count": 0,
"request_params": {
"direction": "inbound",
"status": "delivered",
"from": "string",
"to": "string",
"country": "string",
"network": "string",
"client_ref": "string",
"account_ref": "string",
"include_message": true,
"show_concatenated": true,
"gateway": "string",
"gateway_id": "string"
},
"_links": {
"self": {
"href": "http://example.com"
}
}
}Create Sync Report
Generate and immediately return report data synchronously. Supports query parameters for filtering. For large datasets, consider using async reports instead. Two query modes are supported: date-based queries (using date_start/date_end) or ID-based queries (using the id parameter). When using ID queries, only a limited subset of parameters are allowed: product, account_id, direction, id, include_message, hide_prices, show_concatenated.
Authentication
| Key | Description | Where | Example |
|---|---|---|---|
| Authorization | Base64 encoded API key and secret joined by a colon. | Headers | Basic <base64> |
Query Parameters
Product type for the report
SMSSMS-TRAFFIC-CONTROLVOICE-APIVOICE-REJECTEDVOICE-TTSIN-APP-VOICEWEBSOCKET-CALLASRAMDNUMBER-VERIFYVERIFY-V2NUMBER-INSIGHTNUMBER-INSIGHT-V2CONVERSATION-MESSAGECONVERSATION-EVENTMESSAGESMEETINGSVIDEO-APICAMARA-QODNETWORK-API-EVENTVONAGE-QODREPORTS-USAGEYour Vonage account ID
Start date for the report (ISO 8601 format). Required for date-based queries. Also supports relative dates like CURRENT_TIME-5M, CURRENT_TIME-5H, CURRENT_TIME-5D.
End date for the report (ISO 8601 format). Defaults to current time if not provided for date-based queries.
110001000Maximum number of records to return (1-1000). Default is 1000.
Pagination cursor for retrieving the next page of results (date-based queries only)
Initialization vector for encrypted cursor pagination (date-based queries only)
Comma-separated list of record IDs to retrieve (max 20 IDs). When using this parameter, only product, account_id, direction, include_message, hide_prices, and show_concatenated are allowed.
Direction filter - REQUIRED for SMS and Messages, optional for Voice (SMS/MESSAGES/VOICE-CALL/VOICE-FAILED/ASR).
inboundoutboundStatus filter (SMS/CONVERSATION-EVENT/IN-APP-VOICE/MESSAGES/VERIFY-V2/NUMBER-INSIGHT-V2)
Sender ID/number (SMS/MESSAGES/VOICE-CALL/VOICE-FAILED/ASR)
Recipient phone number (SMS/VOICE-CALL/VOICE-FAILED/ASR/MESSAGES/VERIFY-API/VERIFY-V2)
Country code filter (SMS/VOICE/MESSAGES/VERIFY-API/VERIFY-V2/NUMBER-INSIGHT)
Mobile network code filter (SMS/VOICE-CALL/VERIFY-API/VERIFY-V2/NUMBER-INSIGHT)
Client reference (SMS)
Phone number for lookup (NUMBER-INSIGHT))
Language/locale (VERIFY-API/VERIFY-V2)
Include message content in response (SMS/MESSAGES)
Show concatenated message parts (SMS)
Account reference (SMS)
SMS gateway (SMS)
Gateway ID (SMS)
Unique call identifier (VOICE-API/WEBSOCKET-CALL)
Unique leg identifier for the call (IN-APP-VOICE)
Messaging provider (MESSAGES)
Number type (VERIFY-API)
Verification channel (VERIFY-V2)
Parent request ID (VERIFY-V2)
Type of Request (NUMBER-INSIGHT-V2/NETWORK-API-EVENT)
Risk assessment level (NUMBER-INSIGHT-V2)
Whether the number has been ported/swapped (NUMBER-INSIGHT-V2)
Conversation ID (CONVERSATION-EVENT/CONVERSATION-MESSAGE/IN-APP-VOICE)
Session ID (MEETINGS/VIDEO-API)
Meeting ID (VIDEO-API)
Meeting subtype classification (MEETINGS)
Number of participant connections (MEETINGS)
Product name for Network API event (NETWORK-API-EVENT)
Session ID for Network API (NETWORK-API-EVENT)
API path (NETWORK-API-EVENT)
Correlation ID (NETWORK-API-EVENT)
HAL links for navigation
Cursor for pagination in synchronous requests
Initialization vector for encrypted message content
Unique request identifier
Synchronous request processing status
SUCCESSFAILURETRUNCATEDTimestamp when the request was received
Total number of records returned
Array of record data - structure varies based on product type
12aa3456The account ID (API key) of the Customer. Might be a main account id or a sub-account
aaaaaaaa-bbbb-cccc-dddd-0123456789abVonage's unique identifier for this message
customer1234It's used to identify separate accounts using the SMS endpoint for billing purposes. The field is optional in SMS API. It can be empty in the report
my-personal-referenceIf client-ref parameter were used by the Customer while calling SMS API, the value with Client's own reference will be shown in this field. Up to 100 characters.
outboundDirection of the call, either "inbound" or "outbound".
447700900001SMS sent from this phone number. The value specified by the Customer in "from" parameter in SMS API request (can be numeric, alpha-numeric or short code)
447700900000SMS sent to this phone number. In other words, the destination phone number.
44770090045The number used instead of "from" field by Vonage, but only if there are any special routing rules were applied. It will be empty if not applicable (e.g. "").
NXSMSThe number used instead of "from" field by Vonage, but only if if Number Pools API was used or if routing rules were changed due to compliance reasons. It will be empty if not applicable (e.g. "").
FALSEIndicates whether the SMS was split up into multiple parts (due to its length). The field will be available in the report if Reports API were called with the parameter show_concatenated= "true".
Hello World!Body of the message sent. Only present if include_message parameter is set to true.
12345The network code of the destination phone number. Taken from a carrier lookup (or sometimes the numbering plan), and always a master network code. Usually an MCC/MNC but sometimes alpha e.g US-FIXED
Orange Polska S.A.The name of the network code
PLThe ISO two letter country code to which the network code belongs in the numbering plan
PolandCountry name of the country code
{}Date when Vonage received SMS API request. Format: yyyy-mm-ddThh:mm:ss±hh:mm Time zone: UTC
{}Date when the SMS message reached its final state. Format: yyyy-mm-ddThh:mm:ss±hh:mm Time zone: UTC
42Latency of the request in ms
deliveredThe state of SMS message in the delivery process. The statuses are according to SMS Delivery statuses explained on Developer portal and in KB article
0The status of the SMS request. Will be a non 0 value if there has been an error, or if the status is unknown. See the Delivery Receipt documentation for more details
DeliveredDescription of the error code of the SMS request. See the Delivery Receipt documentation for more details
EURCurrency of the price of the SMS request.
0.036Price of the SMS request
0.036Price per message
aaaaaaaa-bbbb-cccc-dddd-0123456789abThe UUID of the record in the report
0DCS (Data Coding Scheme) is the encoding with which the message body was delivered to the phone. It is according to the value of the "type" parameter used in SMS API request. DCS = 0 (the default value) is for GSM/text. DCS = 8 is for unicode text messages DCS = 4 is for binary text messages
240210092938000+The validity period of the SMS message used in the "ttl" parameter of the SMS request. The duration in milliseconds the delivery of an SMS will be attempted. By default Vonage attempts delivery for 72 hours, however the maximum effective value depends on the operator and is typically 24 - 48 hours.
12.23.456.111The IP address of the Customer's server calling SMS API.
50003940401User Data Header, available if SMS was split up into multiple parts (due to its length). Pay attention: UDHs are not unique values. An 8 bit concatenation UDH is always going to start from "050003", then the reference e.g. "00" and then the total parts and part index e.g. "0201" for the first part of a two part message
Maximum number of records requested
Comma-separated list of record IDs that were not found (for ID-based queries)
Example Response
{
"_links": {
"self": {
"href": "http://example.com"
},
"next": {
"href": "http://example.com"
}
},
"cursor": "string",
"iv": "string",
"request_id": "string",
"request_status": "SUCCESS",
"received_at": "2019-08-24T14:15:22Z",
"items_count": 0,
"records": [
{
"account_id": "12aa3456",
"message_id": "aaaaaaaa-bbbb-cccc-dddd-0123456789ab",
"account_ref": "customer1234",
"client_ref": "my-personal-reference",
"direction": "outbound",
"from": "447700900001",
"to": "447700900000",
"forced_from": "44770090045",
"changed_from": "NXSMS",
"concatenated": "FALSE",
"message_body": "Hello World!",
"network": "12345",
"network_name": "Orange Polska S.A.",
"country": "PL",
"country_name": "Poland",
"date_received": {},
"date_finalized": {},
"latency": "42",
"status": "delivered",
"error_code": "0",
"error_code_description": "Delivered",
"currency": "EUR",
"total_price": "0.036",
"price": "0.036",
"id": "aaaaaaaa-bbbb-cccc-dddd-0123456789ab",
"dcs": "0",
"validity_period": "240210092938000+",
"ip_address": "12.23.456.111",
"udh": "50003940401"
}
],
"limit": 0,
"ids_not_found": "string"
}Errors
The following is a non-exhaustive list of error codes that may occur while using this API.
These codes are in addition to any of our generic error codes.
| Code | Information |
|---|---|
| invalid-request-parameters | Description The provided payload is invalid Resolution Modify your request to provide a valid payload |
| invalid-abort-operation | Description The job is already in a terminated state such as Resolution None |
| rate-limit | Description The request was rate limited. Resolution The Reports API supports 5 requests per second when used Asynchronously, and 10 requests per second Synchronously. Slow down your request rate. |