Inspect

Create automation

Create a new automation with zero or more independently configured triggers.

Base URL
POST
/api/v2/automations

Create a new automation with zero or more independently configured triggers.

Authorization

bearerAuth automations:write
headerAuthorizationBearer <token>

API key authentication. Use your API key as the bearer token.

Scope: automations:write

Request Body

application/json
  1. body

Creates an automation whose ordered trigger list may contain repeated trigger types.

name*string

Automation name

Length1 <= length <= 100
description?|

Optional description. When omitted, a short plain-language description is generated from the prompt.

Lengthlength <= 500
Defaultnull
prompt*string

Prompt template sent to the agent

Length1 <= length <= 100000
source_automation_id?|

Optional published automation ID to soft fork.

Defaultnull
repositories*array<>

Repository IDs the automation targets

Items1 <= items
triggers*array<||||||||||||||>

Trigger definitions. Pass an empty array for manual-only. Any trigger type may appear multiple times.

slack_channel_id?|
Defaultnull
post_to_slack_on_start?boolean

Whether automation sessions post to Slack when they start.

Defaulttrue
slack_mention_users?array<|>

Slack users and user groups to mention in automation posts.

Default[]
notify_collaborators_on_merge?boolean

When true, automation-created PR merges ping the automation owner and collaborators in the Slack thread, or a group DM when no thread is available.

Defaultfalse
run_as?Automations.AutomationRunAs

Identity automation sessions run as: owner (the automation owner) or inspect (the Inspect system user). Only the owner can change this.

Default"owner"
Value in"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.

Default[]
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.

Defaultnull
agent_id?|
Defaultnull
autofix_ci_failures?|

Null resolves to the owner user setting and is stored explicitly.

Defaultnull
auto_address_pull_request_reviews_policy?|

Policy applied to sessions. Null snapshots the owner user setting when the automation is created.

Defaultnull
enabled?boolean

Whether automatic triggers are active. Ignored when triggers is empty for manual-only automations.

Defaulttrue
template_variables?

Template variable definitions keyed by variable name.

Default{}

Response Body

Automation created

application/json
  1. response
data*
Example Request
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"    }  ]}'
Example Response
{  "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  }}