Create automation
Create a new automation with zero or more independently configured triggers.
Create a new automation with zero or more independently configured triggers.
bearerAuth automations:writeAuthorizationBearer <token>API key authentication. Use your API key as the bearer token.
Scope: automations:write
application/json- body
Creates an automation whose ordered trigger list may contain repeated trigger types.
name*stringAutomation name
1 <= length <= 100description?|Optional description. When omitted, a short plain-language description is generated from the prompt.
length <= 500nullprompt*stringPrompt template sent to the agent
1 <= length <= 100000source_automation_id?|Optional published automation ID to soft fork.
nullrepositories*array<>Repository IDs the automation targets
1 <= itemstriggers*array<||||||||||||||>Trigger definitions. Pass an empty array for manual-only. Any trigger type may appear multiple times.
slack_channel_id?|nullpost_to_slack_on_start?booleanWhether automation sessions post to Slack when they start.
trueslack_mention_users?array<|>Slack users and user groups to mention in automation posts.
[]notify_collaborators_on_merge?booleanWhen true, automation-created PR merges ping the automation owner and collaborators in the Slack thread, or a group DM when no thread is available.
falserun_as?Automations.AutomationRunAsIdentity automation sessions run as: owner (the automation owner) or inspect (the Inspect system user). Only the owner can change this.
"owner""owner""inspect"collaborator_user_ids?array<>Users who can view and edit this automation from Automations. The owner is always included and ignored if passed here.
[]model_id?||Model used by the automation. Must be one of the model ids from GET /api/v2/models. Defaults to the default automation model unless the selected custom agent defines its own model.
nullagent_id?|nullautofix_ci_failures?|Null resolves to the owner user setting and is stored explicitly.
nullauto_address_pull_request_reviews_policy?|Policy applied to sessions. Null snapshots the owner user setting when the automation is created.
nullenabled?booleanWhether automatic triggers are active. Ignored when triggers is empty for manual-only automations.
truetemplate_variables?Template variable definitions keyed by variable name.
{}Automation created
application/json- response
data*curl -X POST 'https://app.inspect.com/api/v2/automations' \ -H 'Content-Type: application/json' \ -d '{ "name": "Triage failing CI on main", "prompt": "Investigate the failing {{check_name}} check on main for the {{service}} service and open a pull request with a fix.", "repositories": [ "web" ], "triggers": [ { "id": null, "type": "cron" } ]}'{ "data": { "id": "k3v8n2w6q9ts", "name": "Triage failing CI on main", "description": "Investigates failing checks on main and opens a pull request with a fix.", "prompt": "Investigate the failing {{check_name}} check on main for the {{service}} service and open a pull request with a fix.", "repositories": [ "web" ], "triggers": [ { "id": "m4p7x2c9d5hf", "type": "cron", "schedule_expression": "Every weekday at 9am", "cron_expression": "0 9 * * 1-5", "timezone": "America/New_York", "enabled": true } ], "slack_channel_id": "C03KH3AGN2G", "post_to_slack_on_start": true, "slack_mention_users": [ { "type": "user", "id": "U04QZ8K2M7N", "name": "Jane Doe", "avatar_url": "https://avatars.slack-edge.com/2024-03-12/6801234567890_3f9a1b2c4d5e6f708192_192.jpg" } ], "notify_collaborators_on_merge": false, "run_as": "owner", "owner": { "id": "Vq3kZ8xN2pLm7RtY4wHc9JbF6sDg1aEu", "name": "Jane Doe", "email": "jane@acme.com", "avatar_url": "https://avatars.githubusercontent.com/u/5831047?v=4" }, "collaborators": [ { "id": "Vq3kZ8xN2pLm7RtY4wHc9JbF6sDg1aEu", "name": "Jane Doe", "email": "jane@acme.com", "avatar_url": "https://avatars.githubusercontent.com/u/5831047?v=4" } ], "model_id": "claude-opus-5-5", "agent_id": "h2w9c4m7k1xz", "autofix_ci_failures": true, "auto_address_pull_request_reviews_policy": { "enabled": true, "reviewer_categories": { "human": true, "bot": false }, "identity_rules": [ { "selector": "bot:49699333", "rule_type": "block" } ], "review_buddy": { "enabled": true, "enabled_finding_types": [ "critical", "warning" ] } }, "template_variables": { "service": { "label": "Service", "value_type": "text", "default_value": "web", "options": [ "web", "api", "worker" ] } }, "enabled": true, "last_run_at": "2026-10-29T13:00:04.512Z", "next_run_at": "2026-10-30T13:00:00.000Z", "archived_at": null, "created_at": "2026-10-28T15:42:11.204Z", "updated_at": "2026-10-28T16:05:37.918Z", "viewer_can_edit": true }}