Api Deliveries Save
curl --request POST \
--url http://localhost:8080/api/deliveries \
--header 'Content-Type: application/json' \
--data '
{
"cadence": {
"day": 1,
"kind": "weekly",
"time": "08:00",
"weekday": 0
},
"channel": {
"kind": "email",
"recipients": []
},
"dashboard": "",
"enabled": true,
"environment": "prod",
"id": "<string>",
"name": ""
}
'import requests
url = "http://localhost:8080/api/deliveries"
payload = {
"cadence": {
"day": 1,
"kind": "weekly",
"time": "08:00",
"weekday": 0
},
"channel": {
"kind": "email",
"recipients": []
},
"dashboard": "",
"enabled": True,
"environment": "prod",
"id": "<string>",
"name": ""
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
cadence: {day: 1, kind: 'weekly', time: '08:00', weekday: 0},
channel: {kind: 'email', recipients: []},
dashboard: '',
enabled: true,
environment: 'prod',
id: '<string>',
name: ''
})
};
fetch('http://localhost:8080/api/deliveries', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/api/deliveries",
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([
'cadence' => [
'day' => 1,
'kind' => 'weekly',
'time' => '08:00',
'weekday' => 0
],
'channel' => [
'kind' => 'email',
'recipients' => [
]
],
'dashboard' => '',
'enabled' => true,
'environment' => 'prod',
'id' => '<string>',
'name' => ''
]),
CURLOPT_HTTPHEADER => [
"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 := "http://localhost:8080/api/deliveries"
payload := strings.NewReader("{\n \"cadence\": {\n \"day\": 1,\n \"kind\": \"weekly\",\n \"time\": \"08:00\",\n \"weekday\": 0\n },\n \"channel\": {\n \"kind\": \"email\",\n \"recipients\": []\n },\n \"dashboard\": \"\",\n \"enabled\": true,\n \"environment\": \"prod\",\n \"id\": \"<string>\",\n \"name\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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("http://localhost:8080/api/deliveries")
.header("Content-Type", "application/json")
.body("{\n \"cadence\": {\n \"day\": 1,\n \"kind\": \"weekly\",\n \"time\": \"08:00\",\n \"weekday\": 0\n },\n \"channel\": {\n \"kind\": \"email\",\n \"recipients\": []\n },\n \"dashboard\": \"\",\n \"enabled\": true,\n \"environment\": \"prod\",\n \"id\": \"<string>\",\n \"name\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/api/deliveries")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"cadence\": {\n \"day\": 1,\n \"kind\": \"weekly\",\n \"time\": \"08:00\",\n \"weekday\": 0\n },\n \"channel\": {\n \"kind\": \"email\",\n \"recipients\": []\n },\n \"dashboard\": \"\",\n \"enabled\": true,\n \"environment\": \"prod\",\n \"id\": \"<string>\",\n \"name\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Control Plane
Api Deliveries Save
POST
/
api
/
deliveries
Api Deliveries Save
curl --request POST \
--url http://localhost:8080/api/deliveries \
--header 'Content-Type: application/json' \
--data '
{
"cadence": {
"day": 1,
"kind": "weekly",
"time": "08:00",
"weekday": 0
},
"channel": {
"kind": "email",
"recipients": []
},
"dashboard": "",
"enabled": true,
"environment": "prod",
"id": "<string>",
"name": ""
}
'import requests
url = "http://localhost:8080/api/deliveries"
payload = {
"cadence": {
"day": 1,
"kind": "weekly",
"time": "08:00",
"weekday": 0
},
"channel": {
"kind": "email",
"recipients": []
},
"dashboard": "",
"enabled": True,
"environment": "prod",
"id": "<string>",
"name": ""
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
cadence: {day: 1, kind: 'weekly', time: '08:00', weekday: 0},
channel: {kind: 'email', recipients: []},
dashboard: '',
enabled: true,
environment: 'prod',
id: '<string>',
name: ''
})
};
fetch('http://localhost:8080/api/deliveries', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/api/deliveries",
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([
'cadence' => [
'day' => 1,
'kind' => 'weekly',
'time' => '08:00',
'weekday' => 0
],
'channel' => [
'kind' => 'email',
'recipients' => [
]
],
'dashboard' => '',
'enabled' => true,
'environment' => 'prod',
'id' => '<string>',
'name' => ''
]),
CURLOPT_HTTPHEADER => [
"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 := "http://localhost:8080/api/deliveries"
payload := strings.NewReader("{\n \"cadence\": {\n \"day\": 1,\n \"kind\": \"weekly\",\n \"time\": \"08:00\",\n \"weekday\": 0\n },\n \"channel\": {\n \"kind\": \"email\",\n \"recipients\": []\n },\n \"dashboard\": \"\",\n \"enabled\": true,\n \"environment\": \"prod\",\n \"id\": \"<string>\",\n \"name\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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("http://localhost:8080/api/deliveries")
.header("Content-Type", "application/json")
.body("{\n \"cadence\": {\n \"day\": 1,\n \"kind\": \"weekly\",\n \"time\": \"08:00\",\n \"weekday\": 0\n },\n \"channel\": {\n \"kind\": \"email\",\n \"recipients\": []\n },\n \"dashboard\": \"\",\n \"enabled\": true,\n \"environment\": \"prod\",\n \"id\": \"<string>\",\n \"name\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/api/deliveries")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"cadence\": {\n \"day\": 1,\n \"kind\": \"weekly\",\n \"time\": \"08:00\",\n \"weekday\": 0\n },\n \"channel\": {\n \"kind\": \"email\",\n \"recipients\": []\n },\n \"dashboard\": \"\",\n \"enabled\": true,\n \"environment\": \"prod\",\n \"id\": \"<string>\",\n \"name\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Body
application/json
Create-or-update payload for a delivery (POST /api/deliveries). id present means
update; absent means create. dashboard is the workspace path of the subscribed
dashboard. Structural validation only — cadence/channel business rules (weekday range,
Slack-not-configured) are enforced by deliveries_model.normalize_delivery, and dashboard
membership in the active env is checked by the route, so the 400 message stays in one place.
Response
Successful Response
⌘I