Documentation

Call Census API and CLI guide

Search calls, retrieve transcripts and recordings, read reporting totals, and manage historical imports. Start with the CLI if you are not a developer; use the API when another application needs to connect directly.

CLI or API: which should I use?

ChooseBest forWhat you need
CLIPeople running searches or imports manuallyNode.js 22+, a terminal, and a Developer API key
APIApps, dashboards, scheduled jobs, and agency reporting systemsA 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

  1. In Call Census, open Developer → API keys.
  2. Create a key and choose the locations it may access.
  3. Choose its permissions:
    • locations:read lists locations and connected sources.
    • metrics:read reads reports, calls, transcripts, recordings, and import progress.
    • imports:write starts, confirms, pauses, resumes, or cancels historical imports.
  4. Copy the key when it is shown. Call Census does not show the full key again.
Keep the key privateIt grants access to customer call data. Do not paste it into chat, source code, screenshots, or a command-line argument. Rotate it immediately if it is exposed.

Quick start with the CLI

Install the current beta:

npm install --global @callcensus/cli@beta

Sign in. Paste the Developer API key only when the hidden prompt appears:

cc auth login

Confirm that the key and its dataset are 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 optionMeaning
--phonePart or all of a caller, destination, or tracking number
--identityCaller name or projected identity
--locationA loc_... ID returned by cc locations
--providerCallRail or WhatConverts
--classificationThe effective result: human decision when reviewed, otherwise AI recommendation
--human-decisionThe confirmed human decision only, including unreviewed
--outcomeThe confirmed primary outcome
--ai-recommendationThe original AI recommendation, even when a human disagreed
--has-transcript trueOnly calls with a transcript
--has-recording trueOnly 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:

  1. Scan: stores metadata and calculates an estimate. It does not download audio or consume Call Census processed minutes.
  2. 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
Confirmation starts real processingBy default, confirmation selects every recorded call, secures its recording, creates a Call Census transcript, retains any provider transcript, and creates a review-only recommendation. Review the estimated provider requests and Call Census minutes before continuing.

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 before exceeding the remaining monthly processed-minute allowance or the authorised provider-request cap. Call Census does not silently raise either limit.

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 the initial projected dataset 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

TaskEndpointPermission
Check key and datasetGET /v1/developer/statusAny valid key
List locationsGET /v1/developer/locationslocations:read
Read totalsGET /v1/developer/metrics/summarymetrics:read
Search callsGET /v1/developer/callsmetrics:read
Read one callGET /v1/developer/calls/{call_id}metrics:read
Read transcriptGET /v1/developer/calls/{call_id}/transcriptmetrics:read
Prepare recordingPOST /v1/developer/calls/{call_id}/recording-sessionmetrics:read
List import sourcesGET /v1/developer/sourceslocations:read
Read importsGET /v1/developer/historical-importsmetrics:read
Start or change importsPOST /v1/developer/historical-imports...imports:write

Download the complete OpenAPI contract for request and response schemas.

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: The projected dataset or recording is still preparing. Follow Retry-After.
  • 429: Too many requests. Wait for Retry-After.
  • 503: The service or a safe data snapshot is temporarily unavailable.

Every API error includes a request_id. Include it when contacting support.