Create agent schedule
POST/v2/agents/:agent_key/schedules
Create a new schedule for automatically executing an agent at specified intervals. Each execution creates a new session with the configured message and metadata.
Schedules enable automated agent workflows such as daily reports, periodic monitoring, or regular data processing. The schedule will create sessions tagged with metadata to identify them as scheduled executions.
Example request
\$ curl -X POST https://api.vectara.io/v2/agents/support-agent/schedules \
-H "Authorization: Bearer YOUR_API_KEY" \c
-H "Content-Type: application/json" \
-d '{
"key": "daily-report",
"name": "Daily Summary Report",
"message": [{"type": "text", "content": "Generate a summary of today's activities"}],
"schedule": {
"type": "interval",
"interval": "PT24H"
},
"session_metadata": {
"report_type": "daily"
}
}'
A successful response includes the unique schedule key, configuration, and creation timestamp.
Request
Responses
- 201
- 400
- 403
- 404
- 409
The response includes the complete schedule configuration including the unique schedule key, interval, and timestamps.
Schedule creation request was malformed or invalid.
Permissions do not allow creating schedules for this agent.
Referenced agent not found.
A schedule with the specified key already exists.