Skip to main content
Fonoster keeps call records forever unless you say otherwise. This guide shows how to set how long each part of a record is kept, how to delete one part of a call or erase the whole call when someone asks, and how to read the audit log that records every deletion.
Retention, deletion, erasure and the audit log are available from the SDK and the HTTP API only. The dashboard and the CLI don’t have them yet.

Before you begin

You need:
  • The owner or admin role in the workspace. An API key has the role it was created with. Other roles can read the retention policies but can’t change them, delete anything or read the audit log.
  • An API key and Node.js 22 or later for the SDK, or an access token for the HTTP API. The quickstart shows how to install the SDK and sign in.
  • Familiarity with call records: their parts, versions and copies.

The parts you can delete

A record has three parts that you can delete on their own: Deleting the transcript takes the messages with it because the messages hold the same words. The record’s details stay: who called, when, for how long, and why it ended. Every deletion seals a new signed version of the record. The new version says what was removed, when, why and by whom, under fonoster.deletions. A webhook subscribed to call_record.sealed hears about it.

Set a retention policy

A retention policy deletes one part of every record once the call is older than a number of days. For example, delete recordings after 90 days and keep transcripts. Each part has its own policy, and a part without a policy is kept forever.
This script deletes recordings after 90 days and messages after 30, then prints the workspace’s policies:
set-retention.js
It prints one entry per policy:
To remove a policy and keep that part forever again, set its days to null:
Fonoster applies the policies every hour, so a part can outlive its policy by a little while. The age counts from when the call started. Each deletion is audited with the policy as its reason, such as retention policy: recording after 90 days.
A policy applies to records you already have, not only to new calls. Setting recording to 90 days deletes every recording older than 90 days on the next run, and deleted parts can’t be brought back.

Delete one part of a call

Delete a part of one call when someone asks you to remove a recording, for example. Give a reason: it goes into the audit log.
deletePart takes the call, the part and a reason:
After the deletion, reading the record returns the new version without that part. Asking for the deleted recording answers 404.

Erase a call

Erasing a call deletes every file and every version of it. Use it for a privacy request such as a right-to-erasure request. In place of the record, Fonoster seals a signed tombstone that says when, why and by whom the call was erased. The tombstone holds no parties and no content.
eraseRecord takes the call and a reason:
After an erasure:
  • The call no longer shows up in searches or under Calls.
  • Reading the record answers 410 with "error": "erased".
  • The phone numbers are cleared from the call’s details.
  • The audit log still lists the erasure.
  • No call_record.sealed event is sent for the tombstone.
Erasure can’t be undone.
If you leave the reason out, Fonoster records erasure request for an erasure and deletion request for a deleted part. Give a real reason, such as a ticket number, so the audit log can answer “why”.

Read the audit log

The audit log of a call lists every deletion and erasure, oldest first. It stays available after the call is erased.
getAudit returns the call’s entries:
Each entry has these fields:

Errors

The SDK methods for retention, erasure and the audit log are under CallRecords in the Node SDK reference.

Next steps

Call records

Read records, download recordings and verify signatures.

Record calls and ask for consent

Choose which calls are recorded in the first place.