Skip to main content
POST
/
scheduled-agents
Create a scheduled agent (disabled by default)
curl --request POST \
  --url https://origami.chat/api/v2/scheduled-agents \
  --header 'Authorization: Bearer <token>'
{
  "object": "<string>",
  "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,
  "planBlocked": true,
  "nextRunAt": "2023-11-07T05:31:56Z",
  "lastRunAt": "2023-11-07T05:31:56Z",
  "url": "<string>",
  "handoff": {}
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Idempotency-Key
string

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).

Required string length: 1 - 255
Pattern: ^[\x21-\x7e]{1,255}$

Response

201 - application/json

The created scheduled agent.

object
string
required
Allowed value: "scheduled_agent"
id
string<uuid>
required
workspaceId
string<uuid>
required
slug
string
required
name
string
required
description
string | null
required
prompt
string
required
cron
string
required
model
string | null
required
enabled
boolean
required
planBlocked
boolean
required

True when the org cannot currently run scheduled tasks (gated at dispatch).

nextRunAt
string<date-time> | null
required
lastRunAt
string<date-time> | null
required
url
string<uri>
required
handoff
object

Present when planBlocked — points the caller at the upgrade flow.