curl --request PUT \
--url https://api.kit.com/v4/broadcasts/{id} \
--header 'Content-Type: application/json' \
--header 'X-Kit-Api-Key: <api-key>' \
--data '
{
"email_template_id": 2,
"email_address": null,
"content": "<p>Let me introduce myself</p>",
"description": "Intro email",
"public": true,
"published_at": "2023-02-17T11:43:55+00:00",
"send_at": "2023-02-17T11:43:55+00:00",
"thumbnail_alt": null,
"thumbnail_url": null,
"preview_text": "Pleased to meet you!",
"subject": "Hello!",
"subscriber_filter": [
{
"all": [
{
"type": "segment",
"ids": [
54
]
}
],
"any": null,
"none": null
}
]
}
'require 'uri'
require 'net/http'
url = URI("https://api.kit.com/v4/broadcasts/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Kit-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email_template_id\": 2,\n \"email_address\": null,\n \"content\": \"<p>Let me introduce myself</p>\",\n \"description\": \"Intro email\",\n \"public\": true,\n \"published_at\": \"2023-02-17T11:43:55+00:00\",\n \"send_at\": \"2023-02-17T11:43:55+00:00\",\n \"thumbnail_alt\": null,\n \"thumbnail_url\": null,\n \"preview_text\": \"Pleased to meet you!\",\n \"subject\": \"Hello!\",\n \"subscriber_filter\": [\n {\n \"all\": [\n {\n \"type\": \"segment\",\n \"ids\": [\n 54\n ]\n }\n ],\n \"any\": null,\n \"none\": null\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyconst options = {
method: 'PUT',
headers: {'X-Kit-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email_template_id: 2,
email_address: null,
content: '<p>Let me introduce myself</p>',
description: 'Intro email',
public: true,
published_at: '2023-02-17T11:43:55+00:00',
send_at: '2023-02-17T11:43:55+00:00',
thumbnail_alt: null,
thumbnail_url: null,
preview_text: 'Pleased to meet you!',
subject: 'Hello!',
subscriber_filter: [{all: [{type: 'segment', ids: [54]}], any: null, none: null}]
})
};
fetch('https://api.kit.com/v4/broadcasts/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.kit.com/v4/broadcasts/{id}"
payload := strings.NewReader("{\n \"email_template_id\": 2,\n \"email_address\": null,\n \"content\": \"<p>Let me introduce myself</p>\",\n \"description\": \"Intro email\",\n \"public\": true,\n \"published_at\": \"2023-02-17T11:43:55+00:00\",\n \"send_at\": \"2023-02-17T11:43:55+00:00\",\n \"thumbnail_alt\": null,\n \"thumbnail_url\": null,\n \"preview_text\": \"Pleased to meet you!\",\n \"subject\": \"Hello!\",\n \"subscriber_filter\": [\n {\n \"all\": [\n {\n \"type\": \"segment\",\n \"ids\": [\n 54\n ]\n }\n ],\n \"any\": null,\n \"none\": null\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Kit-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.kit.com/v4/broadcasts/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'email_template_id' => 2,
'email_address' => null,
'content' => '<p>Let me introduce myself</p>',
'description' => 'Intro email',
'public' => true,
'published_at' => '2023-02-17T11:43:55+00:00',
'send_at' => '2023-02-17T11:43:55+00:00',
'thumbnail_alt' => null,
'thumbnail_url' => null,
'preview_text' => 'Pleased to meet you!',
'subject' => 'Hello!',
'subscriber_filter' => [
[
'all' => [
[
'type' => 'segment',
'ids' => [
54
]
]
],
'any' => null,
'none' => null
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Kit-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "https://api.kit.com/v4/broadcasts/{id}"
payload = {
"email_template_id": 2,
"email_address": None,
"content": "<p>Let me introduce myself</p>",
"description": "Intro email",
"public": True,
"published_at": "2023-02-17T11:43:55+00:00",
"send_at": "2023-02-17T11:43:55+00:00",
"thumbnail_alt": None,
"thumbnail_url": None,
"preview_text": "Pleased to meet you!",
"subject": "Hello!",
"subscriber_filter": [
{
"all": [
{
"type": "segment",
"ids": [54]
}
],
"any": None,
"none": None
}
]
}
headers = {
"X-Kit-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"broadcast": {
"id": 92,
"publication_id": 83,
"created_at": "2023-02-17T11:43:55Z",
"subject": "Hello!",
"preview_text": "Pleased to meet you!",
"description": "Intro email",
"content": "<p>Let me introduce myself</p>",
"public": true,
"published_at": "2023-02-17T11:43:55Z",
"send_at": "2023-02-17T11:43:55Z",
"thumbnail_alt": null,
"thumbnail_url": null,
"public_url": "https://kit-greetings.kit.com/posts/hello",
"email_address": "greetings@kit.dev",
"email_template": {
"id": 2,
"name": "Classic"
},
"subscriber_filter": [
{
"all": [
{
"type": "segment",
"ids": [
54
]
}
]
}
],
"status": "sending"
}
}{
"errors": [
"The access token is invalid"
]
}{
"errors": [
"You do not have sufficient permissions to access this resource. Please contact support."
]
}{
"errors": [
"Not Found"
]
}{
"errors": [
"Email template not found",
"Only a single filter group is supported. Use one of `all`, `any`, or `none`."
]
}Update a broadcast
Update an existing broadcast. Continue to draft or schedule to send a broadcast to all or a subset of your subscribers.
To save a draft, set public to false.
To schedule the broadcast for sending, set public to true and provide send_at. Scheduled broadcasts should contain a subject and your content, at a minimum.
We currently support targeting your subscribers based on segment or tag ids.
curl --request PUT \
--url https://api.kit.com/v4/broadcasts/{id} \
--header 'Content-Type: application/json' \
--header 'X-Kit-Api-Key: <api-key>' \
--data '
{
"email_template_id": 2,
"email_address": null,
"content": "<p>Let me introduce myself</p>",
"description": "Intro email",
"public": true,
"published_at": "2023-02-17T11:43:55+00:00",
"send_at": "2023-02-17T11:43:55+00:00",
"thumbnail_alt": null,
"thumbnail_url": null,
"preview_text": "Pleased to meet you!",
"subject": "Hello!",
"subscriber_filter": [
{
"all": [
{
"type": "segment",
"ids": [
54
]
}
],
"any": null,
"none": null
}
]
}
'require 'uri'
require 'net/http'
url = URI("https://api.kit.com/v4/broadcasts/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Kit-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email_template_id\": 2,\n \"email_address\": null,\n \"content\": \"<p>Let me introduce myself</p>\",\n \"description\": \"Intro email\",\n \"public\": true,\n \"published_at\": \"2023-02-17T11:43:55+00:00\",\n \"send_at\": \"2023-02-17T11:43:55+00:00\",\n \"thumbnail_alt\": null,\n \"thumbnail_url\": null,\n \"preview_text\": \"Pleased to meet you!\",\n \"subject\": \"Hello!\",\n \"subscriber_filter\": [\n {\n \"all\": [\n {\n \"type\": \"segment\",\n \"ids\": [\n 54\n ]\n }\n ],\n \"any\": null,\n \"none\": null\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyconst options = {
method: 'PUT',
headers: {'X-Kit-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email_template_id: 2,
email_address: null,
content: '<p>Let me introduce myself</p>',
description: 'Intro email',
public: true,
published_at: '2023-02-17T11:43:55+00:00',
send_at: '2023-02-17T11:43:55+00:00',
thumbnail_alt: null,
thumbnail_url: null,
preview_text: 'Pleased to meet you!',
subject: 'Hello!',
subscriber_filter: [{all: [{type: 'segment', ids: [54]}], any: null, none: null}]
})
};
fetch('https://api.kit.com/v4/broadcasts/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.kit.com/v4/broadcasts/{id}"
payload := strings.NewReader("{\n \"email_template_id\": 2,\n \"email_address\": null,\n \"content\": \"<p>Let me introduce myself</p>\",\n \"description\": \"Intro email\",\n \"public\": true,\n \"published_at\": \"2023-02-17T11:43:55+00:00\",\n \"send_at\": \"2023-02-17T11:43:55+00:00\",\n \"thumbnail_alt\": null,\n \"thumbnail_url\": null,\n \"preview_text\": \"Pleased to meet you!\",\n \"subject\": \"Hello!\",\n \"subscriber_filter\": [\n {\n \"all\": [\n {\n \"type\": \"segment\",\n \"ids\": [\n 54\n ]\n }\n ],\n \"any\": null,\n \"none\": null\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Kit-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.kit.com/v4/broadcasts/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'email_template_id' => 2,
'email_address' => null,
'content' => '<p>Let me introduce myself</p>',
'description' => 'Intro email',
'public' => true,
'published_at' => '2023-02-17T11:43:55+00:00',
'send_at' => '2023-02-17T11:43:55+00:00',
'thumbnail_alt' => null,
'thumbnail_url' => null,
'preview_text' => 'Pleased to meet you!',
'subject' => 'Hello!',
'subscriber_filter' => [
[
'all' => [
[
'type' => 'segment',
'ids' => [
54
]
]
],
'any' => null,
'none' => null
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Kit-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "https://api.kit.com/v4/broadcasts/{id}"
payload = {
"email_template_id": 2,
"email_address": None,
"content": "<p>Let me introduce myself</p>",
"description": "Intro email",
"public": True,
"published_at": "2023-02-17T11:43:55+00:00",
"send_at": "2023-02-17T11:43:55+00:00",
"thumbnail_alt": None,
"thumbnail_url": None,
"preview_text": "Pleased to meet you!",
"subject": "Hello!",
"subscriber_filter": [
{
"all": [
{
"type": "segment",
"ids": [54]
}
],
"any": None,
"none": None
}
]
}
headers = {
"X-Kit-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"broadcast": {
"id": 92,
"publication_id": 83,
"created_at": "2023-02-17T11:43:55Z",
"subject": "Hello!",
"preview_text": "Pleased to meet you!",
"description": "Intro email",
"content": "<p>Let me introduce myself</p>",
"public": true,
"published_at": "2023-02-17T11:43:55Z",
"send_at": "2023-02-17T11:43:55Z",
"thumbnail_alt": null,
"thumbnail_url": null,
"public_url": "https://kit-greetings.kit.com/posts/hello",
"email_address": "greetings@kit.dev",
"email_template": {
"id": 2,
"name": "Classic"
},
"subscriber_filter": [
{
"all": [
{
"type": "segment",
"ids": [
54
]
}
]
}
],
"status": "sending"
}
}{
"errors": [
"The access token is invalid"
]
}{
"errors": [
"You do not have sufficient permissions to access this resource. Please contact support."
]
}{
"errors": [
"Not Found"
]
}{
"errors": [
"Email template not found",
"Only a single filter group is supported. Use one of `all`, `any`, or `none`."
]
}Authorizations
Authenticate API requests via an API Key
Path Parameters
Body
Id of the email template to use. Uses the account's default template if not provided. 'Starting point' template is not supported.
The sending email address to use. Uses the account's sending email address if not provided.
The HTML content of the email.
true to publish this broadcast to the web. The broadcast will appear in a newsletter feed on your Creator Profile and Landing Pages.
The published timestamp to display in ISO8601 format. If no timezone is provided, UTC is assumed.
The scheduled send time for this broadcast in ISO8601 format. If no timezone is provided, UTC is assumed.
Filters your subscribers. At this time, we only support using only one filter group type via the API (e.g. all, any, or none but no combinations). If nothing is provided, will default to all of your subscribers.
Show child attributes
Show child attributes
Response
Updates the broadcast and returns its details
Show child attributes
Show child attributes
Was this page helpful?