Skip to main content
POST
Create a schedule
Registers a schedule for your organization. The session_request template is validated and resolved at creation time (the agent must exist), then re-resolved on every fire. Returns 201 with the created schedule object.

Request body

string
required
Display name for the schedule, 1 to 255 characters.
object
required
When the schedule fires:
  • expression (string, required): Five-field cron expression, e.g. "0 9 * * 1-5".
  • timezone (string, required): IANA timezone the expression is evaluated in, e.g. "Europe/Paris".
  • type (string, optional): "cron", the default and only variant.
The expression may not fire more often than once every 5 minutes.
object
required
Template used to create each scheduled session, in the same shape as the Create session body. Must contain at least one initial message and may not set parent_session_id. Defaults to max_time_s: 3600 when the template does not set it.
string
Description, up to 255 characters.
integer
How many sessions to create before the schedule becomes inactive. Each automatic fire that creates a session counts toward it, but skipped fires, errors, and manual triggers do not. When the count is reached, the schedule is paused and pause_note explains that it became inactive. Omit it to keep firing until you pause or delete the schedule. Must be at least 1.

Examples

Response

Errors