Create Schedule
Create a cron schedule for an agent.
Create a cron schedule for an agent.
agent_id is the agent's id or slug. The schedule fires its first run at the
next time matching cron_expr after this call returns. Set run_as to have its
runs act for you, with your person memory and rules; the person a schedule runs
as is shown on it and set only at creation. Use DELETE /api/v1/schedules/{id}
to remove a schedule, or PATCH /api/v1/schedules/{id} with enabled=false to
pause it without losing its configuration.
Authorization
HTTPBearer In: header
Path Parameters
Header Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X POST "https://api.levainlabs.com/api/v1/agents/string/schedules" \ -H "Content-Type: application/json" \ -d '{ "cron_expr": "string" }'{
"id": "string",
"agent_id": "string",
"agent_version_id": "string",
"cron_expr": "string",
"timezone": "string",
"prompt": "string",
"initial_state": {},
"enabled": true,
"paused_reason": "string",
"resume_at": "string",
"skip_if_active_within_minutes": 0,
"run_as_user": {
"id": "string",
"name": "string",
"email": "string"
},
"next_fire_at": "string",
"last_fired_at": "string",
"last_run_id": "string",
"created_at": "string"
}