Skip to main content
POST
/
orgs
/
{org_id}
/
broadcasts
/
{broadcast_id}
/
cancel
Cancel a Broadcast
curl --request POST \
  --url https://api.useinvent.com/orgs/{org_id}/broadcasts/{broadcast_id}/cancel \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.useinvent.com/orgs/{org_id}/broadcasts/{broadcast_id}/cancel"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.text)
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.useinvent.com/orgs/{org_id}/broadcasts/{broadcast_id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.useinvent.com/orgs/{org_id}/broadcasts/{broadcast_id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.useinvent.com/orgs/{org_id}/broadcasts/{broadcast_id}/cancel"

req, _ := http.NewRequest("POST", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.useinvent.com/orgs/{org_id}/broadcasts/{broadcast_id}/cancel")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.useinvent.com/orgs/{org_id}/broadcasts/{broadcast_id}/cancel")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "name": "<string>",
  "show_in_inbox": true,
  "scheduled_at": "2023-11-07T05:31:56Z",
  "started_at": "2023-11-07T05:31:56Z",
  "completed_at": "2023-11-07T05:31:56Z",
  "contacts_count": 123,
  "recipients_count": 123,
  "skipped_count": 123,
  "sent_count": 123,
  "failed_count": 123,
  "bounced_count": 123,
  "delivered_count": 123,
  "opened_count": 123,
  "played_count": 123,
  "click_count": 123,
  "complained_count": 123,
  "unsubscribed_count": 123,
  "error_message": "<string>",
  "segments": [
    {
      "id": "<string>",
      "name": "<string>",
      "contacts_count": 123,
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z"
    }
  ],
  "fields": [
    {
      "id": "<string>",
      "broadcast_id": "<string>",
      "key": "<string>",
      "default_value": "<string>",
      "created_at": "2023-11-07T05:31:56Z"
    }
  ],
  "send_to_all": true,
  "templates": [
    {
      "id": "<string>",
      "broadcast_id": "<string>",
      "connection_id": "<string>",
      "recipients_count": 123,
      "config": {},
      "error": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z"
    }
  ],
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Bearer token authentication using your API key

Path Parameters

org_id
string
required

Org ID

broadcast_id
string
required

Broadcast ID

Response

200 - application/json

Schema for a broadcast

id
string
required
name
string
required
type
enum<string>
required

The mode of the broadcast: MARKETING (bulk to many people) or TRANSACTIONAL (single-recipient trigger across channels)

Available options:
MARKETING,
TRANSACTIONAL
status
enum<string>
required

The status of the broadcast

Available options:
DRAFT,
SCHEDULED,
SENDING,
SENT,
CANCELLED,
FAILED,
ACTIVE,
PAUSED
show_in_inbox
boolean
required
scheduled_at
string<date-time> | null
required
started_at
string<date-time> | null
required
completed_at
string<date-time> | null
required
contacts_count
number
required
recipients_count
number
required
skipped_count
number
required
sent_count
number
required
failed_count
number
required
bounced_count
number
required
delivered_count
number
required
opened_count
number
required
played_count
number
required
click_count
number
required
complained_count
number
required
unsubscribed_count
number
required
error_message
string | null
required
segments
object[]
required
fields
object[]
required
send_to_all
boolean
required
templates
object[]
required
created_at
string<date-time>
required
updated_at
string<date-time>
required