v2
OpenAPI 3.0.02026-08-051996591.2 MBCreate agent schedule
Creates a schedule that runs an agent automatically at specified intervals. Each execution creates a new session with the configured message and metadata.
Use schedules for automated agent workflows such as daily reports, periodic monitoring, or regular data processing. The schedule tags each created session with metadata that identifies it as a scheduled execution.
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.
Path parameters
A unique key that identifies an agent.
The unique key of the agent to create a schedule for.
Headers
The platform makes a best effort to complete the request in the specified seconds, or it times out.
The platform makes a best effort to complete the request in the specified milliseconds, or it times out.
Request body
Example request
{
"key": "daily-report",
"name": "Daily Summary Report",
"message": [
{
"type": "text",
"content": "I need help with my widget installation"
}
],
"schedule": {
"type": "interval",
"interval": "PT24H"
},
"run_condition": "get('$.session.metadata.open_incidents') > 0",
"stall_timeout_seconds": 1800
}Response
The created schedule, including the unique schedule key, interval, and timestamps.
Example response
{
"key": "daily-report",
"agent_key": "customer_support",
"name": "Daily Summary Report",
"description": "Generates a daily summary report of customer support activities",
"message": [
{
"type": "text",
"content": "Generate a summary of today's activities"
}
],
"schedule": {
"type": "interval",
"interval": "PT24H"
},
"enabled": true,
"session_metadata": {
"report_type": "daily",
"format": "markdown"
},
"run_condition": "get('$.session.metadata.open_incidents') > 0",
"max_executions_to_keep": 10,
"stall_timeout_seconds": 1800,
"last_execution_at": "2024-01-15T10:30:00Z",
"created_at": "1970-01-01T00:00:00Z"
}