https://support.tethr.com/hc/en-us/categories/115001740967-Developers Developers
https://support.tethr.com/hc/en-us/sections/115003048847-APIs APIs

Call purge APIs

New feature: content organization, collaboration and filtering

This article describes a new feature that may not be available to all users. If you don't see this feature and want to learn more, please contact your Tethr admin.
Section only
Required: You must be authorized to purge calls to use these APIs. If you need this permission, submit a request.
Tip: To request a bearer token, reference the Token authentication API article.

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
   
  • Purging: the call is in the process of being purged.
  • NotFound: the call may have already been purged or an invalid ID was supplied.
  • Error: an error occurred (see supplied error message).
errorMsg string Any applicable error message
Tip: You may use the call status API to see if the purging was complete.

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
        }
        
    ]
}

 

Tip: If you want to see which calls would be purged without actually purging the calls, include the
?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".