TypeScript
import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
});
async function main() {
const response = await client.messages.deleteBroadcast({
broadcast_id: '00000000-0000-0000-0000-000000000000',
});
console.log(response);
}
main();curl -X DELETE 'https://api.periskope.app/v1/message/broadcast/00000000-0000-0000-0000-000000000000' \
-H 'Authorization: Bearer YOUR_API_KEY'{
"broadcast_id": "00000000-0000-0000-0000-000000000000",
"status": "stopped"
}{
"code": "UNAUTHORIZED_ERROR",
"message": "Invalid bearer auth token",
"status": 401
}{
"code": "NOT_FOUND_ERROR",
"message": "No broadcast matches broadcast_id",
"status": 404
}{
"code": "CONFLICT_ERROR",
"message": "The broadcast already finished or was already stopped — nothing left to cancel",
"status": 409
}{
"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
Delete a Broadcast
Cancels a scheduled broadcast or stops one in progress. Unsent messages are cancelled and their credits refunded.
TypeScript
import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
});
async function main() {
const response = await client.messages.deleteBroadcast({
broadcast_id: '00000000-0000-0000-0000-000000000000',
});
console.log(response);
}
main();curl -X DELETE 'https://api.periskope.app/v1/message/broadcast/00000000-0000-0000-0000-000000000000' \
-H 'Authorization: Bearer YOUR_API_KEY'{
"broadcast_id": "00000000-0000-0000-0000-000000000000",
"status": "stopped"
}{
"code": "UNAUTHORIZED_ERROR",
"message": "Invalid bearer auth token",
"status": 401
}{
"code": "NOT_FOUND_ERROR",
"message": "No broadcast matches broadcast_id",
"status": 404
}{
"code": "CONFLICT_ERROR",
"message": "The broadcast already finished or was already stopped — nothing left to cancel",
"status": 409
}{
"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
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.
Path Parameters
Id of the broadcast, returned when it was created via POST /message/broadcast
Minimum string length:
1Example:
"00000000-0000-0000-0000-000000000000"
Response
The outcome of the cancellation
Id of the affected broadcast
Example:
"00000000-0000-0000-0000-000000000000"
Outcome: 'deleted' when the broadcast had not started (removed entirely, credits never debited); 'stopped' when it was in progress (remaining messages cancelled and their credits refunded)
Available options:
deleted, stopped Example:
"stopped"
Was this page helpful?