Retrieving Call Logs
Retrieve individual calls or paginated call logs, understand timestamps and duration, and collect records for reporting.
Retrieve calls
Use:
- Retrieve Call Information to retrieve a call using its SID.
- Retrieve All Call Information to retrieve a filtered, paginated list.
Use the intended account’s SID in the URL. Collect records for each subaccount separately.
Filter call logs
The list endpoint supports:
| Parameter | Purpose |
|---|---|
From | Filter by calling number. |
To | Filter by destination number. |
Status | Filter by call status. |
ParentCallSid | Find call legs associated with a parent call. |
StartTime | Filter by a specific start date. |
StartTime> / StartTime< | Supply start-date boundaries. |
EndTime | Filter by a specific end date. |
EndTime> / EndTime< | Supply end-date boundaries. |
Page | Zero-based page number. Defaults to 0. |
PageSize | Requested page size. Defaults to 50. |
Use yyyy-MM-dd date values. Date filters are interpreted using the account’s configured time zone.
For each date field, use either a specific date or range boundaries. URL-encode query parameters, including phone numbers containing +.
Example:
curl --get "https://api.textgrid.com/2010-04-01/Accounts/YOUR_ACCOUNT_SID/Calls.json" \
--user "YOUR_ACCOUNT_SID:YOUR_AUTH_TOKEN" \
--data-urlencode "StartTime=2026-11-09" \
--data-urlencode "Page=0" \
--data-urlencode "PageSize=50"curl --get "https://api.textgrid.com/2010-04-01/Accounts/YOUR_ACCOUNT_SID/Calls.json" \
-H "Authorization: Bearer YOUR_BASE64_ENCODED_CREDENTIALS" \
--data-urlencode "StartTime=2026-11-09" \
--data-urlencode "Page=0" \
--data-urlencode "PageSize=50"Replace the placeholders with your account’s values. For Bearer Token authentication, Base64-encode YOUR_ACCOUNT_SID:YOUR_AUTH_TOKEN.
Retrieve every page
The response contains a calls array and pagination information.
Start at page 0 and follow next_page_uri until it is absent or null. Resolve relative pagination paths against:
https://api.textgrid.comKeep the account and filters consistent throughout the export. Save or update records by call SID so repeated collection does not create duplicates.
Understand timestamps and duration
Call timestamps use the account’s configured time zone.
| Field | Meaning |
|---|---|
date_created | When the call record was created. |
start_time | Call start time. |
end_time | Call start time plus its recorded duration. |
duration | Call duration in seconds. |
JSON timestamps use a format such as:
Mon, 09 Nov 2026 14:30:00 +0000The +0000 suffix does not mean these account-local timestamps are UTC. Interpret them using the account’s configured time zone.
Do not use date_updated as a reliable timestamp for the latest status change. Use final-status webhooks and refresh records when you need current results.
Understand call records
Each record identifies a call or call leg.
sididentifies that call.parent_call_sid, when present, links it to a parent call.statusdescribes its current result.priceandprice_unitprovide cost information when available.
A connected or forwarded call can involve multiple related call legs. Do not assume one customer conversation always produces one record.
Use the returned status to determine the call result rather than inferring success from duration alone.
Collect records daily
For daily reporting:
- Select the reporting date using the account’s configured time zone.
- Retrieve every page.
- Save or update records using the call SID.
- Mark the collection complete only after all pages succeed.
- Revisit recent dates to refresh calls that were still in progress.
If a collection fails, retry the affected date and update existing records rather than inserting duplicates.
Use Voice Webhooks for final call notifications and periodically reconcile them with retrieved records.
Retrieve recordings separately
Call logs and recording audio are separate resources.
Use List Recordings with CallSid to find recordings associated with a call.
See Call Recording for recording and download instructions.
Handle retrieval errors
Check the HTTP status before treating a response as an empty result.
If you receive HTTP 409 with Please wait for existing API call to finish, allow the outstanding request to complete before retrying.
For persistent failures, contact support with the account SID, relevant call SID or date filters, approximate request time, and HTTP status. Do not include your Auth Token or Webhook Secret.
Protect call logs
Call records can contain phone numbers, captured keypad input, and recording references. Restrict access to exported records and retain only what your application needs.
Updated 14 days ago