Create a schedule
Schedules
Create a schedule
Register a cron schedule that starts a session on each fire.
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
Display name for the schedule (max 255 characters).
When the schedule fires:
expression(string): Five-field cron expression, e.g."0 9 * * 1-5".timezone(string): IANA timezone the expression is evaluated in, e.g."Europe/Paris".type(string, optional):"cron", the default and only variant today.
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.Optional description (max 255 characters).
Examples
Response
Errors
| Status | Cause |
|---|---|
400 | Organization schedule limit reached (20), or the expression fires more often than once every 5 minutes. |
404 | The agent referenced by session_request doesn’t exist or isn’t visible to you. |
422 | Body failed validation: invalid cron expression, unknown timezone, template without messages, or template setting parent_session_id. |