TypeScript
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.messages.createMessageQueue({
queue_id: '00000000-0000-0000-0000-000000000000',
});
console.log(response);
}
main();curl -X POST 'https://api.periskope.app/v1/message/queues' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'x-phone: 919876543210' \
-H 'Content-Type: application/json' \
-d '{
"queue_id": "00000000-0000-0000-0000-000000000000"
}'[
{
"queue_id": "00000000-0000-0000-0000-000000000000",
"unique_id": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"message_id": "true_911111111111@c.us_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"chat_id": "911111111111@c.us",
"performed_by": "api",
"status": "delivered",
"status_description": "Delivered to recipient.",
"message": {
"body": "Hello World",
"type": "chat",
"quoted_message_id": null
},
"timeline": {
"queued_at": "2026-01-15T09:30:00.000Z",
"sent_at": "2026-01-15T09:30:02.000Z",
"failed_at": null,
"processing_started_at": null
},
"attempts": 1
}
]{
"code": "ERROR",
"message": "The phone is off or its server is unreachable",
"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
}Message APIs
List All Message Queues
Lists the jobs retained in the send queue of the phone. Pass broadcast_id to track a broadcast, or queue_id for a single job.
TypeScript
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.messages.createMessageQueue({
queue_id: '00000000-0000-0000-0000-000000000000',
});
console.log(response);
}
main();curl -X POST 'https://api.periskope.app/v1/message/queues' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'x-phone: 919876543210' \
-H 'Content-Type: application/json' \
-d '{
"queue_id": "00000000-0000-0000-0000-000000000000"
}'[
{
"queue_id": "00000000-0000-0000-0000-000000000000",
"unique_id": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"message_id": "true_911111111111@c.us_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"chat_id": "911111111111@c.us",
"performed_by": "api",
"status": "delivered",
"status_description": "Delivered to recipient.",
"message": {
"body": "Hello World",
"type": "chat",
"quoted_message_id": null
},
"timeline": {
"queued_at": "2026-01-15T09:30:00.000Z",
"sent_at": "2026-01-15T09:30:02.000Z",
"failed_at": null,
"processing_started_at": null
},
"attempts": 1
}
]{
"code": "ERROR",
"message": "The phone is off or its server is unreachable",
"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
}Authorizations
Headers
Body
application/json
Response
The matching queue jobs
Current state of the job: one of queued, scheduled, sending, sent, pending, delivered, read, played, failed. Queue states (queued, scheduled, sending, failed) come from the send queue; once the job completed, the state reflects the delivery acknowledgement (sent, delivered, read, played — or pending/failed).
Example:
"delivered"
Was this page helpful?