import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
phone: '919876543210', // the phone to act with (x-phone)
});
async function main() {
const response = await client.queue.purgeQueue({
broadcast_id: '00000000-0000-0000-0000-000000000000',
});
console.log(response);
}
main();curl -X DELETE 'https://api.periskope.app/v1/queue/purge' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'x-phone: 919876543210' \
-H 'Content-Type: application/json' \
-d '{
"broadcast_id": "00000000-0000-0000-0000-000000000000"
}'{
"code": "ERROR",
"message": "The phone server is disconnected or not reachable",
"status": 400
}{
"code": "UNAUTHORIZED_ERROR",
"message": "Invalid bearer auth token",
"status": 401
}{
"code": "VALIDATION_ERROR",
"message": "Request validation failed",
"status": 422,
"fields": {
"body.chat_id": {
"message": "chat_id is required"
}
}
}{
"code": "RATE_LIMIT_ERROR",
"message": "You can only make 100 requests per second",
"status": 429
}{
"code": "UNKNOWN_ERROR",
"message": "Internal server error",
"status": 500
}Purge Queue
Removes jobs from the send queue by queue_id or broadcast_id. Warning: an omitted or empty body purges the ENTIRE queue. Messages already submitted to WhatsApp are unaffected.
import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
phone: '919876543210', // the phone to act with (x-phone)
});
async function main() {
const response = await client.queue.purgeQueue({
broadcast_id: '00000000-0000-0000-0000-000000000000',
});
console.log(response);
}
main();curl -X DELETE 'https://api.periskope.app/v1/queue/purge' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'x-phone: 919876543210' \
-H 'Content-Type: application/json' \
-d '{
"broadcast_id": "00000000-0000-0000-0000-000000000000"
}'{
"code": "ERROR",
"message": "The phone server is disconnected or not reachable",
"status": 400
}{
"code": "UNAUTHORIZED_ERROR",
"message": "Invalid bearer auth token",
"status": 401
}{
"code": "VALIDATION_ERROR",
"message": "Request validation failed",
"status": 422,
"fields": {
"body.chat_id": {
"message": "chat_id is required"
}
}
}{
"code": "RATE_LIMIT_ERROR",
"message": "You can only make 100 requests per second",
"status": 429
}{
"code": "UNKNOWN_ERROR",
"message": "Internal server error",
"status": 500
}POST /message/queues/purge instead.
The request body shape is the same, queue_ids and broadcast_id are acceptedAuthorizations
Your Periskope API token, sent as Authorization: Bearer <token>. Generate one from the Periskope dashboard under Settings → API & Webhooks. API access requires an active Pro or Enterprise plan.
Headers
Phone to act with: country code + number without symbols or spaces (e.g. 911111111111), or a phone_id (phone-xxxxxxxxxxxx). The phone must be connected to the org and accessible by the API token.
1"919876543210"
Body
Purge every queued job belonging to this broadcast
1"00000000-0000-0000-0000-000000000000"
Queue job id (the id field of a queue job), or an array of them, of the specific jobs to purge
["00000000-0000-0000-0000-000000000000"]
Response
Jobs purged — no content
Was this page helpful?