Create an AI Routine
Create a new AI Routine that runs a saved prompt on a schedule and delivers the AI response through email, Slack, or a webhook. To run a routine when a condition is met, provide a condition in the request body.
Each scheduled run executes once using the routine owner’s permissions, and every recipient receives the same result.
Authorizations
Can be either an Organization API Key or Personal Access Token (PAT).
Include in the Authorization header as: Bearer YOUR_TOKEN
Query Parameters
Body
Optional agent the routine runs through, by the agent's ID (the ID in the agent's URL in Omni). Must be an agent the routine owner can run, in an organization with agents enabled for that owner; otherwise the request returns 403 (agents not enabled) or 404 (no such agent for the owner).
Can't be sent together with condition. Can't be set on a routine that is, or would be, personalized for each recipient.
Omit to run as the organization's main AI agent.
"0b1f6c1e-2d3a-4f5b-8c7d-9e0a1b2c3d4e"
The LLM the routine runs on. Must be an approved LLM in AI Hub > General > LLM settings that the routine owner has access to. Use the List available LLMs endpoint to retrieve a list of available LLMs.
Omit or pass null to use the organization default.

