Scheduled agents
Embedding is an Enterprise feature that Mitzu support switches on for your organisation. See Embedded analytics for setup, and send the authentication headers with every call.
Scheduled agents answer a question on a schedule and keep each run's findings. These endpoints see only agents made through the API with the same API key; agents made in the Mitzu app or with another key don't appear. Agents made through the API send no email and, unlike API chats, save nothing: no insights, dashboards, segments or annotations, and no web search. Your app reads their runs.
An agent belongs to the key that made it. When that key is deleted, disabled, expires or loses the Embedding permission, its agents stop running on schedule. Rotating a key therefore means creating the agents again with the new key and deleting the old ones before you remove the old key.
Agents see everything the agent's owner can see in the workspace. Everyone in the workspace can list
agents and read runs; creating, changing, pausing, running and deleting them needs an Editor
licence and the Member role (403 otherwise).
| Method and path | What it does |
|---|---|
GET /projects/{workspace_id}/embed/agents | {"items": [<agent>]} |
POST /projects/{workspace_id}/embed/agents | Body {"name", "description"?, "prompt", "schedule"}; returns 201 <agent>. 409 agent_limit_reached when the workspace has its maximum of agents |
GET /projects/{workspace_id}/embed/agents/{agent_id} | <agent> |
PATCH /projects/{workspace_id}/embed/agents/{agent_id} | Any of name, description, prompt, schedule; returns <agent> |
DELETE /projects/{workspace_id}/embed/agents/{agent_id} | 204 |
POST /projects/{workspace_id}/embed/agents/{agent_id}/pause and …/resume | Stop or restart the schedule; returns <agent> |
POST /projects/{workspace_id}/embed/agents/{agent_id}/run | Runs the agent now: 202 {"run_id", "status": "running"}, 409 busy while a manual run is going, or 403 forbidden when AI is off for your organisation or the agent's owner can no longer run it |
GET /projects/{workspace_id}/embed/agents/{agent_id}/runs | {"items": [<run>], "next_cursor"}, newest first; ?limit= is at most 50 and ?cursor= at most 1000 |
GET /projects/{workspace_id}/embed/agents/{agent_id}/runs/{run_id} | <run> |
schedule is {"hour", "minute", "weekdays", "day_of_month", "tz_offset"}: weekdays is seven
booleans starting on Monday, or set day_of_month (1-28) for a monthly run; tz_offset is in
hours. An agent is {"id", "name", "description", "prompt", "schedule", "enabled", "is_owner", "created_at", "updated_at", "last_run_at", "run_count", "running"}. A run is {"id", "conversation_id", "run_type", "scheduled_for", "created_at", "status", "headline", "subject", "findings", "message"}, where
status is running, done or failed (a run stays running until its summary is stored, at
most two minutes after the agent finishes) and each finding is {"text", "status"} with status
new, continuing or resolved.