# Update a managed automation

Update a managed automation

`PATCH /api/projects/{id}/automations/{automationId}`

Required permission: `automation:update`.

## Parameters

| Name | In | Type | Required | Description |

| --- | --- | --- | --- | --- |

| `id` | path | `string` | Yes | — |

| `automationId` | path | `string` | Yes | — |

| `Idempotency-Key` | header | `string` | No | Required for writes authenticated by a service credential and for service-account lifecycle writes. Other session writes may opt in. Reuse the key and payload for retries. Settled keys remain reserved for at least seven days; a transient 4xx releases its key. Changed payloads return 409. Match any legacy clientOperationId/clientMessageId in the body. |

## Request body

| Field | Type | Required | Constraints | Description |
| --- | --- | --- | --- | --- |
| `webhookOperationId` | `string` | No | min length 1, max length 64 | — |
| `modelId` | `string \| null` | No | — | — |
| `modelId.Option 1` | `string` | No | min length 1, max length 200 | — |
| `modelId.Option 2` | `null` | No | — | — |
| `triggers` | `object[]` | No | max 20 items, min 1 items | — |
| `triggers.id` | `string` | Yes | min length 1, max length 64 | — |
| `triggers.triggerKind` | `string` | Yes | webhook · schedule | — |
| `triggers.eventKind` | `string \| null` | No | — | — |
| `triggers.eventKind.Option 1` | `string` | No | github.pull_request.opened · github.pull_request.closed · github.pull_request.updated · github.pull_request.merged · github.pull_request.changes_requested · github.check_run.failed · sentry.issue · linear.issue.created · linear.issue.status_changed · linear.issue.label_added · slack.reaction.added · slack.message.posted · sazabi.issue.triggered · sazabi.issue.resolved · hoplite.thread.finished | — |
| `triggers.eventKind.Option 2` | `null` | No | — | — |
| `triggers.schedule` | `object \| null` | No | — | — |
| `triggers.schedule.Option 1` | `object` | No | — | — |
| `triggers.schedule.Option 1.Option 1` | `object` | No | — | — |
| `triggers.schedule.Option 1.Option 1.mode` | `string` | Yes | constant "cron" | — |
| `triggers.schedule.Option 1.Option 1.expression` | `string` | Yes | max length 1000 | — |
| `triggers.schedule.Option 1.Option 1.timezone` | `string` | Yes | max length 200 | — |
| `triggers.schedule.Option 1.Option 2` | `object` | No | — | — |
| `triggers.schedule.Option 1.Option 2.mode` | `string` | Yes | constant "interval" | — |
| `triggers.schedule.Option 1.Option 2.intervalMs` | `number` | Yes | — | — |
| `triggers.schedule.Option 2` | `null` | No | — | — |
| `triggers.conditions` | `object \| null` | No | — | — |
| `triggers.conditions.Option 1` | `object` | No | — | — |
| `triggers.conditions.Option 1.match` | `string` | Yes | all · any | — |
| `triggers.conditions.Option 1.rules` | `object[]` | Yes | max 20 items | — |
| `triggers.conditions.Option 1.rules.field` | `string` | Yes | min length 1, max length 200, pattern ^[a-zA-Z0-9_-]+(?:\.[a-zA-Z0-9_-]+)*$ | — |
| `triggers.conditions.Option 1.rules.operator` | `string` | Yes | equals · not_equals · contains · not_contains · starts_with · ends_with · exists · not_exists · greater_than · less_than | — |
| `triggers.conditions.Option 1.rules.value` | `string` | Yes | max length 2000 | — |
| `triggers.conditions.Option 2` | `null` | No | — | — |
| `triggers.sentryBindingId` | `string \| null` | No | — | — |
| `triggers.sentryTriggerPolicy` | `object \| null` | No | — | — |
| `triggers.sentryTriggerPolicy.Option 1` | `object` | No | — | — |
| `triggers.sentryTriggerPolicy.Option 1.newIssues` | `boolean` | No | — | — |
| `triggers.sentryTriggerPolicy.Option 1.regressions` | `boolean` | No | — | — |
| `triggers.sentryTriggerPolicy.Option 1.levels` | `string[]` | No | — | — |
| `triggers.sentryTriggerPolicy.Option 1.levels.[item]` | `string` | No | fatal · error · warning · info · debug | — |
| `triggers.sentryTriggerPolicy.Option 2` | `null` | No | — | — |
| `triggers.slack` | `object \| null` | No | — | — |
| `triggers.slack.Option 1` | `object` | No | — | — |
| `triggers.slack.Option 1.teamId` | `string` | Yes | max length 64 | — |
| `triggers.slack.Option 1.channelIds` | `string[]` | Yes | max 50 items | — |
| `triggers.slack.Option 1.channelIds.[item]` | `string` | No | pattern ^[CG][A-Z0-9]+$ | — |
| `triggers.slack.Option 1.sender` | `string` | Yes | anyone · members | — |
| `triggers.slack.Option 1.keyword` | `string` | Yes | max length 200 | — |
| `triggers.slack.Option 1.useRegex` | `boolean` | Yes | — | — |
| `triggers.slack.Option 1.ignoreThreadReplies` | `boolean` | Yes | — | — |
| `triggers.slack.Option 1.reaction` | `string` | Yes | max length 100, pattern ^[a-zA-Z0-9_+-]*$ | — |
| `triggers.slack.Option 1.completionReaction` | `string \| null` | Yes | — | — |
| `triggers.slack.Option 1.completionReaction.Option 1` | `string` | No | min length 1, max length 100, pattern ^[a-zA-Z0-9_+-]+$ | — |
| `triggers.slack.Option 1.completionReaction.Option 2` | `null` | No | — | — |
| `triggers.slack.Option 2` | `null` | No | — | — |
| `workflow` | `object \| null` | No | — | — |
| `workflow.Option 1` | `object` | No | — | — |
| `workflow.Option 1.version` | `number` | Yes | constant 1 | — |
| `workflow.Option 1.root` | `string[]` | Yes | max 50 items | — |
| `workflow.Option 1.root.[item]` | `string` | No | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `workflow.Option 1.steps` | `object[]` | Yes | max 50 items | — |
| `workflow.Option 1.steps.Option 1` | `object` | No | — | — |
| `workflow.Option 1.steps.Option 1.id` | `string` | Yes | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `workflow.Option 1.steps.Option 1.name` | `string` | Yes | max length 120 | — |
| `workflow.Option 1.steps.Option 1.type` | `string` | Yes | constant "start_thread" | — |
| `workflow.Option 1.steps.Option 1.prompt` | `string` | Yes | max length 100000 | — |
| `workflow.Option 1.steps.Option 1.repoFullName` | `string \| null` | Yes | — | — |
| `workflow.Option 1.steps.Option 1.repoFullName.Option 1` | `string` | No | max length 260 | — |
| `workflow.Option 1.steps.Option 1.repoFullName.Option 2` | `null` | No | — | — |
| `workflow.Option 1.steps.Option 1.maxSpendPerThreadMicros` | `integer \| null` | Yes | — | — |
| `workflow.Option 1.steps.Option 1.maxSpendPerThreadMicros.Option 1` | `integer` | No | max 9007199254740991 | — |
| `workflow.Option 1.steps.Option 1.maxSpendPerThreadMicros.Option 2` | `null` | No | — | — |
| `workflow.Option 1.steps.Option 2` | `object` | No | — | — |
| `workflow.Option 1.steps.Option 2.id` | `string` | Yes | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `workflow.Option 1.steps.Option 2.name` | `string` | Yes | max length 120 | — |
| `workflow.Option 1.steps.Option 2.type` | `string` | Yes | constant "continue_thread" | — |
| `workflow.Option 1.steps.Option 2.prompt` | `string` | Yes | max length 100000 | — |
| `workflow.Option 1.steps.Option 2.thread` | `object` | Yes | — | — |
| `workflow.Option 1.steps.Option 2.thread.Option 1` | `object` | No | — | — |
| `workflow.Option 1.steps.Option 2.thread.Option 1.source` | `string` | Yes | constant "step" | — |
| `workflow.Option 1.steps.Option 2.thread.Option 1.stepId` | `string` | Yes | max length 64 | — |
| `workflow.Option 1.steps.Option 2.thread.Option 2` | `object` | No | — | — |
| `workflow.Option 1.steps.Option 2.thread.Option 2.source` | `string` | Yes | constant "thread" | — |
| `workflow.Option 1.steps.Option 2.thread.Option 2.threadId` | `string` | Yes | max length 200 | — |
| `workflow.Option 1.steps.Option 3` | `object` | No | — | — |
| `workflow.Option 1.steps.Option 3.id` | `string` | Yes | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `workflow.Option 1.steps.Option 3.name` | `string` | Yes | max length 120 | — |
| `workflow.Option 1.steps.Option 3.type` | `string` | Yes | constant "stop_run" | — |
| `workflow.Option 1.steps.Option 3.thread` | `object` | Yes | — | — |
| `workflow.Option 1.steps.Option 3.thread.Option 1` | `object` | No | — | — |
| `workflow.Option 1.steps.Option 3.thread.Option 1.source` | `string` | Yes | constant "step" | — |
| `workflow.Option 1.steps.Option 3.thread.Option 1.stepId` | `string` | Yes | max length 64 | — |
| `workflow.Option 1.steps.Option 3.thread.Option 2` | `object` | No | — | — |
| `workflow.Option 1.steps.Option 3.thread.Option 2.source` | `string` | Yes | constant "thread" | — |
| `workflow.Option 1.steps.Option 3.thread.Option 2.threadId` | `string` | Yes | max length 200 | — |
| `workflow.Option 1.steps.Option 4` | `object` | No | — | — |
| `workflow.Option 1.steps.Option 4.id` | `string` | Yes | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `workflow.Option 1.steps.Option 4.name` | `string` | Yes | max length 120 | — |
| `workflow.Option 1.steps.Option 4.type` | `string` | Yes | constant "archive_thread" | — |
| `workflow.Option 1.steps.Option 4.thread` | `object` | Yes | — | — |
| `workflow.Option 1.steps.Option 4.thread.Option 1` | `object` | No | — | — |
| `workflow.Option 1.steps.Option 4.thread.Option 1.source` | `string` | Yes | constant "step" | — |
| `workflow.Option 1.steps.Option 4.thread.Option 1.stepId` | `string` | Yes | max length 64 | — |
| `workflow.Option 1.steps.Option 4.thread.Option 2` | `object` | No | — | — |
| `workflow.Option 1.steps.Option 4.thread.Option 2.source` | `string` | Yes | constant "thread" | — |
| `workflow.Option 1.steps.Option 4.thread.Option 2.threadId` | `string` | Yes | max length 200 | — |
| `workflow.Option 1.steps.Option 5` | `object` | No | — | — |
| `workflow.Option 1.steps.Option 5.id` | `string` | Yes | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `workflow.Option 1.steps.Option 5.name` | `string` | Yes | max length 120 | — |
| `workflow.Option 1.steps.Option 5.type` | `string` | Yes | constant "unarchive_thread" | — |
| `workflow.Option 1.steps.Option 5.thread` | `object` | Yes | — | — |
| `workflow.Option 1.steps.Option 5.thread.Option 1` | `object` | No | — | — |
| `workflow.Option 1.steps.Option 5.thread.Option 1.source` | `string` | Yes | constant "step" | — |
| `workflow.Option 1.steps.Option 5.thread.Option 1.stepId` | `string` | Yes | max length 64 | — |
| `workflow.Option 1.steps.Option 5.thread.Option 2` | `object` | No | — | — |
| `workflow.Option 1.steps.Option 5.thread.Option 2.source` | `string` | Yes | constant "thread" | — |
| `workflow.Option 1.steps.Option 5.thread.Option 2.threadId` | `string` | Yes | max length 200 | — |
| `workflow.Option 1.steps.Option 6` | `object` | No | — | — |
| `workflow.Option 1.steps.Option 6.id` | `string` | Yes | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `workflow.Option 1.steps.Option 6.name` | `string` | Yes | max length 120 | — |
| `workflow.Option 1.steps.Option 6.type` | `string` | Yes | constant "rename_thread" | — |
| `workflow.Option 1.steps.Option 6.thread` | `object` | Yes | — | — |
| `workflow.Option 1.steps.Option 6.thread.Option 1` | `object` | No | — | — |
| `workflow.Option 1.steps.Option 6.thread.Option 1.source` | `string` | Yes | constant "step" | — |
| `workflow.Option 1.steps.Option 6.thread.Option 1.stepId` | `string` | Yes | max length 64 | — |
| `workflow.Option 1.steps.Option 6.thread.Option 2` | `object` | No | — | — |
| `workflow.Option 1.steps.Option 6.thread.Option 2.source` | `string` | Yes | constant "thread" | — |
| `workflow.Option 1.steps.Option 6.thread.Option 2.threadId` | `string` | Yes | max length 200 | — |
| `workflow.Option 1.steps.Option 6.title` | `string` | Yes | max length 500 | — |
| `workflow.Option 1.steps.Option 7` | `object` | No | — | — |
| `workflow.Option 1.steps.Option 7.id` | `string` | Yes | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `workflow.Option 1.steps.Option 7.name` | `string` | Yes | max length 120 | — |
| `workflow.Option 1.steps.Option 7.type` | `string` | Yes | constant "set_spend_limit" | — |
| `workflow.Option 1.steps.Option 7.thread` | `object` | Yes | — | — |
| `workflow.Option 1.steps.Option 7.thread.Option 1` | `object` | No | — | — |
| `workflow.Option 1.steps.Option 7.thread.Option 1.source` | `string` | Yes | constant "step" | — |
| `workflow.Option 1.steps.Option 7.thread.Option 1.stepId` | `string` | Yes | max length 64 | — |
| `workflow.Option 1.steps.Option 7.thread.Option 2` | `object` | No | — | — |
| `workflow.Option 1.steps.Option 7.thread.Option 2.source` | `string` | Yes | constant "thread" | — |
| `workflow.Option 1.steps.Option 7.thread.Option 2.threadId` | `string` | Yes | max length 200 | — |
| `workflow.Option 1.steps.Option 7.maxSpendPerThreadMicros` | `integer \| null` | Yes | — | — |
| `workflow.Option 1.steps.Option 7.maxSpendPerThreadMicros.Option 1` | `integer` | No | max 9007199254740991 | — |
| `workflow.Option 1.steps.Option 7.maxSpendPerThreadMicros.Option 2` | `null` | No | — | — |
| `workflow.Option 1.steps.Option 8` | `object` | No | — | — |
| `workflow.Option 1.steps.Option 8.id` | `string` | Yes | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `workflow.Option 1.steps.Option 8.name` | `string` | Yes | max length 120 | — |
| `workflow.Option 1.steps.Option 8.type` | `string` | Yes | constant "start_preview" | — |
| `workflow.Option 1.steps.Option 8.thread` | `object` | Yes | — | — |
| `workflow.Option 1.steps.Option 8.thread.Option 1` | `object` | No | — | — |
| `workflow.Option 1.steps.Option 8.thread.Option 1.source` | `string` | Yes | constant "step" | — |
| `workflow.Option 1.steps.Option 8.thread.Option 1.stepId` | `string` | Yes | max length 64 | — |
| `workflow.Option 1.steps.Option 8.thread.Option 2` | `object` | No | — | — |
| `workflow.Option 1.steps.Option 8.thread.Option 2.source` | `string` | Yes | constant "thread" | — |
| `workflow.Option 1.steps.Option 8.thread.Option 2.threadId` | `string` | Yes | max length 200 | — |
| `workflow.Option 1.steps.Option 9` | `object` | No | — | — |
| `workflow.Option 1.steps.Option 9.id` | `string` | Yes | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `workflow.Option 1.steps.Option 9.name` | `string` | Yes | max length 120 | — |
| `workflow.Option 1.steps.Option 9.type` | `string` | Yes | constant "if" | — |
| `workflow.Option 1.steps.Option 9.conditions` | `object` | Yes | — | — |
| `workflow.Option 1.steps.Option 9.conditions.match` | `string` | Yes | all · any | — |
| `workflow.Option 1.steps.Option 9.conditions.rules` | `object[]` | Yes | max 20 items | — |
| `workflow.Option 1.steps.Option 9.conditions.rules.field` | `string` | Yes | min length 1, max length 200, pattern ^[a-zA-Z0-9_-]+(?:\.[a-zA-Z0-9_-]+)*$ | — |
| `workflow.Option 1.steps.Option 9.conditions.rules.operator` | `string` | Yes | equals · not_equals · contains · not_contains · starts_with · ends_with · exists · not_exists · greater_than · less_than | — |
| `workflow.Option 1.steps.Option 9.conditions.rules.value` | `string` | Yes | max length 2000 | — |
| `workflow.Option 1.steps.Option 9.then` | `string[]` | Yes | max 50 items | — |
| `workflow.Option 1.steps.Option 9.then.[item]` | `string` | No | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `workflow.Option 1.steps.Option 9.else` | `string[]` | Yes | max 50 items | — |
| `workflow.Option 1.steps.Option 9.else.[item]` | `string` | No | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `workflow.Option 1.steps.Option 10` | `object` | No | — | — |
| `workflow.Option 1.steps.Option 10.id` | `string` | Yes | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `workflow.Option 1.steps.Option 10.name` | `string` | Yes | max length 120 | — |
| `workflow.Option 1.steps.Option 10.type` | `string` | Yes | constant "delay" | — |
| `workflow.Option 1.steps.Option 10.durationMs` | `integer` | Yes | min 60000, max 2592000000 | — |
| `workflow.Option 1.steps.Option 11` | `object` | No | — | — |
| `workflow.Option 1.steps.Option 11.id` | `string` | Yes | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `workflow.Option 1.steps.Option 11.name` | `string` | Yes | max length 120 | — |
| `workflow.Option 1.steps.Option 11.type` | `string` | Yes | constant "wait_thread" | — |
| `workflow.Option 1.steps.Option 11.thread` | `object` | Yes | — | — |
| `workflow.Option 1.steps.Option 11.thread.Option 1` | `object` | No | — | — |
| `workflow.Option 1.steps.Option 11.thread.Option 1.source` | `string` | Yes | constant "step" | — |
| `workflow.Option 1.steps.Option 11.thread.Option 1.stepId` | `string` | Yes | max length 64 | — |
| `workflow.Option 1.steps.Option 11.thread.Option 2` | `object` | No | — | — |
| `workflow.Option 1.steps.Option 11.thread.Option 2.source` | `string` | Yes | constant "thread" | — |
| `workflow.Option 1.steps.Option 11.thread.Option 2.threadId` | `string` | Yes | max length 200 | — |
| `workflow.Option 1.steps.Option 11.timeoutMs` | `integer` | Yes | min 60000, max 2592000000 | — |
| `workflow.Option 1.steps.Option 11.completed` | `string[]` | Yes | max 50 items | — |
| `workflow.Option 1.steps.Option 11.completed.[item]` | `string` | No | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `workflow.Option 1.steps.Option 11.timedOut` | `string[]` | Yes | max 50 items | — |
| `workflow.Option 1.steps.Option 11.timedOut.[item]` | `string` | No | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `workflow.Option 1.steps.Option 12` | `object` | No | — | — |
| `workflow.Option 1.steps.Option 12.id` | `string` | Yes | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `workflow.Option 1.steps.Option 12.name` | `string` | Yes | max length 120 | — |
| `workflow.Option 1.steps.Option 12.type` | `string` | Yes | constant "exit" | — |
| `workflow.Option 2` | `null` | No | — | — |
| `conditions` | `object \| null` | No | — | — |
| `conditions.Option 1` | `object` | No | — | — |
| `conditions.Option 1.match` | `string` | Yes | all · any | — |
| `conditions.Option 1.rules` | `object[]` | Yes | max 20 items | — |
| `conditions.Option 1.rules.field` | `string` | Yes | min length 1, max length 200, pattern ^[a-zA-Z0-9_-]+(?:\.[a-zA-Z0-9_-]+)*$ | — |
| `conditions.Option 1.rules.operator` | `string` | Yes | equals · not_equals · contains · not_contains · starts_with · ends_with · exists · not_exists · greater_than · less_than | — |
| `conditions.Option 1.rules.value` | `string` | Yes | max length 2000 | — |
| `conditions.Option 2` | `null` | No | — | — |
| `eventKind` | `string \| null` | No | — | — |
| `eventKind.Option 1` | `string` | No | github.pull_request.opened · github.pull_request.closed · github.pull_request.updated · github.pull_request.merged · github.pull_request.changes_requested · github.check_run.failed · sentry.issue · linear.issue.created · linear.issue.status_changed · linear.issue.label_added · slack.reaction.added · slack.message.posted · sazabi.issue.triggered · sazabi.issue.resolved · hoplite.thread.finished | — |
| `eventKind.Option 2` | `null` | No | — | — |
| `sentryBindingId` | `string \| null` | No | — | — |
| `sentryBindingId.Option 1` | `string` | No | min length 1, max length 200 | — |
| `sentryBindingId.Option 2` | `null` | No | — | — |
| `sentryTriggerPolicy` | `object \| null` | No | — | — |
| `sentryTriggerPolicy.Option 1` | `object` | No | — | — |
| `sentryTriggerPolicy.Option 1.newIssues` | `boolean` | No | — | — |
| `sentryTriggerPolicy.Option 1.regressions` | `boolean` | No | — | — |
| `sentryTriggerPolicy.Option 1.levels` | `string[]` | No | — | — |
| `sentryTriggerPolicy.Option 1.levels.[item]` | `string` | No | fatal · error · warning · info · debug | — |
| `sentryTriggerPolicy.Option 2` | `null` | No | — | — |
| `targetThreadId` | `string \| null` | No | — | — |
| `targetThreadId.Option 1` | `string` | No | min length 1, max length 200 | — |
| `targetThreadId.Option 2` | `null` | No | — | — |
| `isDraft` | `boolean` | No | — | — |
| `name` | `string` | No | min length 1, max length 120 | — |
| `repoFullName` | `string \| null` | No | — | — |
| `repoFullName.Option 1` | `string` | No | min length 1, max length 260 | — |
| `repoFullName.Option 2` | `null` | No | — | — |
| `enabled` | `boolean` | No | — | — |
| `schedule` | `object \| null` | No | — | — |
| `schedule.Option 1` | `object` | No | — | — |
| `schedule.Option 1.Option 1` | `object` | No | — | — |
| `schedule.Option 1.Option 1.mode` | `string` | Yes | constant "cron" | — |
| `schedule.Option 1.Option 1.expression` | `string` | Yes | max length 1000 | — |
| `schedule.Option 1.Option 1.timezone` | `string` | Yes | max length 200 | — |
| `schedule.Option 1.Option 2` | `object` | No | — | — |
| `schedule.Option 1.Option 2.mode` | `string` | Yes | constant "interval" | — |
| `schedule.Option 1.Option 2.intervalMs` | `number` | Yes | — | — |
| `schedule.Option 2` | `null` | No | — | — |
| `prompt` | `string` | No | max length 100000 | — |
| `title` | `string \| null` | No | — | — |
| `title.Option 1` | `string` | No | min length 1, max length 160 | — |
| `title.Option 2` | `null` | No | — | — |
| `maxSpendPerThreadMicros` | `integer \| null` | No | — | — |
| `maxSpendPerThreadMicros.Option 1` | `integer` | No | max 9007199254740991 | — |
| `maxSpendPerThreadMicros.Option 2` | `null` | No | — | — |

```json
{
  "enabled": false
}
```

## Example request

```bash
curl --request PATCH \
  --url https://api.hoplite.sh/api/projects/id/automations/automationId \
  --header "X-Api-Key: $HOPLITE_API_KEY" \
  --header "Idempotency-Key: $HOPLITE_OPERATION_ID" \
  --header 'Content-Type: application/json' \
  --data '{
  "enabled": false
}'
```

## 200 response

Successful response

Content type: `application/json`. Response type: `object`.

| Field | Type | Required | Constraints | Description |
| --- | --- | --- | --- | --- |
| `ok` | `boolean` | Yes | constant true | — |
| `automation` | `object` | Yes | — | — |
| `automation.modelId` | `string \| null` | No | — | — |
| `automation.triggers` | `object[] \| null` | No | — | — |
| `automation.triggers.Option 1` | `object[]` | No | — | — |
| `automation.triggers.Option 1.id` | `string` | Yes | min length 1, max length 64 | — |
| `automation.triggers.Option 1.triggerKind` | `string` | Yes | webhook · schedule | — |
| `automation.triggers.Option 1.eventKind` | `string \| null` | No | — | — |
| `automation.triggers.Option 1.eventKind.Option 1` | `string` | No | github.pull_request.opened · github.pull_request.closed · github.pull_request.updated · github.pull_request.merged · github.pull_request.changes_requested · github.check_run.failed · sentry.issue · linear.issue.created · linear.issue.status_changed · linear.issue.label_added · slack.reaction.added · slack.message.posted · sazabi.issue.triggered · sazabi.issue.resolved · hoplite.thread.finished | — |
| `automation.triggers.Option 1.eventKind.Option 2` | `null` | No | — | — |
| `automation.triggers.Option 1.schedule` | `object \| null` | No | — | — |
| `automation.triggers.Option 1.schedule.Option 1` | `object` | No | — | — |
| `automation.triggers.Option 1.schedule.Option 1.Option 1` | `object` | No | — | — |
| `automation.triggers.Option 1.schedule.Option 1.Option 1.mode` | `string` | Yes | constant "cron" | — |
| `automation.triggers.Option 1.schedule.Option 1.Option 1.expression` | `string` | Yes | max length 1000 | — |
| `automation.triggers.Option 1.schedule.Option 1.Option 1.timezone` | `string` | Yes | max length 200 | — |
| `automation.triggers.Option 1.schedule.Option 1.Option 2` | `object` | No | — | — |
| `automation.triggers.Option 1.schedule.Option 1.Option 2.mode` | `string` | Yes | constant "interval" | — |
| `automation.triggers.Option 1.schedule.Option 1.Option 2.intervalMs` | `number` | Yes | — | — |
| `automation.triggers.Option 1.schedule.Option 2` | `null` | No | — | — |
| `automation.triggers.Option 1.conditions` | `object \| null` | No | — | — |
| `automation.triggers.Option 1.conditions.Option 1` | `object` | No | — | — |
| `automation.triggers.Option 1.conditions.Option 1.match` | `string` | Yes | all · any | — |
| `automation.triggers.Option 1.conditions.Option 1.rules` | `object[]` | Yes | max 20 items | — |
| `automation.triggers.Option 1.conditions.Option 1.rules.field` | `string` | Yes | min length 1, max length 200, pattern ^[a-zA-Z0-9_-]+(?:\.[a-zA-Z0-9_-]+)*$ | — |
| `automation.triggers.Option 1.conditions.Option 1.rules.operator` | `string` | Yes | equals · not_equals · contains · not_contains · starts_with · ends_with · exists · not_exists · greater_than · less_than | — |
| `automation.triggers.Option 1.conditions.Option 1.rules.value` | `string` | Yes | max length 2000 | — |
| `automation.triggers.Option 1.conditions.Option 2` | `null` | No | — | — |
| `automation.triggers.Option 1.sentryBindingId` | `string \| null` | No | — | — |
| `automation.triggers.Option 1.sentryTriggerPolicy` | `object \| null` | No | — | — |
| `automation.triggers.Option 1.sentryTriggerPolicy.Option 1` | `object` | No | — | — |
| `automation.triggers.Option 1.sentryTriggerPolicy.Option 1.newIssues` | `boolean` | No | — | — |
| `automation.triggers.Option 1.sentryTriggerPolicy.Option 1.regressions` | `boolean` | No | — | — |
| `automation.triggers.Option 1.sentryTriggerPolicy.Option 1.levels` | `string[]` | No | — | — |
| `automation.triggers.Option 1.sentryTriggerPolicy.Option 1.levels.[item]` | `string` | No | fatal · error · warning · info · debug | — |
| `automation.triggers.Option 1.sentryTriggerPolicy.Option 2` | `null` | No | — | — |
| `automation.triggers.Option 1.slack` | `object \| null` | No | — | — |
| `automation.triggers.Option 1.slack.Option 1` | `object` | No | — | — |
| `automation.triggers.Option 1.slack.Option 1.teamId` | `string` | Yes | max length 64 | — |
| `automation.triggers.Option 1.slack.Option 1.channelIds` | `string[]` | Yes | max 50 items | — |
| `automation.triggers.Option 1.slack.Option 1.channelIds.[item]` | `string` | No | pattern ^[CG][A-Z0-9]+$ | — |
| `automation.triggers.Option 1.slack.Option 1.sender` | `string` | Yes | anyone · members | — |
| `automation.triggers.Option 1.slack.Option 1.keyword` | `string` | Yes | max length 200 | — |
| `automation.triggers.Option 1.slack.Option 1.useRegex` | `boolean` | Yes | — | — |
| `automation.triggers.Option 1.slack.Option 1.ignoreThreadReplies` | `boolean` | Yes | — | — |
| `automation.triggers.Option 1.slack.Option 1.reaction` | `string` | Yes | max length 100, pattern ^[a-zA-Z0-9_+-]*$ | — |
| `automation.triggers.Option 1.slack.Option 1.completionReaction` | `string \| null` | Yes | — | — |
| `automation.triggers.Option 1.slack.Option 1.completionReaction.Option 1` | `string` | No | min length 1, max length 100, pattern ^[a-zA-Z0-9_+-]+$ | — |
| `automation.triggers.Option 1.slack.Option 1.completionReaction.Option 2` | `null` | No | — | — |
| `automation.triggers.Option 1.slack.Option 2` | `null` | No | — | — |
| `automation.triggers.Option 1.nextRunAt` | `string<date-time> \| null` | No | — | — |
| `automation.triggers.Option 2` | `null` | No | — | — |
| `automation.workflow` | `object \| null` | No | — | — |
| `automation.workflow.Option 1` | `object` | No | — | — |
| `automation.workflow.Option 1.version` | `number` | Yes | constant 1 | — |
| `automation.workflow.Option 1.root` | `string[]` | Yes | max 50 items | — |
| `automation.workflow.Option 1.root.[item]` | `string` | No | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `automation.workflow.Option 1.steps` | `object[]` | Yes | max 50 items | — |
| `automation.workflow.Option 1.steps.Option 1` | `object` | No | — | — |
| `automation.workflow.Option 1.steps.Option 1.id` | `string` | Yes | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `automation.workflow.Option 1.steps.Option 1.name` | `string` | Yes | max length 120 | — |
| `automation.workflow.Option 1.steps.Option 1.type` | `string` | Yes | constant "start_thread" | — |
| `automation.workflow.Option 1.steps.Option 1.prompt` | `string` | Yes | max length 100000 | — |
| `automation.workflow.Option 1.steps.Option 1.repoFullName` | `string \| null` | Yes | — | — |
| `automation.workflow.Option 1.steps.Option 1.repoFullName.Option 1` | `string` | No | max length 260 | — |
| `automation.workflow.Option 1.steps.Option 1.repoFullName.Option 2` | `null` | No | — | — |
| `automation.workflow.Option 1.steps.Option 1.maxSpendPerThreadMicros` | `integer \| null` | Yes | — | — |
| `automation.workflow.Option 1.steps.Option 1.maxSpendPerThreadMicros.Option 1` | `integer` | No | max 9007199254740991 | — |
| `automation.workflow.Option 1.steps.Option 1.maxSpendPerThreadMicros.Option 2` | `null` | No | — | — |
| `automation.workflow.Option 1.steps.Option 2` | `object` | No | — | — |
| `automation.workflow.Option 1.steps.Option 2.id` | `string` | Yes | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `automation.workflow.Option 1.steps.Option 2.name` | `string` | Yes | max length 120 | — |
| `automation.workflow.Option 1.steps.Option 2.type` | `string` | Yes | constant "continue_thread" | — |
| `automation.workflow.Option 1.steps.Option 2.prompt` | `string` | Yes | max length 100000 | — |
| `automation.workflow.Option 1.steps.Option 2.thread` | `object` | Yes | — | — |
| `automation.workflow.Option 1.steps.Option 2.thread.Option 1` | `object` | No | — | — |
| `automation.workflow.Option 1.steps.Option 2.thread.Option 1.source` | `string` | Yes | constant "step" | — |
| `automation.workflow.Option 1.steps.Option 2.thread.Option 1.stepId` | `string` | Yes | max length 64 | — |
| `automation.workflow.Option 1.steps.Option 2.thread.Option 2` | `object` | No | — | — |
| `automation.workflow.Option 1.steps.Option 2.thread.Option 2.source` | `string` | Yes | constant "thread" | — |
| `automation.workflow.Option 1.steps.Option 2.thread.Option 2.threadId` | `string` | Yes | max length 200 | — |
| `automation.workflow.Option 1.steps.Option 3` | `object` | No | — | — |
| `automation.workflow.Option 1.steps.Option 3.id` | `string` | Yes | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `automation.workflow.Option 1.steps.Option 3.name` | `string` | Yes | max length 120 | — |
| `automation.workflow.Option 1.steps.Option 3.type` | `string` | Yes | constant "stop_run" | — |
| `automation.workflow.Option 1.steps.Option 3.thread` | `object` | Yes | — | — |
| `automation.workflow.Option 1.steps.Option 3.thread.Option 1` | `object` | No | — | — |
| `automation.workflow.Option 1.steps.Option 3.thread.Option 1.source` | `string` | Yes | constant "step" | — |
| `automation.workflow.Option 1.steps.Option 3.thread.Option 1.stepId` | `string` | Yes | max length 64 | — |
| `automation.workflow.Option 1.steps.Option 3.thread.Option 2` | `object` | No | — | — |
| `automation.workflow.Option 1.steps.Option 3.thread.Option 2.source` | `string` | Yes | constant "thread" | — |
| `automation.workflow.Option 1.steps.Option 3.thread.Option 2.threadId` | `string` | Yes | max length 200 | — |
| `automation.workflow.Option 1.steps.Option 4` | `object` | No | — | — |
| `automation.workflow.Option 1.steps.Option 4.id` | `string` | Yes | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `automation.workflow.Option 1.steps.Option 4.name` | `string` | Yes | max length 120 | — |
| `automation.workflow.Option 1.steps.Option 4.type` | `string` | Yes | constant "archive_thread" | — |
| `automation.workflow.Option 1.steps.Option 4.thread` | `object` | Yes | — | — |
| `automation.workflow.Option 1.steps.Option 4.thread.Option 1` | `object` | No | — | — |
| `automation.workflow.Option 1.steps.Option 4.thread.Option 1.source` | `string` | Yes | constant "step" | — |
| `automation.workflow.Option 1.steps.Option 4.thread.Option 1.stepId` | `string` | Yes | max length 64 | — |
| `automation.workflow.Option 1.steps.Option 4.thread.Option 2` | `object` | No | — | — |
| `automation.workflow.Option 1.steps.Option 4.thread.Option 2.source` | `string` | Yes | constant "thread" | — |
| `automation.workflow.Option 1.steps.Option 4.thread.Option 2.threadId` | `string` | Yes | max length 200 | — |
| `automation.workflow.Option 1.steps.Option 5` | `object` | No | — | — |
| `automation.workflow.Option 1.steps.Option 5.id` | `string` | Yes | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `automation.workflow.Option 1.steps.Option 5.name` | `string` | Yes | max length 120 | — |
| `automation.workflow.Option 1.steps.Option 5.type` | `string` | Yes | constant "unarchive_thread" | — |
| `automation.workflow.Option 1.steps.Option 5.thread` | `object` | Yes | — | — |
| `automation.workflow.Option 1.steps.Option 5.thread.Option 1` | `object` | No | — | — |
| `automation.workflow.Option 1.steps.Option 5.thread.Option 1.source` | `string` | Yes | constant "step" | — |
| `automation.workflow.Option 1.steps.Option 5.thread.Option 1.stepId` | `string` | Yes | max length 64 | — |
| `automation.workflow.Option 1.steps.Option 5.thread.Option 2` | `object` | No | — | — |
| `automation.workflow.Option 1.steps.Option 5.thread.Option 2.source` | `string` | Yes | constant "thread" | — |
| `automation.workflow.Option 1.steps.Option 5.thread.Option 2.threadId` | `string` | Yes | max length 200 | — |
| `automation.workflow.Option 1.steps.Option 6` | `object` | No | — | — |
| `automation.workflow.Option 1.steps.Option 6.id` | `string` | Yes | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `automation.workflow.Option 1.steps.Option 6.name` | `string` | Yes | max length 120 | — |
| `automation.workflow.Option 1.steps.Option 6.type` | `string` | Yes | constant "rename_thread" | — |
| `automation.workflow.Option 1.steps.Option 6.thread` | `object` | Yes | — | — |
| `automation.workflow.Option 1.steps.Option 6.thread.Option 1` | `object` | No | — | — |
| `automation.workflow.Option 1.steps.Option 6.thread.Option 1.source` | `string` | Yes | constant "step" | — |
| `automation.workflow.Option 1.steps.Option 6.thread.Option 1.stepId` | `string` | Yes | max length 64 | — |
| `automation.workflow.Option 1.steps.Option 6.thread.Option 2` | `object` | No | — | — |
| `automation.workflow.Option 1.steps.Option 6.thread.Option 2.source` | `string` | Yes | constant "thread" | — |
| `automation.workflow.Option 1.steps.Option 6.thread.Option 2.threadId` | `string` | Yes | max length 200 | — |
| `automation.workflow.Option 1.steps.Option 6.title` | `string` | Yes | max length 500 | — |
| `automation.workflow.Option 1.steps.Option 7` | `object` | No | — | — |
| `automation.workflow.Option 1.steps.Option 7.id` | `string` | Yes | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `automation.workflow.Option 1.steps.Option 7.name` | `string` | Yes | max length 120 | — |
| `automation.workflow.Option 1.steps.Option 7.type` | `string` | Yes | constant "set_spend_limit" | — |
| `automation.workflow.Option 1.steps.Option 7.thread` | `object` | Yes | — | — |
| `automation.workflow.Option 1.steps.Option 7.thread.Option 1` | `object` | No | — | — |
| `automation.workflow.Option 1.steps.Option 7.thread.Option 1.source` | `string` | Yes | constant "step" | — |
| `automation.workflow.Option 1.steps.Option 7.thread.Option 1.stepId` | `string` | Yes | max length 64 | — |
| `automation.workflow.Option 1.steps.Option 7.thread.Option 2` | `object` | No | — | — |
| `automation.workflow.Option 1.steps.Option 7.thread.Option 2.source` | `string` | Yes | constant "thread" | — |
| `automation.workflow.Option 1.steps.Option 7.thread.Option 2.threadId` | `string` | Yes | max length 200 | — |
| `automation.workflow.Option 1.steps.Option 7.maxSpendPerThreadMicros` | `integer \| null` | Yes | — | — |
| `automation.workflow.Option 1.steps.Option 7.maxSpendPerThreadMicros.Option 1` | `integer` | No | max 9007199254740991 | — |
| `automation.workflow.Option 1.steps.Option 7.maxSpendPerThreadMicros.Option 2` | `null` | No | — | — |
| `automation.workflow.Option 1.steps.Option 8` | `object` | No | — | — |
| `automation.workflow.Option 1.steps.Option 8.id` | `string` | Yes | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `automation.workflow.Option 1.steps.Option 8.name` | `string` | Yes | max length 120 | — |
| `automation.workflow.Option 1.steps.Option 8.type` | `string` | Yes | constant "start_preview" | — |
| `automation.workflow.Option 1.steps.Option 8.thread` | `object` | Yes | — | — |
| `automation.workflow.Option 1.steps.Option 8.thread.Option 1` | `object` | No | — | — |
| `automation.workflow.Option 1.steps.Option 8.thread.Option 1.source` | `string` | Yes | constant "step" | — |
| `automation.workflow.Option 1.steps.Option 8.thread.Option 1.stepId` | `string` | Yes | max length 64 | — |
| `automation.workflow.Option 1.steps.Option 8.thread.Option 2` | `object` | No | — | — |
| `automation.workflow.Option 1.steps.Option 8.thread.Option 2.source` | `string` | Yes | constant "thread" | — |
| `automation.workflow.Option 1.steps.Option 8.thread.Option 2.threadId` | `string` | Yes | max length 200 | — |
| `automation.workflow.Option 1.steps.Option 9` | `object` | No | — | — |
| `automation.workflow.Option 1.steps.Option 9.id` | `string` | Yes | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `automation.workflow.Option 1.steps.Option 9.name` | `string` | Yes | max length 120 | — |
| `automation.workflow.Option 1.steps.Option 9.type` | `string` | Yes | constant "if" | — |
| `automation.workflow.Option 1.steps.Option 9.conditions` | `object` | Yes | — | — |
| `automation.workflow.Option 1.steps.Option 9.conditions.match` | `string` | Yes | all · any | — |
| `automation.workflow.Option 1.steps.Option 9.conditions.rules` | `object[]` | Yes | max 20 items | — |
| `automation.workflow.Option 1.steps.Option 9.conditions.rules.field` | `string` | Yes | min length 1, max length 200, pattern ^[a-zA-Z0-9_-]+(?:\.[a-zA-Z0-9_-]+)*$ | — |
| `automation.workflow.Option 1.steps.Option 9.conditions.rules.operator` | `string` | Yes | equals · not_equals · contains · not_contains · starts_with · ends_with · exists · not_exists · greater_than · less_than | — |
| `automation.workflow.Option 1.steps.Option 9.conditions.rules.value` | `string` | Yes | max length 2000 | — |
| `automation.workflow.Option 1.steps.Option 9.then` | `string[]` | Yes | max 50 items | — |
| `automation.workflow.Option 1.steps.Option 9.then.[item]` | `string` | No | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `automation.workflow.Option 1.steps.Option 9.else` | `string[]` | Yes | max 50 items | — |
| `automation.workflow.Option 1.steps.Option 9.else.[item]` | `string` | No | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `automation.workflow.Option 1.steps.Option 10` | `object` | No | — | — |
| `automation.workflow.Option 1.steps.Option 10.id` | `string` | Yes | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `automation.workflow.Option 1.steps.Option 10.name` | `string` | Yes | max length 120 | — |
| `automation.workflow.Option 1.steps.Option 10.type` | `string` | Yes | constant "delay" | — |
| `automation.workflow.Option 1.steps.Option 10.durationMs` | `integer` | Yes | min 60000, max 2592000000 | — |
| `automation.workflow.Option 1.steps.Option 11` | `object` | No | — | — |
| `automation.workflow.Option 1.steps.Option 11.id` | `string` | Yes | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `automation.workflow.Option 1.steps.Option 11.name` | `string` | Yes | max length 120 | — |
| `automation.workflow.Option 1.steps.Option 11.type` | `string` | Yes | constant "wait_thread" | — |
| `automation.workflow.Option 1.steps.Option 11.thread` | `object` | Yes | — | — |
| `automation.workflow.Option 1.steps.Option 11.thread.Option 1` | `object` | No | — | — |
| `automation.workflow.Option 1.steps.Option 11.thread.Option 1.source` | `string` | Yes | constant "step" | — |
| `automation.workflow.Option 1.steps.Option 11.thread.Option 1.stepId` | `string` | Yes | max length 64 | — |
| `automation.workflow.Option 1.steps.Option 11.thread.Option 2` | `object` | No | — | — |
| `automation.workflow.Option 1.steps.Option 11.thread.Option 2.source` | `string` | Yes | constant "thread" | — |
| `automation.workflow.Option 1.steps.Option 11.thread.Option 2.threadId` | `string` | Yes | max length 200 | — |
| `automation.workflow.Option 1.steps.Option 11.timeoutMs` | `integer` | Yes | min 60000, max 2592000000 | — |
| `automation.workflow.Option 1.steps.Option 11.completed` | `string[]` | Yes | max 50 items | — |
| `automation.workflow.Option 1.steps.Option 11.completed.[item]` | `string` | No | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `automation.workflow.Option 1.steps.Option 11.timedOut` | `string[]` | Yes | max 50 items | — |
| `automation.workflow.Option 1.steps.Option 11.timedOut.[item]` | `string` | No | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `automation.workflow.Option 1.steps.Option 12` | `object` | No | — | — |
| `automation.workflow.Option 1.steps.Option 12.id` | `string` | Yes | pattern ^[a-zA-Z][a-zA-Z0-9_-]{0,63}$ | — |
| `automation.workflow.Option 1.steps.Option 12.name` | `string` | Yes | max length 120 | — |
| `automation.workflow.Option 1.steps.Option 12.type` | `string` | Yes | constant "exit" | — |
| `automation.workflow.Option 2` | `null` | No | — | — |
| `automation.conditions` | `object \| null` | No | — | — |
| `automation.conditions.Option 1` | `object` | No | — | — |
| `automation.conditions.Option 1.match` | `string` | Yes | all · any | — |
| `automation.conditions.Option 1.rules` | `object[]` | Yes | max 20 items | — |
| `automation.conditions.Option 1.rules.field` | `string` | Yes | min length 1, max length 200, pattern ^[a-zA-Z0-9_-]+(?:\.[a-zA-Z0-9_-]+)*$ | — |
| `automation.conditions.Option 1.rules.operator` | `string` | Yes | equals · not_equals · contains · not_contains · starts_with · ends_with · exists · not_exists · greater_than · less_than | — |
| `automation.conditions.Option 1.rules.value` | `string` | Yes | max length 2000 | — |
| `automation.conditions.Option 2` | `null` | No | — | — |
| `automation.eventKind` | `string \| null` | No | — | — |
| `automation.eventKind.Option 1` | `string` | No | github.pull_request.opened · github.pull_request.closed · github.pull_request.updated · github.pull_request.merged · github.pull_request.changes_requested · github.check_run.failed · sentry.issue · linear.issue.created · linear.issue.status_changed · linear.issue.label_added · slack.reaction.added · slack.message.posted · sazabi.issue.triggered · sazabi.issue.resolved · hoplite.thread.finished | — |
| `automation.eventKind.Option 2` | `null` | No | — | — |
| `automation.sentryBindingId` | `string \| null` | No | — | — |
| `automation.sentryTriggerPolicy` | `object \| null` | No | — | — |
| `automation.sentryTriggerPolicy.Option 1` | `object` | No | — | — |
| `automation.sentryTriggerPolicy.Option 1.newIssues` | `boolean` | No | — | — |
| `automation.sentryTriggerPolicy.Option 1.regressions` | `boolean` | No | — | — |
| `automation.sentryTriggerPolicy.Option 1.levels` | `string[]` | No | — | — |
| `automation.sentryTriggerPolicy.Option 1.levels.[item]` | `string` | No | fatal · error · warning · info · debug | — |
| `automation.sentryTriggerPolicy.Option 2` | `null` | No | — | — |
| `automation.targetThreadId` | `string \| null` | No | — | — |
| `automation.isDraft` | `boolean` | No | — | — |
| `automation.id` | `string` | Yes | — | — |
| `automation.projectId` | `string` | Yes | — | — |
| `automation.repoFullName` | `string \| null` | No | — | — |
| `automation.name` | `string` | Yes | — | — |
| `automation.enabled` | `boolean` | Yes | — | — |
| `automation.triggerKind` | `string` | Yes | webhook · schedule | — |
| `automation.schedule` | `object \| null` | No | — | — |
| `automation.schedule.Option 1` | `object` | No | — | — |
| `automation.schedule.Option 1.Option 1` | `object` | No | — | — |
| `automation.schedule.Option 1.Option 1.mode` | `string` | Yes | constant "cron" | — |
| `automation.schedule.Option 1.Option 1.expression` | `string` | Yes | max length 1000 | — |
| `automation.schedule.Option 1.Option 1.timezone` | `string` | Yes | max length 200 | — |
| `automation.schedule.Option 1.Option 2` | `object` | No | — | — |
| `automation.schedule.Option 1.Option 2.mode` | `string` | Yes | constant "interval" | — |
| `automation.schedule.Option 1.Option 2.intervalMs` | `number` | Yes | — | — |
| `automation.schedule.Option 2` | `null` | No | — | — |
| `automation.prompt` | `string` | Yes | — | — |
| `automation.title` | `string \| null` | No | — | — |
| `automation.maxSpendPerThreadMicros` | `integer \| null` | No | — | — |
| `automation.maxSpendPerThreadMicros.Option 1` | `integer` | No | max 9007199254740991 | — |
| `automation.maxSpendPerThreadMicros.Option 2` | `null` | No | — | — |
| `automation.webhookTokenPrefix` | `string \| null` | No | — | — |
| `automation.nextRunAt` | `string \| null` | No | — | — |
| `automation.lastRunAt` | `string \| null` | No | — | — |
| `automation.createdAt` | `string` | No | — | — |
| `automation.updatedAt` | `string` | No | — | — |

```json

```

## Response headers

| Header | Type | Statuses | Description |

| --- | --- | --- | --- |

| `RateLimit` | `string` | `200`, `400`, `401`, `402`, `403`, `404`, `409`, `410`, `429`, `500`, `501`, `503` | Current ingress policy, remaining requests, and seconds until reset, for example `"ingress";r=599;t=60`. |

| `RateLimit-Policy` | `string` | `200`, `400`, `401`, `402`, `403`, `404`, `409`, `410`, `429`, `500`, `501`, `503` | Ingress quota and window, for example `"ingress";q=600;qu="requests";w=60`. |

| `X-RateLimit-Limit` | `integer` | `200`, `400`, `401`, `402`, `403`, `404`, `409`, `410`, `429`, `500`, `501`, `503` | Maximum requests allowed in the current rolling window. |

| `X-RateLimit-Remaining` | `integer` | `200`, `400`, `401`, `402`, `403`, `404`, `409`, `410`, `429`, `500`, `501`, `503` | Requests remaining in the current rolling window. |

| `X-RateLimit-Reset` | `integer` | `200`, `400`, `401`, `402`, `403`, `404`, `409`, `410`, `429`, `500`, `501`, `503` | Unix timestamp when the current rolling window resets. |

| `x-request-id` | `string` | `200`, `400`, `401`, `402`, `403`, `404`, `409`, `410`, `429`, `500`, `501`, `503` | Request correlation ID. |

| `Retry-After` | `integer` | `429`, `503` | Seconds until another request should be attempted. |

| `X-Retry-After` | `integer` | `429`, `503` | Legacy retry delay in seconds. |

## Status codes

- `200` — Successful response

- `400` — Invalid request. Validation responses include field paths.

- `401` — The API key is missing, invalid, or lacks the operation's permission.

- `402` — The organization does not have access to the requested product capability.

- `403` — The key's current user no longer has the required organization membership or role.

- `404` — The resource is not available in the authenticated scope.

- `409` — The request conflicts with a retry receipt or current resource state.

- `410` — The event cursor has expired; capture a fresh head and resource snapshot.

- `429` — The API-key rate limit has been exceeded.

- `500` — The API encountered an unexpected failure.

- `501` — The deployment has not configured the requested capability.

- `503` — A required API dependency, including the rate limiter, is unavailable.