Node.js
import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
});
const result = await client.message.cancelBroadcast({
broadcast_id: 'b25192d5-2370-4a69-b844-aae5e2bfae92',
});
// result.status is 'deleted' (was scheduled) or 'stopped' (was in-progress)
console.log(result.broadcast_id, result.status);curl -X DELETE \
https://api.periskope.app/v1/message/broadcast/b25192d5-2370-4a69-b844-aae5e2bfae92 \
-H 'Authorization: Bearer <token>'
# Response (scheduled broadcast):
# { "broadcast_id": "b25192d5-...", "status": "deleted" }
# Response (in-progress broadcast):
# { "broadcast_id": "b25192d5-...", "status": "stopped" }{
"broadcast_id": "b25192d5-2370-4a69-b844-aae5e2bfae92",
"status": "deleted"
}{
"status": "CONFLICT_ERROR",
"message": "Broadcast is already stopped",
"code": 409
}Message APIs
Delete a Broadcast
This endpoint is used to delete or stop a broadcast.
- If the broadcast hasn’t started yet, it will be deleted and the credits for this broadcast won’t be charged.
- If it’s currently sending, it will stop immediately. Any messages that haven’t been sent yet will be cancelled, and the credits for them will be refunded.
Node.js
import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
});
const result = await client.message.cancelBroadcast({
broadcast_id: 'b25192d5-2370-4a69-b844-aae5e2bfae92',
});
// result.status is 'deleted' (was scheduled) or 'stopped' (was in-progress)
console.log(result.broadcast_id, result.status);curl -X DELETE \
https://api.periskope.app/v1/message/broadcast/b25192d5-2370-4a69-b844-aae5e2bfae92 \
-H 'Authorization: Bearer <token>'
# Response (scheduled broadcast):
# { "broadcast_id": "b25192d5-...", "status": "deleted" }
# Response (in-progress broadcast):
# { "broadcast_id": "b25192d5-...", "status": "stopped" }{
"broadcast_id": "b25192d5-2370-4a69-b844-aae5e2bfae92",
"status": "deleted"
}{
"status": "CONFLICT_ERROR",
"message": "Broadcast is already stopped",
"code": 409
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The broadcast_id returned when the broadcast was created. You have to provide the broadcast_id here in order to delete or stop it.
Example:
"b25192d5-2370-4a69-b844-aae5e2bfae92"
Was this page helpful?