Skip to main content
DELETE
/
queue
/
purge
Node.js
import { PeriskopeApi } from '@periskope/periskope-client';

const client = new PeriskopeApi({
 authToken: 'YOUR_API_KEY',
 phone: 'YOUR_PHONE_NUMBER', // e.g., '919876543210'
});

async function purgeQueue() {
 await client.queue.purge({
 queue_id: '63cda77b-73de-433e-a652-a8f489100d43'
 });

 console.log('Queue purge requested');
}

purgeQueue();

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-phone
string

Please provide the number of the phone you want to call with this API in the header. The number must be in country code + number format without any characters or spaces, e.g. 919876543210; Alternatively, provide the phone_id (phone-xxxxxxxxxxxx) in the header

Example:

"{{orgPhone}}"

Body

application/json
queue_id

Provide the queue_id of the message to purge only jobs in that queue (or an array of queue_id to purge multiple queues)

Example:

"63cda77b-73de-433e-a652-a8f489100d43"

broadcast_id
string

Provide the broadcast_id to purge all messages of that broadcast

Response

204 - application/json

204 No Content

204 No Content