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.getQueueJobs();
console.log(response);
}
main();curl -X GET 'https://api.periskope.app/v1/queue/jobs' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'x-phone: 919876543210'[
{
"data": {
"chat_id": "120363000000000000@g.us",
"body": "Hello from Periskope!",
"message_type": "chat",
"quoted_message_id": "",
"unique_id": "00000000-0000-0000-0000-000000000000",
"performed_by": "api"
},
"id": "00000000-0000-0000-0000-000000000000",
"message_id": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"status": "completed",
"stacktrace": [
"Error: Evaluation failed: t"
],
"attemptsStarted": 1,
"attemptsMade": 1,
"addedTimestamp": 1737373507280,
"finishedTimestamp": 1737373510691,
"processedTimestamp": 1737373507380
}
]{
"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
}Fetch Queue Jobs
Lists the jobs in the send queue of the phone — scheduled, waiting, in flight, completed or failed.
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.getQueueJobs();
console.log(response);
}
main();curl -X GET 'https://api.periskope.app/v1/queue/jobs' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'x-phone: 919876543210'[
{
"data": {
"chat_id": "120363000000000000@g.us",
"body": "Hello from Periskope!",
"message_type": "chat",
"quoted_message_id": "",
"unique_id": "00000000-0000-0000-0000-000000000000",
"performed_by": "api"
},
"id": "00000000-0000-0000-0000-000000000000",
"message_id": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"status": "completed",
"stacktrace": [
"Error: Evaluation failed: t"
],
"attemptsStarted": 1,
"attemptsMade": 1,
"addedTimestamp": 1737373507280,
"finishedTimestamp": 1737373510691,
"processedTimestamp": 1737373507380
}
]{
"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 instead.
Pass queue_id or broadcast_id in the request body to filterAuthorizations
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"
Query Parameters
Only return the jobs belonging to this broadcast. Omit to return the jobs of the whole queue.
1"00000000-0000-0000-0000-000000000000"
Only return the job with this queue job id (the id field of a queue job). An id that matches nothing returns an empty array.
1"00000000-0000-0000-0000-000000000000"
Response
The matching queue jobs
The original send payload the job was queued with. Its exact keys depend on the message type — media, poll and broadcast jobs carry additional fields.
Show child attributes
Show child attributes
Unique id of the queue job (a UUID). Use it as the queue_id filter on GET /queue/jobs or to purge the job via DELETE /queue/purge.
"00000000-0000-0000-0000-000000000000"
WhatsApp message id produced when the job completed. Absent or null while the job has not been submitted yet.
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
Queue state of the job: one of waiting, active, completed, failed, delayed. Absent when the queue does not report a state for the job.
"completed"
Present only when the job has a failure stack trace — a single-element array containing the first line of the most recent stack trace.
["Error: Evaluation failed: t"]
Number of processing attempts started for the job
1
Number of processing attempts completed for the job
1
When the job was added to the queue, as an epoch timestamp in milliseconds
1737373507280
When the job finished (completed or failed), as an epoch timestamp in milliseconds. Absent while the job is still queued or processing.
1737373510691
When processing of the job started, as an epoch timestamp in milliseconds. Absent while the job is still waiting.
1737373507380
Was this page helpful?