Call purge APIs
There are three APIs available to purge calls.
The Call ID and Session ID APIs use the same request and response. Either of these APIs can handle up to 100 IDs per request.
The Customer API uses the customer phone's number instead of a call or session ID. This API also gives you the option of querying which calls would be purged using a whatIf URL attribute.
Request (Call ID)
URL: https://[INSTANCE NAME].Audio.Tethr.io/purge/v1/calls
Attribute | Type | Description |
---|---|---|
ids | array[string] | List of Call IDs to purge |
Request (Session ID)
URL: https://[INSTANCE NAME].Audio.Tethr.io/purge/v1/calls/sessions
Attribute | Type | Description |
---|---|---|
ids | array[string] | List of Session IDs to purge |
Request (Customer)
URL: https://[INSTANCE NAME].Audio.Tethr.io/purge/v1/calls/customer
Attribute | Type | Description |
---|---|---|
phoneNumber | string | Customer's phone number |
Response (Call ID, Session ID, or Customer)
Attribute | Type | Description |
---|---|---|
callId | string | Tethr call ID |
sessionId | string | Tethr session ID |
status | string | Status of purge request |
|
||
errorMsg | string | Any applicable error message |
Call purge by Call ID
Single call purge example
POST https://[INSTANCE NAME].Audio.Tethr.io/purge/v1/calls HTTP/1.1 Authorization: Bearer [TOKEN] Content-Type: application/json; charset=utf-8 {"ids":["CallId"]}
Response
{ "items": [ { "callId": "CallId", "sessionId": "AssociatedSessionId", "status": "Purging", "errorMsg": null } ] }
Multiple call purge example
POST https://[INSTANCE NAME].Audio.Tethr.io/purge/v1/calls HTTP/1.1 Authorization: Bearer [TOKEN] Content-Type: application/json; charset=utf-8 {"ids":["CallId1", "CallId2", "BadCallId"]}
Response
{ "items": [ { "callId": "CallId1", "sessionId": "AssociatedSessionId1", "status": "Purging", "errorMsg": null }, { "callId": "CallId2", "sessionId": "AssociatedSessionId2", "status": "Purging", "errorMsg": null }, { "callId": "BadCallID", "sessionId": null, "status": "NotFound", "errorMsg": null } ] }
Call purge by Session ID
Single call purge example
POST https://[INSTANCE NAME].Audio.Tethr.io/purge/v1/calls/sessions HTTP/1.1 Authorization: Bearer [TOKEN] Content-Type: application/json; charset=utf-8 {"ids":["SessionId"]}
Response
{ "items": [ { "callId": "AssociatedCallId", "sessionId": "SessionId", "status": "Purging", "errorMsg": null } ] }
Multiple call purge example
POST https://[INSTANCE NAME].Audio.Tethr.io/purge/v1/calls/sessions HTTP/1.1 Authorization: Bearer [TOKEN] Content-Type: application/json; charset=utf-8 {"ids":["SessionId1", "SessionId2", "BadSessionId"]}
Response
{ "items": [ { "callId": "AssociatedCallId1", "sessionId": "SessionId1", "status": "Purging", "errorMsg": null }, { "callId": "AssociatedCallId2", "sessionId": "SessionId2", "status": "Purging", "errorMsg": null }, { "callId": null, "sessionId": BadSessionId, "status": "NotFound", "errorMsg": null } ] }
Call purge by customer phone number
Single phone number purge example
POST https://[INSTANCE NAME].Audio.Tethr.io/purge/v1/calls/customer HTTP/1.1 Authorization: Bearer [TOKEN] Content-Type: application/json; charset=utf-8 {"phoneNumber":"+15125551234"}
Response
{ "items": [ { "callId": "AssociatedCallId1", "sessionId": "SessionId1", "status": "Purging", "errorMsg": null }, { "callId": "AssociatedCallId2", "sessionId": "SessionId2", "status": "Purging", "errorMsg": null }, { "callId": null, "sessionId": "SessionId3", "status": "Purging", "errorMsg": null } ] }
?whatIf=true URL attribute in the POST URL like this:
POST https://[INSTANCE NAME].Audio.Tethr.io/purge/v1/calls/customer?whatIf=true HTTP/1.1.
The response status will return with "WhatIf" instead of "Purging".