Records›Get Call Recordings

Get Call Recordings

Get a record’s call recordings, with the call, record and user each one belongs to and a temporary download link for the audio.

Available by request. Call recordings aren’t available through the API by default, even if your account records calls. Contact your Shape account admin to request access; Shape turns it on for your account. There’s no setting for it in Shape. Until it’s turned on, requests return 403 with “Call recordings aren’t enabled for the Open API on this account. Contact support to turn them on.”

GEThttps://secure-api.setshape.com/api/call-recordings/{crmid}

Replace {crmid} with your CRM ID. Send the standard Authorization: YOUR_API_AUTHORIZATION_KEY header. The API key must belong to the CRM ID in the URL: a branch’s key can’t read its parent system’s recordings, and a parent system’s key can’t read a branch’s.

Recordings can contain personal and financial information. Only use your API key in systems allowed to hold that data, and store downloaded recordings as securely as the rest of your customer data.

Filters

Send filters as query parameters. You must send at least one of: lead_id, call_id, or start_date with end_date. Filters can be combined: for example, lead_id with user_id returns one user’s calls on one record.

Parameter Type Required Description
lead_id integer One of the three Only calls on this record.
call_id integer One of the three One call.
start_date date One of the three, with end_date First day to include, as YYYY-MM-DD.
end_date date With start_date Last day to include, as YYYY-MM-DD. At most 31 days after start_date.
timezone string Optional The time zone your dates are in, as an IANA name like America/New_York. Default: America/Los_Angeles.
user_id integer Optional Only calls made or answered by this user, by user ID from Get Users.
per_page integer Optional Calls per page, 1 to 100. Default: 25.
cursor integer Optional For the next page: the next_cursor value from the previous response.

Example request

curl -H "Authorization: YOUR_API_AUTHORIZATION_KEY" \
  "https://secure-api.setshape.com/api/call-recordings/YOUR_CRM_ID?lead_id=281944"

Example response

Only calls that have a recording are returned, newest first.

{
  "success": true,
  "data": [
    {
      "call_id": 98213,
      "record": { "lead_id": 281944, "name": "Jordan Sample" },
      "user": { "id": 1024, "name": "Alex Example" },
      "direction": "outbound",
      "from": "5550100100",
      "to": "5550100142",
      "status": "completed",
      "provider": "plivo",
      "created_at": "2026-11-05T18:22:10Z",
      "call_duration_seconds": 312,
      "recording_duration_seconds": 305,
      "recordings": [
        {
          "part": 1,
          "format": "mp3",
          "url": "https://secure-api.setshape.com/api/call-recording/98213/1/YOUR_CRM_ID?expires=1762411030&signature=…",
          "expires_at": "2026-11-06T06:37:10Z"
        }
      ]
    }
  ],
  "next_cursor": null
}

Response fields

Field Description
success true when the request worked.
data The calls on this page. Can be empty.
call_id Shape’s ID for the call. Use it to match the call in your system.
record.lead_id The record the call belongs to. null if the call isn’t on a record.
record.name The record’s name.
user.id, user.name The user who made or answered the call.
direction inbound or outbound.
from, to The phone numbers on the call.
status The call status from the phone provider, such as completed.
provider The phone provider that carried the call.
created_at When the call started, in UTC (ISO 8601).
call_duration_seconds Length of the call, in seconds.
recording_duration_seconds Length of the recording, in seconds.
recordings The recording, in one or more parts. A call that was transferred, put on hold or recorded in segments can have several parts; play them in part order.
recordings[].part Part number, starting at 1.
recordings[].format mp3 or wav.
recordings[].url Download link for this part. If it’s null, the link couldn’t be created; request the list again, and contact Shape Support if it stays null.
recordings[].expires_at When the link stops working, in UTC.
next_cursor Send this as cursor to get the next page. null when there are no more results.

Calls with recording turned off, deleted calls and calls on deleted records are never returned.

Download a recording

Open the url exactly as the list returned it, without the Authorization header or any extra query parameters. A changed link is refused.

  • The response is the audio file (audio/mpeg for MP3, audio/x-wav for WAV).
  • It may be a 302 redirect to secure storage, so follow redirects: use curl -L, or your HTTP library’s follow-redirects option.
  • The link can be used in an HTML <audio> tag while it’s valid.
curl -L -o call-98213-part-1.mp3 "PASTE_THE_URL_HERE"
Download links expire after 15 minutes. Each link opens one part of one recording. Don’t store links: store the call_id, and request the list again when you need a fresh link.

Paging through results

  1. Send the first request without cursor.
  2. If next_cursor isn’t null, send the same request again with cursor set to that value.
  3. Stop when next_cursor is null.

A page can have fewer calls than per_page while next_cursor still has a value, so always keep going until next_cursor is null. To cover a long period, split it into date ranges of 31 days or less.

Errors

Errors return JSON with a message, for example: {"message": "Send lead_id, call_id, or start_date and end_date."}

Status Meaning What to do
400 A filter is missing or not valid, such as a bad date or a range over 31 days. Fix the request; the message says what’s wrong.
401 The API key isn’t valid, or the account isn’t active. Check the key and the Authorization header.
403 The key doesn’t belong to this CRM ID, or call recordings aren’t turned on for the API. On a download link: the link expired or was changed. Use the right CRM ID, ask your Shape account admin for access, or get a fresh link from the list.
404 The record or recording wasn’t found, or the phone provider no longer has the recording. Check the IDs.
429 Too many requests, or your account’s request limit was reached. Wait at least 60 seconds, then retry.
500 Something went wrong on Shape’s side. The message includes a reference code. Retry, or contact Shape Support with the reference code.
502 The phone provider didn’t return the audio. Retry in a few minutes.

Limits

Limit Value
List requests 20 per minute
Downloads 60 per minute
Calls per page 100
Date range per request 31 days
Download link lifetime 15 minutes

List requests count toward your account’s Open API request limit; downloads don’t.

Good practice

  • Keep your API key on your server. Never put it in a web page or mobile app.
  • Don’t store download links. Store the call_id and get a fresh link when you need the audio.
  • If turning off API access is needed, Shape can switch it off for your account, which also stops every download link already handed out.
  • If you think your API key was exposed, ask Shape Support to replace it.

Example: save every recording for one record

<?php
$apiKey = 'YOUR_API_AUTHORIZATION_KEY';
$crmId  = 'YOUR_CRM_ID';
$leadId = 281944;
$base   = 'https://secure-api.setshape.com';
$cursor = null;

do {
    $query = ['lead_id' => $leadId, 'per_page' => 100];
    if ($cursor) $query['cursor'] = $cursor;

    $ch = curl_init("$base/api/call-recordings/$crmId?" . http_build_query($query));
    curl_setopt_array($ch, [
        CURLOPT_HTTPHEADER     => ["Authorization: $apiKey"],
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_TIMEOUT        => 30,
    ]);
    $body = curl_exec($ch);
    $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);
    if ($code !== 200) { die("Error $code: $body"); }

    $page = json_decode($body, true);
    foreach ($page['data'] as $call) {
        foreach ($call['recordings'] as $rec) {
            if (!$rec['url']) continue;
            $file = "call-{$call['call_id']}-part-{$rec['part']}.{$rec['format']}";
            $fp = fopen($file, 'w');
            $dl = curl_init($rec['url']); // no Authorization header
            curl_setopt_array($dl, [CURLOPT_FILE => $fp, CURLOPT_FOLLOWLOCATION => true, CURLOPT_TIMEOUT => 120]);
            curl_exec($dl);
            curl_close($dl);
            fclose($fp);
        }
    }
    $cursor = $page['next_cursor'];
} while ($cursor);

More examples

One call:

curl -H "Authorization: YOUR_API_AUTHORIZATION_KEY" \
  "https://secure-api.setshape.com/api/call-recordings/YOUR_CRM_ID?call_id=98213"

One user’s calls for a week:

curl -H "Authorization: YOUR_API_AUTHORIZATION_KEY" \
  "https://secure-api.setshape.com/api/call-recordings/YOUR_CRM_ID?user_id=1024&start_date=2026-11-01&end_date=2026-11-07&timezone=America/Chicago"