User Tools

Site Tools


api:pbx:recordingconsentrecords:invalidate

API : PBX : Recording consent record invalidate

Introduction

When a caller gives consent to have their call recorded via a Recording consent dialplan item, the consent is stored as a recording consent record.

A record is valid until its notValidAfter date and time. Invalidating (revoking) a record sets notValidAfter to the current date and time, so the consent is no longer valid and the caller will be asked for consent again on their next call.

With deleteRecordings set to true, every recording made on the consent is deleted as well - the audio files, transcriptions and AI summaries. That covers all recordings whose consent property holds the id of the record, also the personal recordings of employees the requesting user cannot open: the customer is the data controller and must be able to honour a request for deletion. Copies already sent by e-mail are outside TelecomX and are not affected. The record itself is kept, marked with revokedAt, recordingsDeletedAt and recordingsDeleted, as documentation that the consent was given and later withdrawn.

Request

This request invalidates a recording consent record.

If the record is already expired its notValidAfter is left untouched, so the original expiry date is preserved. Without deleteRecordings nothing else changes either. With deleteRecordings the recordings are deleted also for an expired record - a one-time consent expires the moment it is given, but its recordings are kept until their retention period ends.

The change is written to the changelog.

URL https://api.telecomx.dk/pbx/recordingconsent/records/CONSENT_RECORD_ID/invalidate
Method POST
Access level MANAGER or OWNER if the record belongs to the users own customer.
RESELLER if the customer belongs to the reseller.
RESELLER_ADMIN.
ADMIN.
Param CONSENT_RECORD_ID Id of the consent record (24 hex-char string)
Body deleteRecordings [optional] Boolean. True to also delete every recording made on the consent. Default false. The body may be left out entirely.

Query examples

POST https://api.telecomx.dk/pbx/recordingconsent/records/1234567890ABCDEF12345678/invalidate

POST https://api.telecomx.dk/pbx/recordingconsent/records/1234567890ABCDEF12345678/invalidate
{ "deleteRecordings": true }

Response

The updated recording consent record.

JSON object
Property Type Description
_id Id Unique id of the consent record.
customer Id Id of the customer the consent was given to.
when Date When the consent was given.
callerNumber String The callers phone number.
callerName String The callers name, if available. Null if not.
calleeNumber String The phone number that was called.
key String The key the caller pressed to give consent: 1 - 9. Null when basis is NOT_OBJECTED.
notValidAfter Date Set to the date and time the record was invalidated - unless it had already expired.
basis String CONSENT or NOT_OBJECTED, see List.
revokedAt Date When the record was revoked.
recordingsDeletedAt Date When the recordings made on the consent were deleted - only with deleteRecordings.
recordingsDeleted Number Number of recordings deleted on request (cumulative).

Example

{
  _id: '12345678901234567890ABCD',
  customer: '12345678901234567890AAAA',
  when: '2026-07-20T10:15:30.000Z',
  callerNumber: '4512345678',
  callerName: 'Anders And',
  calleeNumber: '4587654321',
  key: '1',
  notValidAfter: '2026-07-22T11:45:00.000Z'
}

Errors

Error code Message Description
400 invalid_data Id is not a valid ObjectId
403 access_denied Insufficient access level
404 not_found Recording consent record not found
500 internal_error Some recordings could not be deleted (the audio server failed) - the ones that were deleted are counted, a new request deletes the rest
api/pbx/recordingconsentrecords/invalidate.txt · Last modified: by Telecom X AI

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki