API and CLI workflows
Search calls, retrieve available transcripts and recordings, and manage historical imports. Use the command-line tool for manual tasks or call the API from your own software.
Use the API guide to create a key and make your first request.
Choose access and prepare
CLI or API: which should I use?
| Choose | Best for | What you need |
|---|---|---|
| CLI | People running searches or imports manually | Node.js 22+, a terminal, and a Developer API key |
| API | Apps, dashboards, scheduled jobs, and agency reporting systems | A developer and a secure place to store the key |
Both use the same permissions, location access, retained data, limits, and results. The CLI is a simpler way to use the API; it is not a separate data source.
Before you start
- In Call Census, open Developer → API keys .
- Create a key and choose the locations it may access.
-
Choose its permissions:
-
locations:readlists locations and connected sources. -
metrics:readreads reports, calls, transcripts, recordings, and import progress. -
imports:writestarts, confirms, pauses, resumes, or cancels historical imports.
-
- Copy the key when it is shown. Call Census does not show the full key again.
Query calls and reporting
Quick start with the CLI
Install the Call Census command-line tool with npm.
npm install --global @callcensus/cli@beta
Sign in. Paste the Developer API key only when the hidden prompt appears:
cc auth login
Check that the key works and your reporting data is ready.
cc auth status
cc doctor
If you do not want a global installation, use
npx --package @callcensus/cli@beta
before a command.
Find calls
Without dates, a search covers the latest 30 days in the Account timezone:
cc calls list
Find calls containing part of a phone number:
cc calls list --phone 7911123
Phone matching ignores spaces and punctuation. It searches caller, destination, and tracking numbers.
Find calls classified as converted during August 2026:
cc calls list \
--classification converted \
--from 2026-08-01 \
--to 2026-08-31
The first and last dates are both included. Filters can be combined.
| CLI option | Meaning |
|---|---|
--phone
|
Part or all of a caller, destination, or tracking number |
--identity
|
Caller name or saved contact details |
--location
|
A
loc_...
ID returned by
cc locations
|
--provider
|
CallRail or WhatConverts |
--classification
|
The effective result: human decision when reviewed, otherwise AI recommendation |
--human-decision
|
The confirmed human decision only, including
unreviewed
|
--outcome
|
The confirmed primary outcome |
--ai-recommendation
|
The original AI recommendation, even when a human disagreed |
--has-transcript true
|
Only calls with a transcript |
--has-recording true
|
Only calls with an available recording |
Add
--json
when another application needs structured output.
Open a call, transcript, or recording
A call search returns a public ID beginning with
call_
. Use that ID here:
cc calls get call_0123456789abcdef01234567
cc calls transcript call_0123456789abcdef01234567
cc calls recording call_0123456789abcdef01234567
The transcript command returns the Call Census transcript by default. Use
--source provider
to read a retained provider transcript separately.
The recording command returns a short-lived playback link. Older audio may need to be restored first; the CLI waits briefly and tells you if you need to retry.
Read reporting totals
cc locations
cc metrics summary --from 2026-08-01 --to 2026-08-31
Metric requests may cover up to 92 days at a time and use the Account timezone. Call-level searches can cover any call history retained by the Account when explicit dates are supplied.
AI estimates and confirmed human outcomes are separate figures. Missing Google Ads data means unavailable, not zero.
Import older calls
A historical import deliberately separates planning from processing:
- Scan: stores metadata and calculates an estimate. It does not download audio or request Call Census AI processing.
- Confirm: starts the selected recording, transcription, and recommendation work.
List connected CallRail and WhatConverts sources:
cc sources
Copy a
src_...
ID, then scan the latest 30 days:
cc imports scan src_0123456789abcdef01234567
Or scan a custom range or all provider-supported history:
cc imports scan src_0123456789abcdef01234567 \
--from 2026-01-01 \
--to 2026-08-31
cc imports scan src_0123456789abcdef01234567 --all-available
Check the scan and its estimate:
cc imports list
cc imports get imp_0123456789abcdef01234567
Confirm the default selection:
cc imports confirm imp_0123456789abcdef01234567
Customers can choose to skip shorter calls to reduce usage:
cc imports confirm imp_0123456789abcdef01234567 --minimum-duration 30
This example excludes recordings shorter than 30 seconds. The import pauses at the limit you approved for requests to your call tracker or for prepaid AI spending. If your account has a monthly processing allowance, reaching it can also pause the import.
Manage a running import:
cc imports pause imp_0123456789abcdef01234567
cc imports resume imp_0123456789abcdef01234567
cc imports cancel imp_0123456789abcdef01234567
Cancellation is permanent, but imported metadata is preserved. Historical recommendations remain review-only and are never automatically sent to Google Ads.
Connect directly to the API
The API origin is
https://api.callcensus.com
. Send the Developer API key in the
Authorization
header:
export CALL_CENSUS_API_TOKEN='your-key-from-call-census'
curl --fail-with-body 'https://api.callcensus.com/v1/developer/status' \
-H "Authorization: Bearer $CALL_CENSUS_API_TOKEN"
Wait until
dataset.status
is
ready
. HTTP 425 means your reporting data is still being prepared.
Search calls through the API
curl --fail-with-body \
'https://api.callcensus.com/v1/developer/calls?classification=converted&phone=7911' \
-H "Authorization: Bearer $CALL_CENSUS_API_TOKEN"
List responses include
data
,
total
,
next_cursor
,
applied_filters
,
freshness
, and
request_id
. Repeat the same request with
cursor
until
next_cursor
is null.
Start a metadata-only historical scan
curl --fail-with-body -X POST \
'https://api.callcensus.com/v1/developer/historical-imports' \
-H "Authorization: Bearer $CALL_CENSUS_API_TOKEN" \
-H 'Idempotency-Key: your-unique-value' \
-H 'Content-Type: application/json' \
--data '{"source_id":"src_0123456789abcdef01234567","range":{"mode":"recent"}}'
Creation, confirmation, pause, resume, and cancellation require a unique
Idempotency-Key
. This prevents an accidental retry from creating the same operation twice.
API endpoint map
| Task | Endpoint | Permission |
|---|---|---|
| Check key and dataset |
GET /v1/developer/status
|
Any valid key |
| List locations |
GET /v1/developer/locations
|
locations:read
|
| Read totals |
GET /v1/developer/metrics/summary
|
metrics:read
|
| Search calls |
GET /v1/developer/calls
|
metrics:read
|
| Read one call |
GET /v1/developer/calls/{call_id}
|
metrics:read
|
| Read transcript |
GET /v1/developer/calls/{call_id}/transcript
|
metrics:read
|
| Prepare recording |
POST /v1/developer/calls/{call_id}/recording-session
|
metrics:read
|
| List import sources |
GET /v1/developer/sources
|
locations:read
|
| Read imports |
GET /v1/developer/historical-imports
|
metrics:read
|
| Start or change imports |
POST /v1/developer/historical-imports...
|
imports:write
|
Download the complete OpenAPI contract for request and response schemas.
Resolve errors
Common errors
- 400: A date, filter, cursor, or request body is invalid.
- 401: The key is missing, expired, rotated, or revoked.
- 403: The key lacks permission or the request came from a blocked network.
- 404: The requested call, source, import, or location is not available to this key.
-
425:
Your reporting data is still being prepared. Follow
Retry-After. -
429:
Too many requests. Wait for
Retry-After. - 503: The service is temporarily unavailable or the reporting data could not be refreshed. Try again later.
Every API error includes a
request_id
. Include it when contacting support.