Inspect

Create automation

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

Base URL
POST
/api/public/v1/automations

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

Authorization

bearerAuth
headerAuthorizationBearer <token>

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

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
sourceAutomationId?|

Optional published automation ID to soft fork.

Defaultnull
source_automation_id?|

Alias of sourceAutomationId. sourceAutomationId wins when both are set.

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
slack_fanout_destinations?array<>

Optional purpose-routed destinations. When users describe Slack routing in natural language, extract each Slack channel id/link plus the specific purpose/context that belongs there into this array and show the diff before enabling or saving.

Itemsitems <= 50
Default[]
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/public/v1/models. Defaults to the default automation model unless the selected custom agent defines its own model.

Defaultnull
custom_agent_id?|
Defaultnull
autofix_ci_failures?|

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

Defaultnull
auto_review_enabled?|

Null resolves to false and is stored explicitly.

Defaultnull
auto_address_pr_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. Each value must be an object; label, valueType (text, integer, number or boolean), defaultValue and options are read from it and any other or invalid fields are ignored.

Default{}

Response Body

Automation created

application/json
  1. response
data*
Example Request
curl -X POST 'https://your-org.inspect.com/api/public/v1/automations' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "prompt": "string",  "repositories": [    "string"  ],  "triggers": [    {      "type": "cron"    }  ]}'
Example Response
{  "data": {    "id": "string",    "name": "string",    "description": "string",    "prompt": "string",    "repositories": [      "string"    ],    "triggers": [      {        "id": "string",        "type": "cron",        "schedule_expression": "string",        "cron_expression": "string",        "timezone": "string",        "enabled": true      }    ],    "slack_channel_id": "string",    "slack_fanout_destinations": [      {        "channel_id": "string",        "context": "string"      }    ],    "post_to_slack_on_start": true,    "slack_mention_users": [      {        "type": "user",        "id": "string",        "name": "string",        "image": "string"      }    ],    "notify_collaborators_on_merge": true,    "run_as": "owner",    "owner": {      "id": "string",      "name": "string",      "email": "string",      "image": "string"    },    "collaborators": [      {        "id": "string",        "name": "string",        "email": "string",        "image": "string"      }    ],    "model_id": "string",    "custom_agent_id": "string",    "autofix_ci_failures": true,    "auto_review_enabled": true,    "auto_address_pr_reviews_policy": {      "enabled": true,      "reviewerCategories": {        "human": true,        "bot": true      },      "identityRules": [        {          "selector": "string",          "ruleType": "allow"        }      ],      "reviewBuddy": {        "enabled": true,        "enabledFindingTypes": [          "critical"        ]      }    },    "template_variables": {},    "enabled": true,    "last_run_at": "2019-08-24T14:15:22Z",    "next_run_at": "2019-08-24T14:15:22Z",    "archived_at": "2019-08-24T14:15:22Z",    "created_at": "2019-08-24T14:15:22Z",    "updated_at": "2019-08-24T14:15:22Z",    "viewer_can_edit": true  }}