Skip to content

Delete CDR range (requires confirmation)

DELETE
/v1/ns/{nsid}/cdrs
curl --request DELETE \
--url 'https://example.com/v1/ns/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/cdrs?to=2026-04-15T12%3A00%3A00Z' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "confirm_id": "example", "confirm_timestamp": 1 }'

Permanently erases every CDR whose event time falls in [from, to]. to is required — it is not defaulted to now, which would purge the most recent records rather than aged ones. Requires a confirmation body (see the 412 response); the 412 echoes the resolved date range.

nsid
required
string format: uuid

Namespace UUID

to
required
string format: date-time

Upper cutoff (RFC3339 or unix seconds). Required: the range is not defaulted, so a purge cannot accidentally erase the newest 24 hours.

from
string format: date-time

Lower bound (RFC3339 or unix seconds). Optional; defaults to 24h before to, so an omitted bound erases less, never the whole history.

include_children
boolean

Destructive-action confirmation with confirm_id (nsid string) and confirm_timestamp (unix int, within one hour of server time).

Media typeapplication/json
object
confirm_id
string
confirm_timestamp
integer
Examplegenerated
{
"confirm_id": "example",
"confirm_timestamp": 1
}

OK

Media typeapplication/json
object
success
required
boolean
legs_deleted
required
integer
calls_deleted
required
integer
Examplegenerated
{
"success": true,
"legs_deleted": 1,
"calls_deleted": 1
}

Confirmation required (missing or stale body). The problem detail and its from/to fields echo the resolved date range to be purged.

Media typeapplication/problem+json

RFC 7807 Problem Details

object
type

Problem type slug URI

string
title
string
status
integer
detail
string
key
additional properties
any
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example"
}

Error response

Media typeapplication/problem+json

RFC 7807 Problem Details

object
type

Problem type slug URI

string
title
string
status
integer
detail
string
key
additional properties
any
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example"
}