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.getQueueStatus();
console.log(response);
}
main();curl -X GET 'https://api.periskope.app/v1/queue' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'x-phone: 919876543210'{
"is_running": true,
"active": 0,
"completed": 16,
"failed": 10,
"pending": 0
}{
"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
}Get Queue Status
Returns the live status of the message send queue of the phone in the x-phone header.
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.getQueueStatus();
console.log(response);
}
main();curl -X GET 'https://api.periskope.app/v1/queue' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'x-phone: 919876543210'{
"is_running": true,
"active": 0,
"completed": 16,
"failed": 10,
"pending": 0
}{
"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
}GET /message/queues/health insteadAuthorizations
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"
Response
The current status of the message queue
Live status of the message send queue of a phone. Every outgoing message and broadcast is queued on the phone instance and submitted to WhatsApp one job at a time.
Whether the message queue of the phone is currently running. Reverts to false while the phone connection is DISCONNECTED — queued jobs wait until the phone reconnects.
true
Number of jobs currently being processed (submitted to WhatsApp) by the queue
0
Number of jobs that completed successfully in the last 24 hours
16
Number of jobs that failed in the last 24 hours
10
Number of jobs currently waiting in the queue to be processed
0
Was this page helpful?