Create a standing recurring schedule for one account.
curl --request POST \
--url https://{origin}/v1/schedules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"account_username": "<string>",
"cadence": {
"kind": "off"
},
"device_udid": "<string>",
"active_start_hour": 9,
"active_end_hour": 21,
"timezone": "UTC",
"per_day_cap": 6,
"horizon_hours": 48,
"default_disposition": "draft"
}
'import requests
url = "https://{origin}/v1/schedules"
payload = {
"name": "<string>",
"account_username": "<string>",
"cadence": { "kind": "off" },
"device_udid": "<string>",
"active_start_hour": 9,
"active_end_hour": 21,
"timezone": "UTC",
"per_day_cap": 6,
"horizon_hours": 48,
"default_disposition": "draft"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
account_username: '<string>',
cadence: {kind: 'off'},
device_udid: '<string>',
active_start_hour: 9,
active_end_hour: 21,
timezone: 'UTC',
per_day_cap: 6,
horizon_hours: 48,
default_disposition: 'draft'
})
};
fetch('https://{origin}/v1/schedules', 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://{origin}/v1/schedules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'account_username' => '<string>',
'cadence' => [
'kind' => 'off'
],
'device_udid' => '<string>',
'active_start_hour' => 9,
'active_end_hour' => 21,
'timezone' => 'UTC',
'per_day_cap' => 6,
'horizon_hours' => 48,
'default_disposition' => 'draft'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{origin}/v1/schedules"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"account_username\": \"<string>\",\n \"cadence\": {\n \"kind\": \"off\"\n },\n \"device_udid\": \"<string>\",\n \"active_start_hour\": 9,\n \"active_end_hour\": 21,\n \"timezone\": \"UTC\",\n \"per_day_cap\": 6,\n \"horizon_hours\": 48,\n \"default_disposition\": \"draft\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.post("https://{origin}/v1/schedules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"account_username\": \"<string>\",\n \"cadence\": {\n \"kind\": \"off\"\n },\n \"device_udid\": \"<string>\",\n \"active_start_hour\": 9,\n \"active_end_hour\": 21,\n \"timezone\": \"UTC\",\n \"per_day_cap\": 6,\n \"horizon_hours\": 48,\n \"default_disposition\": \"draft\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{origin}/v1/schedules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"account_username\": \"<string>\",\n \"cadence\": {\n \"kind\": \"off\"\n },\n \"device_udid\": \"<string>\",\n \"active_start_hour\": 9,\n \"active_end_hour\": 21,\n \"timezone\": \"UTC\",\n \"per_day_cap\": 6,\n \"horizon_hours\": 48,\n \"default_disposition\": \"draft\"\n}"
response = http.request(request)
puts response.read_body{
"schema": "1.0",
"schedule": {
"schedule_id": "<string>",
"name": "<string>",
"account_username": "<string>",
"cadence": {
"kind": "off"
},
"status": "active",
"device_udid": "<string>",
"active_start_hour": 123,
"active_end_hour": 123,
"timezone": "<string>",
"content_source": "<unknown>",
"default_disposition": "draft",
"per_day_cap": 123,
"horizon_hours": 123,
"last_materialized_through": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"schema": "1.0",
"error": {
"code": "<string>",
"message": "<string>",
"data": "<unknown>"
}
}{
"schema": "1.0",
"error": {
"code": "<string>",
"message": "<string>",
"data": "<unknown>"
}
}{
"schema": "1.0",
"error": {
"code": "<string>",
"message": "<string>",
"data": "<unknown>"
}
}{
"schema": "1.0",
"error": {
"code": "<string>",
"message": "<string>",
"data": "<unknown>"
}
}{
"schema": "1.0",
"error": {
"code": "<string>",
"message": "<string>",
"data": "<unknown>"
}
}{
"schema": "1.0",
"error": {
"code": "<string>",
"message": "<string>",
"data": "<unknown>"
}
}Create a standing recurring schedule for one account.
Creates a standing cadence over the account’s existing content. The */5 materializer turns it into queued runs (video-only) spread across the active window; the operator’s own runner drains them. Requires the schedules:write scope. account_username/device_udid must belong to the org; the timezone must be a valid IANA name; the active window must be start < end.
POST
/
v1
/
schedules
Create a standing recurring schedule for one account.
curl --request POST \
--url https://{origin}/v1/schedules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"account_username": "<string>",
"cadence": {
"kind": "off"
},
"device_udid": "<string>",
"active_start_hour": 9,
"active_end_hour": 21,
"timezone": "UTC",
"per_day_cap": 6,
"horizon_hours": 48,
"default_disposition": "draft"
}
'import requests
url = "https://{origin}/v1/schedules"
payload = {
"name": "<string>",
"account_username": "<string>",
"cadence": { "kind": "off" },
"device_udid": "<string>",
"active_start_hour": 9,
"active_end_hour": 21,
"timezone": "UTC",
"per_day_cap": 6,
"horizon_hours": 48,
"default_disposition": "draft"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
account_username: '<string>',
cadence: {kind: 'off'},
device_udid: '<string>',
active_start_hour: 9,
active_end_hour: 21,
timezone: 'UTC',
per_day_cap: 6,
horizon_hours: 48,
default_disposition: 'draft'
})
};
fetch('https://{origin}/v1/schedules', 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://{origin}/v1/schedules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'account_username' => '<string>',
'cadence' => [
'kind' => 'off'
],
'device_udid' => '<string>',
'active_start_hour' => 9,
'active_end_hour' => 21,
'timezone' => 'UTC',
'per_day_cap' => 6,
'horizon_hours' => 48,
'default_disposition' => 'draft'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{origin}/v1/schedules"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"account_username\": \"<string>\",\n \"cadence\": {\n \"kind\": \"off\"\n },\n \"device_udid\": \"<string>\",\n \"active_start_hour\": 9,\n \"active_end_hour\": 21,\n \"timezone\": \"UTC\",\n \"per_day_cap\": 6,\n \"horizon_hours\": 48,\n \"default_disposition\": \"draft\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.post("https://{origin}/v1/schedules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"account_username\": \"<string>\",\n \"cadence\": {\n \"kind\": \"off\"\n },\n \"device_udid\": \"<string>\",\n \"active_start_hour\": 9,\n \"active_end_hour\": 21,\n \"timezone\": \"UTC\",\n \"per_day_cap\": 6,\n \"horizon_hours\": 48,\n \"default_disposition\": \"draft\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{origin}/v1/schedules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"account_username\": \"<string>\",\n \"cadence\": {\n \"kind\": \"off\"\n },\n \"device_udid\": \"<string>\",\n \"active_start_hour\": 9,\n \"active_end_hour\": 21,\n \"timezone\": \"UTC\",\n \"per_day_cap\": 6,\n \"horizon_hours\": 48,\n \"default_disposition\": \"draft\"\n}"
response = http.request(request)
puts response.read_body{
"schema": "1.0",
"schedule": {
"schedule_id": "<string>",
"name": "<string>",
"account_username": "<string>",
"cadence": {
"kind": "off"
},
"status": "active",
"device_udid": "<string>",
"active_start_hour": 123,
"active_end_hour": 123,
"timezone": "<string>",
"content_source": "<unknown>",
"default_disposition": "draft",
"per_day_cap": 123,
"horizon_hours": 123,
"last_materialized_through": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"schema": "1.0",
"error": {
"code": "<string>",
"message": "<string>",
"data": "<unknown>"
}
}{
"schema": "1.0",
"error": {
"code": "<string>",
"message": "<string>",
"data": "<unknown>"
}
}{
"schema": "1.0",
"error": {
"code": "<string>",
"message": "<string>",
"data": "<unknown>"
}
}{
"schema": "1.0",
"error": {
"code": "<string>",
"message": "<string>",
"data": "<unknown>"
}
}{
"schema": "1.0",
"error": {
"code": "<string>",
"message": "<string>",
"data": "<unknown>"
}
}{
"schema": "1.0",
"error": {
"code": "<string>",
"message": "<string>",
"data": "<unknown>"
}
}Authorizations
The access_token from the exchange endpoint.
Body
application/json
Required string length:
1 - 120Minimum string length:
1Recurrence for a standing schedule. Off, or N posts/day across the active window.
- Option 1
- Option 2
Show child attributes
Show child attributes
Required range:
0 <= x <= 23Required range:
1 <= x <= 24Required range:
1 <= x <= 12Required range:
1 <= x <= 72Available options:
draft, post_now ⌘I