Retrieving Call Logs

Retrieve individual calls or paginated call logs, understand timestamps and duration, and collect records for reporting.

Retrieve calls

Use:

Use the intended account’s SID in the URL. Collect records for each subaccount separately.

Filter call logs

The list endpoint supports:

ParameterPurpose
FromFilter by calling number.
ToFilter by destination number.
StatusFilter by call status.
ParentCallSidFind call legs associated with a parent call.
StartTimeFilter by a specific start date.
StartTime> / StartTime<Supply start-date boundaries.
EndTimeFilter by a specific end date.
EndTime> / EndTime<Supply end-date boundaries.
PageZero-based page number. Defaults to 0.
PageSizeRequested 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.com

Keep 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.

FieldMeaning
date_createdWhen the call record was created.
start_timeCall start time.
end_timeCall start time plus its recorded duration.
durationCall duration in seconds.

JSON timestamps use a format such as:

Mon, 09 Nov 2026 14:30:00 +0000

The +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.

  • sid identifies that call.
  • parent_call_sid, when present, links it to a parent call.
  • status describes its current result.
  • price and price_unit provide 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:

  1. Select the reporting date using the account’s configured time zone.
  2. Retrieve every page.
  3. Save or update records using the call SID.
  4. Mark the collection complete only after all pages succeed.
  5. 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.


Did this page help you?