Skip to content

Cancel Broadcast ​

PUThttps://api.repliz.com/public/broadcast/{broadcastId}/cancel

Stop a broadcast that is still sending. The chats that haven't got it yet are skipped with reason canceled, and the messages already sent stay in the chats.

Endpoint Details ​

  • Authentication: Basic Auth (Authorization: Basic Base64(AccessKey:SecretKey)) or Bearer token from Login with Repliz
  • Scope (Bearer only): broadcast:write
  • Access Tier: Premium+

Parameters ​

ParameterTypeRequiredDescription
broadcastIdstringYesID of the broadcast, the _id from Get Broadcast or the broadcastId from Create Broadcast.

Example Request ​

bash
curl -X PUT "https://api.repliz.com/public/broadcast/6927e1c2e4b0a1f2c3d4e5f6/cancel" \
  -H "Authorization: Basic $(echo -n 'YOUR_ACCESS_KEY:YOUR_SECRET_KEY' | base64)" \
  -H "Content-Type: application/json" \
  -d '{}'
javascript
import axios from 'axios';

const response = await axios.put(
  'https://api.repliz.com/public/broadcast/6927e1c2e4b0a1f2c3d4e5f6/cancel',
  {},
  {
    auth: {
      username: 'YOUR_ACCESS_KEY',
      password: 'YOUR_SECRET_KEY',
    },
  },
);

console.log(response.data);
javascript
const credentials = btoa('YOUR_ACCESS_KEY:YOUR_SECRET_KEY');

const response = await fetch('https://api.repliz.com/public/broadcast/6927e1c2e4b0a1f2c3d4e5f6/cancel', {
  method: 'PUT',
  headers: {
    Authorization: `Basic ${credentials}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({}),
});

console.log(response.status);

Response ​

json
// No content returned on success
json
{
  "code": 400,
  "message": "broadcast is not running"
}
json
{
  "code": 404,
  "message": "broadcast not found"
}
json
{
  "code": 401,
  "message": "unauthorized"
}