curl --request POST \
--url https://origami.chat/api/v2/scheduled-agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"prompt": "<string>",
"cron": "<string>",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"enabled": true,
"description": "<string>",
"model": "<string>",
"budgetCredits": 1073741824,
"slug": "<string>"
}
'import requests
url = "https://origami.chat/api/v2/scheduled-agents"
payload = {
"name": "<string>",
"prompt": "<string>",
"cron": "<string>",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"enabled": True,
"description": "<string>",
"model": "<string>",
"budgetCredits": 1073741824,
"slug": "<string>"
}
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>',
prompt: '<string>',
cron: '<string>',
workspaceId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
enabled: true,
description: '<string>',
model: '<string>',
budgetCredits: 1073741824,
slug: '<string>'
})
};
fetch('https://origami.chat/api/v2/scheduled-agents', 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://origami.chat/api/v2/scheduled-agents",
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>',
'prompt' => '<string>',
'cron' => '<string>',
'workspaceId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'enabled' => true,
'description' => '<string>',
'model' => '<string>',
'budgetCredits' => 1073741824,
'slug' => '<string>'
]),
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://origami.chat/api/v2/scheduled-agents"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"cron\": \"<string>\",\n \"workspaceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"enabled\": true,\n \"description\": \"<string>\",\n \"model\": \"<string>\",\n \"budgetCredits\": 1073741824,\n \"slug\": \"<string>\"\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://origami.chat/api/v2/scheduled-agents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"cron\": \"<string>\",\n \"workspaceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"enabled\": true,\n \"description\": \"<string>\",\n \"model\": \"<string>\",\n \"budgetCredits\": 1073741824,\n \"slug\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://origami.chat/api/v2/scheduled-agents")
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 \"prompt\": \"<string>\",\n \"cron\": \"<string>\",\n \"workspaceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"enabled\": true,\n \"description\": \"<string>\",\n \"model\": \"<string>\",\n \"budgetCredits\": 1073741824,\n \"slug\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"object": "scheduled_agent",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"name": "<string>",
"description": "<string>",
"prompt": "<string>",
"cron": "<string>",
"model": "<string>",
"enabled": true,
"budgetCredits": 2,
"planBlocked": true,
"nextRunAt": "2023-11-07T05:31:56Z",
"lastRunAt": "2023-11-07T05:31:56Z",
"url": "<string>",
"handoff": {}
}Create a scheduled agent (disabled by default)
Requires name/prompt/cron. workspaceId is optional/nullable (a deprecated container anchor), not required. Invalid cron → INVALID_CRON / CRON_TOO_FREQUENT.
curl --request POST \
--url https://origami.chat/api/v2/scheduled-agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"prompt": "<string>",
"cron": "<string>",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"enabled": true,
"description": "<string>",
"model": "<string>",
"budgetCredits": 1073741824,
"slug": "<string>"
}
'import requests
url = "https://origami.chat/api/v2/scheduled-agents"
payload = {
"name": "<string>",
"prompt": "<string>",
"cron": "<string>",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"enabled": True,
"description": "<string>",
"model": "<string>",
"budgetCredits": 1073741824,
"slug": "<string>"
}
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>',
prompt: '<string>',
cron: '<string>',
workspaceId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
enabled: true,
description: '<string>',
model: '<string>',
budgetCredits: 1073741824,
slug: '<string>'
})
};
fetch('https://origami.chat/api/v2/scheduled-agents', 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://origami.chat/api/v2/scheduled-agents",
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>',
'prompt' => '<string>',
'cron' => '<string>',
'workspaceId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'enabled' => true,
'description' => '<string>',
'model' => '<string>',
'budgetCredits' => 1073741824,
'slug' => '<string>'
]),
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://origami.chat/api/v2/scheduled-agents"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"cron\": \"<string>\",\n \"workspaceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"enabled\": true,\n \"description\": \"<string>\",\n \"model\": \"<string>\",\n \"budgetCredits\": 1073741824,\n \"slug\": \"<string>\"\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://origami.chat/api/v2/scheduled-agents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"cron\": \"<string>\",\n \"workspaceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"enabled\": true,\n \"description\": \"<string>\",\n \"model\": \"<string>\",\n \"budgetCredits\": 1073741824,\n \"slug\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://origami.chat/api/v2/scheduled-agents")
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 \"prompt\": \"<string>\",\n \"cron\": \"<string>\",\n \"workspaceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"enabled\": true,\n \"description\": \"<string>\",\n \"model\": \"<string>\",\n \"budgetCredits\": 1073741824,\n \"slug\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"object": "scheduled_agent",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"slug": "<string>",
"name": "<string>",
"description": "<string>",
"prompt": "<string>",
"cron": "<string>",
"model": "<string>",
"enabled": true,
"budgetCredits": 2,
"planBlocked": true,
"nextRunAt": "2023-11-07T05:31:56Z",
"lastRunAt": "2023-11-07T05:31:56Z",
"url": "<string>",
"handoff": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Transport-level replay protection: any v2 POST may send it
(1-255 printable ASCII characters; UUIDs recommended). The first
response for a key is recorded and replayed verbatim for retries
with the same key + method/path/body for 24 hours; replayed
responses carry the Idempotency-Replay: true response header.
Reusing a key with a different request, or retrying while the
original is still in flight, returns 409 IDEMPOTENCY_ERROR.
5xx responses are never recorded (the retry re-executes).
1 - 255^[\x21-\x7e]{1,255}$Body
120A cron expression.
Deprecated container anchor; optional.
Hard per-run credit cap (whole credits); each run stops spending once it hits it. Omit or null for no cap.
1 <= x <= 21474836471 - 60Response
The created scheduled agent.
"scheduled_agent"Deprecated container anchor - the legacy workspace, else the origin chat session whose links seed each run; null for container-less agents.
Hard per-run credit budget (whole credits). Each run of this agent is capped at this many credits and stops spending once it hits it. Null means no cap. Size it to comfortably cover the leads a run is expected to fetch (cost-per-lead × expected leads, plus margin).
x >= 1True when the org cannot currently run scheduled tasks (gated at dispatch).
Present when planBlocked; points the caller at the upgrade flow.