Call purge APIs

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 APIarticle.

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.Creovai.io/purge/v1/calls

AttributeTypeDescription
idsarray[string]List of Call IDs to purge


Request (Session ID)

URL:  https://[INSTANCE NAME].Audio.Creovai.io/purge/v1/calls/sessions

AttributeTypeDescription
idsarray[string]List of Session IDs to purge


Request (Customer)

URL:  https://[INSTANCE NAME].Audio.Creovai.io/purge/v1/calls/customer

AttributeTypeDescription
phoneNumberstringCustomer's phone number


Response (Call ID, Session ID, or Customer)

AttributeTypeDescription
callIdstringCreovai call ID
sessionIdstringCreovai session ID
statusstringStatus 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).
errorMsgstringAny applicable error message
Tip: You may use the call status APIto see if the purging was complete.

Call purge by Call ID

Single call purge example

POST https://[INSTANCE NAME].Audio.Creovai.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.Creovai.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.Creovai.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.Creovai.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.Creovai.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.Creovai.io/purge/v1/calls/customer?whatIf=true HTTP/1.1.

The response status will return with "WhatIf" instead of "Purging".



Articles in this section


Was this article helpful?