playbooks
8 operations. Shapes are sketches of the declared schemas, bounded in depth — the authoritative document is linked from the index.
GET/orgs/{orgSlug}/playbooks
Requires bearerAuth
The organization’s playbooks: typed runbooks proposed by agents and published by a person. A project-scoped playbook is listed only for a caller who can reach its project; an empty proposal is never listed.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
orgSlugrequired | path | string | min length 1, max length 64 |
state | query | "proposed" | "published" | "archived" | one of "proposed" | "published" | "archived" |
project | query | string | min length 1, max length 64 |
limit | query | integer | default 25, min 1, max 50 |
Response 200
{
playbooks: {
slug: string
title: string
state: string
project: string | null
revision: integer
publishedRevision: integer | null
stepCount: integer
leverSteps: integer
families: string[]
updatedAt: string
}[]
matching: integer
dropped: integer
}Response 400 · `bad_request` — the path, query or body failed validation. `details` carries the Zod issues, one per offending field.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 401 · `unauthorized` — no credential, or one that is expired, revoked or not valid for this resource. `mfa_required` when the credential is good but a second factor is owed.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 403 · `forbidden` — the credential is valid and its scopes or this principal’s membership do not reach this resource. Scopes are re-intersected with live memberships on every request, so this can appear for a token that worked yesterday.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 404 · `not_found` — no such resource, OR one this principal cannot see. The two are deliberately one answer: a 403 would confirm the existence of something whose identifier is guessable.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 429 · `rate_limited` or `quota_exceeded` — over a ceiling. `Retry-After` says when to come back, and `x-ratelimit-limit` / `-remaining` / `-reset` describe the bucket.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 500 · `internal_error` — an unhandled failure on this side. The message is always generic; `requestId` is the part worth quoting.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Request
curl https://api.bucker.io/orgs/{orgSlug}/playbooks \
-H "authorization: Bearer $BUCKER_TOKEN"POST/orgs/{orgSlug}/playbooks
Requires bearerAuth
Propose a draft version of a playbook through the governed operation engine. Every draft, the first and every further one, is playbook.propose under the registry’s ask floor; a proposal is ALWAYS asked for: it answers 202 with an approval request, and the same body with approvalRequestId applies the approved plan once. A draft never runs: a person publishes it by digest on its own route. A definition that names an unregistered family, an act a person must perform, a loop or more than 40 steps is refused before anything is written.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
orgSlugrequired | path | string | min length 1, max length 64 |
Request body (required) · application/json
{
slug: string
title: string
project?: string
definition: {
v: 1
essential?: boolean
inputs?: {
name: string
type: "string" | "number" | "boolean"
required: boolean
}[]
steps: {
id: string
kind: "query"
specDigest: string
next: "end" | string
} | {
id: string
kind: "governed_action"
family: string
verb: string
input?: object
next: "end" | string
} | {
id: string
kind: "approval"
approverRelation: string
quorum: 1 | 2
expiresInMinutes: integer
onApproved: "end" | string
onRejected: "end" | string
onExpired: "end" | string
} | {
id: string
kind: "wait"
minutes: integer
next: "end" | string
} | {
id: string
kind: "branch"
on: object
onTrue: "end" | string
onFalse: "end" | string
} | {
id: string
kind: "notify"
channel: "inbox" | "slack"
route?: string
next: "end" | string
} | … 2 more[]
limits?: {
maxRunsPerDay: integer
runTimeoutMinutes: integer
}
runbook?: {
text: string
ownerTeam: string
reviewBy: string (date)
expiresAt: string (date)
}
}
reason: string
approvalRequestId?: string
}Response 200
{
status: "applied" | "approval_required" | "inert_draft"
operation: {
id: string
action: string
state: string
planDigest: string
targetVersionBefore: string
targetVersionAfter: string | null
riskClass: string
}
riskClass: string
plan: Record<string, unknown>
slug: string
decision?: "ALLOW" | "APPROVED"
versionAfter?: string
receiptSigned?: boolean
approvalRequestId?: string | null
decisionUrl?: string
refusal?: {
code: string
message: string
} | null
eligibleApprovers?: integer
minApprovers?: integer
}Response 202
{
status: "applied" | "approval_required" | "inert_draft"
operation: {
id: string
action: string
state: string
planDigest: string
targetVersionBefore: string
targetVersionAfter: string | null
riskClass: string
}
riskClass: string
plan: Record<string, unknown>
slug: string
decision?: "ALLOW" | "APPROVED"
versionAfter?: string
receiptSigned?: boolean
approvalRequestId?: string | null
decisionUrl?: string
refusal?: {
code: string
message: string
} | null
eligibleApprovers?: integer
minApprovers?: integer
}Response 400 · `bad_request` — the path, query or body failed validation. `details` carries the Zod issues, one per offending field.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 401 · `unauthorized` — no credential, or one that is expired, revoked or not valid for this resource. `mfa_required` when the credential is good but a second factor is owed.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 403 · `forbidden` — the credential is valid and its scopes or this principal’s membership do not reach this resource. Scopes are re-intersected with live memberships on every request, so this can appear for a token that worked yesterday.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 404 · `not_found` — no such resource, OR one this principal cannot see. The two are deliberately one answer: a 403 would confirm the existence of something whose identifier is guessable.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 429 · `rate_limited` or `quota_exceeded` — over a ceiling. `Retry-After` says when to come back, and `x-ratelimit-limit` / `-remaining` / `-reset` describe the bucket.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 500 · `internal_error` — an unhandled failure on this side. The message is always generic; `requestId` is the part worth quoting.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Request
curl -X POST https://api.bucker.io/orgs/{orgSlug}/playbooks \
-H "authorization: Bearer $BUCKER_TOKEN" \
-H 'content-type: application/json' \
-d '{ … }'GET/orgs/{orgSlug}/playbooks/{slug}
Requires bearerAuth
One playbook: its version history with each digest, the definition of the published (else newest) version or of `?revision`, and which families and acts each step touches, read from the registry as it is now. The title, the runbook and the literal step inputs are untrusted text.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
orgSlugrequired | path | string | min length 1, max length 64 |
slugrequired | path | string | min length 1, max length 64 |
revision | query | integer | min 1 |
Response 200
{
slug: string
title: string
state: string
project: string | null
revision: integer
publishedRevision: integer | null
createdAt: string
updatedAt: string
versions: {
revision: integer
digest: string
published: boolean
publishedAt: string | null
current: boolean
stepCount: integer
createdAt: string
}[]
definitionRevision: integer
definitionDigest: string
definition: Record<string, unknown> | null
touches: Record<string, unknown>[]
families: string[]
validity: {
ok: boolean
issues: Record<string, unknown>[]
}
}Response 400 · `bad_request` — the path, query or body failed validation. `details` carries the Zod issues, one per offending field.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 401 · `unauthorized` — no credential, or one that is expired, revoked or not valid for this resource. `mfa_required` when the credential is good but a second factor is owed.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 403 · `forbidden` — the credential is valid and its scopes or this principal’s membership do not reach this resource. Scopes are re-intersected with live memberships on every request, so this can appear for a token that worked yesterday.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 404 · `not_found` — no such resource, OR one this principal cannot see. The two are deliberately one answer: a 403 would confirm the existence of something whose identifier is guessable.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 429 · `rate_limited` or `quota_exceeded` — over a ceiling. `Retry-After` says when to come back, and `x-ratelimit-limit` / `-remaining` / `-reset` describe the bucket.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 500 · `internal_error` — an unhandled failure on this side. The message is always generic; `requestId` is the part worth quoting.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Request
curl https://api.bucker.io/orgs/{orgSlug}/playbooks/{slug} \
-H "authorization: Bearer $BUCKER_TOKEN"POST/orgs/{orgSlug}/playbooks/{slug}/change
Requires bearerAuth
Retract the newest unpublished draft, archive a playbook or restore an archived one, through the governed operation engine. The act (playbook.update for a retraction or a restore, playbook.archive) is derived from what would change. Publishing is a person’s act on its own route.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
orgSlugrequired | path | string | min length 1, max length 64 |
slugrequired | path | string | min length 1, max length 64 |
Request body (required) · application/json
{
retract?: {
revision: integer
}
archive?: true
restore?: true
reason: string
approvalRequestId?: string
}Response 200
{
status: "applied" | "approval_required" | "inert_draft"
operation: {
id: string
action: string
state: string
planDigest: string
targetVersionBefore: string
targetVersionAfter: string | null
riskClass: string
}
riskClass: string
plan: Record<string, unknown>
slug: string
decision?: "ALLOW" | "APPROVED"
versionAfter?: string
receiptSigned?: boolean
approvalRequestId?: string | null
decisionUrl?: string
refusal?: {
code: string
message: string
} | null
eligibleApprovers?: integer
minApprovers?: integer
}Response 202
{
status: "applied" | "approval_required" | "inert_draft"
operation: {
id: string
action: string
state: string
planDigest: string
targetVersionBefore: string
targetVersionAfter: string | null
riskClass: string
}
riskClass: string
plan: Record<string, unknown>
slug: string
decision?: "ALLOW" | "APPROVED"
versionAfter?: string
receiptSigned?: boolean
approvalRequestId?: string | null
decisionUrl?: string
refusal?: {
code: string
message: string
} | null
eligibleApprovers?: integer
minApprovers?: integer
}Response 400 · `bad_request` — the path, query or body failed validation. `details` carries the Zod issues, one per offending field.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 401 · `unauthorized` — no credential, or one that is expired, revoked or not valid for this resource. `mfa_required` when the credential is good but a second factor is owed.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 403 · `forbidden` — the credential is valid and its scopes or this principal’s membership do not reach this resource. Scopes are re-intersected with live memberships on every request, so this can appear for a token that worked yesterday.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 404 · `not_found` — no such resource, OR one this principal cannot see. The two are deliberately one answer: a 403 would confirm the existence of something whose identifier is guessable.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 429 · `rate_limited` or `quota_exceeded` — over a ceiling. `Retry-After` says when to come back, and `x-ratelimit-limit` / `-remaining` / `-reset` describe the bucket.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 500 · `internal_error` — an unhandled failure on this side. The message is always generic; `requestId` is the part worth quoting.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Request
curl -X POST https://api.bucker.io/orgs/{orgSlug}/playbooks/{slug}/change \
-H "authorization: Bearer $BUCKER_TOKEN" \
-H 'content-type: application/json' \
-d '{ … }'POST/orgs/{orgSlug}/playbooks/{slug}/preview
Requires bearerAuth
What starting a run of the published version would do, step by step, without writing anything: for each governed step the family, the act, the class, whether it will stop for a person, whether it has an inverse and the blast radius its family measures. A separate read, never a flag on the run. A step whose target comes from an earlier step is reported as resolved at run time. Target names, literal step inputs and the title are untrusted text.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
orgSlugrequired | path | string | min length 1, max length 64 |
slugrequired | path | string | min length 1, max length 64 |
Request body (required) · application/json
{
versionDigest?: string
inputs?: Record<string, string | number | boolean>
}Response 200
{
playbook: {
slug: string
title: string
state: string
project: string | null
}
version: {
revision: integer
digest: string
}
run: {
action: "playbook.run"
registryClass: string | null
stepsPlanned: integer
leverSteps: integer
stepHasInverse: boolean
limits: {
maxRunsPerDay: integer
runTimeoutMinutes: integer
}
runsLast24h: integer
wouldStart: boolean
refusals: string[]
inputProblems: {
name: string
code: string
message: string
}[]
}
steps: Record<string, unknown>[]
}Response 400 · `bad_request` — the path, query or body failed validation. `details` carries the Zod issues, one per offending field.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 401 · `unauthorized` — no credential, or one that is expired, revoked or not valid for this resource. `mfa_required` when the credential is good but a second factor is owed.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 403 · `forbidden` — the credential is valid and its scopes or this principal’s membership do not reach this resource. Scopes are re-intersected with live memberships on every request, so this can appear for a token that worked yesterday.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 404 · `not_found` — no such resource, OR one this principal cannot see. The two are deliberately one answer: a 403 would confirm the existence of something whose identifier is guessable.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 429 · `rate_limited` or `quota_exceeded` — over a ceiling. `Retry-After` says when to come back, and `x-ratelimit-limit` / `-remaining` / `-reset` describe the bucket.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 500 · `internal_error` — an unhandled failure on this side. The message is always generic; `requestId` is the part worth quoting.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Request
curl -X POST https://api.bucker.io/orgs/{orgSlug}/playbooks/{slug}/preview \
-H "authorization: Bearer $BUCKER_TOKEN" \
-H 'content-type: application/json' \
-d '{ … }'POST/orgs/{orgSlug}/playbooks/{slug}/publish
Requires bearerAuth
Publish one version of a playbook, by its digest. Human-only and org:admin, behind the password step-up: no agent, OAuth client or delegated credential reaches it, and no governed operation can perform it. The body names the version and the digest the person read; a different stored digest, or a definition that no longer satisfies the grammar, is refused. Only a published digest can run.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
orgSlugrequired | path | string | min length 1, max length 64 |
slugrequired | path | string | min length 1, max length 64 |
Request body (required) · application/json
{
revision: integer
digest: string
password?: string
}Response 200
{
slug: string
revision: integer
digest: string
state: "published"
publishedAt: string
previousRevision: integer | null
previousDigest: string | null
version: string
}Response 400 · `bad_request` — the path, query or body failed validation. `details` carries the Zod issues, one per offending field.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 401 · `unauthorized` — no credential, or one that is expired, revoked or not valid for this resource. `mfa_required` when the credential is good but a second factor is owed.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 403 · `forbidden` — the credential is valid and its scopes or this principal’s membership do not reach this resource. Scopes are re-intersected with live memberships on every request, so this can appear for a token that worked yesterday.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 404 · `not_found` — no such resource, OR one this principal cannot see. The two are deliberately one answer: a 403 would confirm the existence of something whose identifier is guessable.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 429 · `rate_limited` or `quota_exceeded` — over a ceiling. `Retry-After` says when to come back, and `x-ratelimit-limit` / `-remaining` / `-reset` describe the bucket.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 500 · `internal_error` — an unhandled failure on this side. The message is always generic; `requestId` is the part worth quoting.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Request
curl -X POST https://api.bucker.io/orgs/{orgSlug}/playbooks/{slug}/publish \
-H "authorization: Bearer $BUCKER_TOKEN" \
-H 'content-type: application/json' \
-d '{ … }'GET/orgs/{orgSlug}/playbooks/{slug}/runs
Requires bearerAuth
The most recent runs of one playbook, newest first, each with its steps and receipt.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
orgSlugrequired | path | string | min length 1, max length 64 |
slugrequired | path | string | min length 1, max length 64 |
limit | query | integer | default 20, min 1, max 50 |
Response 200
{
runs: {
id: string
playbook: string
state: string
versionDigest: string
trigger: string
startedAt: string
finishedAt: string | null
inputs: Record<string, string | number | boolean>
steps: Record<string, unknown>[]
receipt: {
operationIds: string[]
approvalRequestIds: string[]
applied: integer
failedStep: string | null
}
}[]
}Response 400 · `bad_request` — the path, query or body failed validation. `details` carries the Zod issues, one per offending field.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 401 · `unauthorized` — no credential, or one that is expired, revoked or not valid for this resource. `mfa_required` when the credential is good but a second factor is owed.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 403 · `forbidden` — the credential is valid and its scopes or this principal’s membership do not reach this resource. Scopes are re-intersected with live memberships on every request, so this can appear for a token that worked yesterday.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 404 · `not_found` — no such resource, OR one this principal cannot see. The two are deliberately one answer: a 403 would confirm the existence of something whose identifier is guessable.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 429 · `rate_limited` or `quota_exceeded` — over a ceiling. `Retry-After` says when to come back, and `x-ratelimit-limit` / `-remaining` / `-reset` describe the bucket.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 500 · `internal_error` — an unhandled failure on this side. The message is always generic; `requestId` is the part worth quoting.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Request
curl https://api.bucker.io/orgs/{orgSlug}/playbooks/{slug}/runs \
-H "authorization: Bearer $BUCKER_TOKEN"POST/orgs/{orgSlug}/playbooks/{slug}/runs
Requires bearerAuth
Start a run of a PUBLISHED version of a playbook, by its digest, through the governed operation engine. `playbook.run` asks a person by default and always asks when the playbook carries a mitigation lever: the first call answers 202 with an approval request, and the same body with approvalRequestId starts the run once, bound to that digest. Each step of the run is then decided by the same engine for the same principal, with its own freezes, switches, floors and approvals; a human-only act is refused at run time and merging is never a step.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
orgSlugrequired | path | string | min length 1, max length 64 |
slugrequired | path | string | min length 1, max length 64 |
Request body (required) · application/json
{
versionDigest: string
inputs?: Record<string, string | number | boolean>
reason: string
approvalRequestId?: string
}Response 200
{
status: "started" | "approval_required" | "inert_draft"
operation: {
id: string
action: string
state: string
planDigest: string
riskClass: string
}
riskClass: string
plan: Record<string, unknown>
run: {
id: string
playbook: string
state: string
versionDigest: string
trigger: string
startedAt: string
finishedAt: string | null
inputs: Record<string, string | number | boolean>
steps: Record<string, unknown>[]
receipt: {
operationIds: string[]
approvalRequestIds: string[]
applied: integer
failedStep: string | null
}
} | null
approvalRequestId?: string | null
decisionUrl?: string
refusal?: {
code: string
message: string
} | null
eligibleApprovers?: integer
minApprovers?: integer
}Response 202
{
status: "started" | "approval_required" | "inert_draft"
operation: {
id: string
action: string
state: string
planDigest: string
riskClass: string
}
riskClass: string
plan: Record<string, unknown>
run: {
id: string
playbook: string
state: string
versionDigest: string
trigger: string
startedAt: string
finishedAt: string | null
inputs: Record<string, string | number | boolean>
steps: Record<string, unknown>[]
receipt: {
operationIds: string[]
approvalRequestIds: string[]
applied: integer
failedStep: string | null
}
} | null
approvalRequestId?: string | null
decisionUrl?: string
refusal?: {
code: string
message: string
} | null
eligibleApprovers?: integer
minApprovers?: integer
}Response 400 · `bad_request` — the path, query or body failed validation. `details` carries the Zod issues, one per offending field.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 401 · `unauthorized` — no credential, or one that is expired, revoked or not valid for this resource. `mfa_required` when the credential is good but a second factor is owed.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 403 · `forbidden` — the credential is valid and its scopes or this principal’s membership do not reach this resource. Scopes are re-intersected with live memberships on every request, so this can appear for a token that worked yesterday.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 404 · `not_found` — no such resource, OR one this principal cannot see. The two are deliberately one answer: a 403 would confirm the existence of something whose identifier is guessable.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 429 · `rate_limited` or `quota_exceeded` — over a ceiling. `Retry-After` says when to come back, and `x-ratelimit-limit` / `-remaining` / `-reset` describe the bucket.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Response 500 · `internal_error` — an unhandled failure on this side. The message is always generic; `requestId` is the part worth quoting.
{
error: {
code: "bad_request" | "conflict" | "forbidden" | "internal_error" | "mfa_required" | "not_found" | "payload_too_large" | "quota_exceeded" | … 6 more
message: string
details?: unknown
requestId?: string
}
}Request
curl -X POST https://api.bucker.io/orgs/{orgSlug}/playbooks/{slug}/runs \
-H "authorization: Bearer $BUCKER_TOKEN" \
-H 'content-type: application/json' \
-d '{ … }'