Skip to content
bucker

API reference

instrumentation-patches

4 operations. Shapes are sketches of the declared schemas, bounded in depth — the authoritative document is linked from the index.

GET/orgs/{orgSlug}/projects/{projectSlug}/instrumentation-patches

Requires bearerAuth

The project's instrumentation patches, newest first, with the state each has reached (proposed, approved, opened, merged, verified, reverted, rejected). Each names its recipe, the base commit it was planned against, its diff digest and the finding it answers.

Parameters

Parameters for GET /orgs/{orgSlug}/projects/{projectSlug}/instrumentation-patches
NameInTypeNotes
orgSlugrequiredpathstringmin length 1
projectSlugrequiredpathstringmin length 1
statequery"proposed" | "approved" | "opened" | "merged" | "verified" | "reverted" | "rejected"one of "proposed" | "approved" | "opened" | "merged" | "verified" | "reverted" | "rejected"
recipequerystringmin length 1, max length 40
limitqueryintegerdefault 50, min 1, max 200

Response 200

{
  patches: {
    id: string
    projectId: string
    repo: string
    recipe: string
    recipeVersion: string
    baseSha: string
    diffDigest: string
    findingId: string | null
    approvalId: string | null
    prUrl: string | null
    state: string
    mergedAt: string | null
    verifiedAt: string | null
    revertedAt: string | null
    createdAt: string
    updatedAt: 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 https://api.bucker.io/orgs/{orgSlug}/projects/{projectSlug}/instrumentation-patches \
  -H "authorization: Bearer $BUCKER_TOKEN"

POST/orgs/{orgSlug}/projects/{projectSlug}/instrumentation-patches

Requires bearerAuth

Propose an instrumentation change as a draft pull request. Name a recipe and its typed slots (never code): Bucker renders the diff from the recipe and the repository at its head, validates it (parses, only the recipe's paths, no secret-shaped value, nothing executed) and asks a person to approve the exact plan. On approval it opens ONE DRAFT pull request; a person merges, and Bucker never commits to a default branch. 200 when applied; 202 with an approval request when a person must decide, after which the same body with approvalRequestId applies the approved plan once.

Parameters

Parameters for POST /orgs/{orgSlug}/projects/{projectSlug}/instrumentation-patches
NameInTypeNotes
orgSlugrequiredpathstringmin length 1
projectSlugrequiredpathstringmin length 1

Request body (required) · application/json

{
  recipe: string
  service?: string
  root?: string
  repo?: string
  findingId?: string
  framework?: "node" | "nextjs" | "browser" | "python" | "kubernetes" | "host"
  slots?: Record<string, unknown>
  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>
  decision?: "ALLOW" | "APPROVED"
  versionAfter?: string
  receiptSigned?: boolean
  approvalRequestId?: string | null
  decisionUrl?: string
  refusal?: {
    code: string
    message: string
  } | null
  eligibleApprovers?: integer
  minApprovers?: integer
  patchId?: string | null
  delivery?: {
    status: "opened" | "already_delivered" | "awaiting_approval" | "failed"
    patchId: string | null
    number: integer | null
    url: string | null
    branch: string | null
    base: string | null
    files: string[]
    reason: string | null
    merged: false
    draft: true
  }
}

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>
  decision?: "ALLOW" | "APPROVED"
  versionAfter?: string
  receiptSigned?: boolean
  approvalRequestId?: string | null
  decisionUrl?: string
  refusal?: {
    code: string
    message: string
  } | null
  eligibleApprovers?: integer
  minApprovers?: integer
  patchId?: string | null
  delivery?: {
    status: "opened" | "already_delivered" | "awaiting_approval" | "failed"
    patchId: string | null
    number: integer | null
    url: string | null
    branch: string | null
    base: string | null
    files: string[]
    reason: string | null
    merged: false
    draft: true
  }
}

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}/projects/{projectSlug}/instrumentation-patches \
  -H "authorization: Bearer $BUCKER_TOKEN" \
  -H 'content-type: application/json' \
  -d '{ … }'

GET/orgs/{orgSlug}/projects/{projectSlug}/instrumentation-patches/{patchId}

Requires bearerAuth

One instrumentation patch of this project.

Parameters

Parameters for GET /orgs/{orgSlug}/projects/{projectSlug}/instrumentation-patches/{patchId}
NameInTypeNotes
orgSlugrequiredpathstringmin length 1
projectSlugrequiredpathstringmin length 1
patchIdrequiredpathstringmin length 1, max length 64

Response 200

{
  id: string
  projectId: string
  repo: string
  recipe: string
  recipeVersion: string
  baseSha: string
  diffDigest: string
  findingId: string | null
  approvalId: string | null
  prUrl: string | null
  state: string
  mergedAt: string | null
  verifiedAt: string | null
  revertedAt: string | null
  createdAt: string
  updatedAt: 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 https://api.bucker.io/orgs/{orgSlug}/projects/{projectSlug}/instrumentation-patches/{patchId} \
  -H "authorization: Bearer $BUCKER_TOKEN"

POST/orgs/{orgSlug}/projects/{projectSlug}/instrumentation-patches/{patchId}/deliver

Requires bearerAuth

Open the draft pull request of an approved patch whose delivery failed (the provider was down, the repository was not mapped yet). It needs no second approval, opens at most one pull request, never merges, and opens nothing for a patch no person approved.

Parameters

Parameters for POST /orgs/{orgSlug}/projects/{projectSlug}/instrumentation-patches/{patchId}/deliver
NameInTypeNotes
orgSlugrequiredpathstringmin length 1
projectSlugrequiredpathstringmin length 1
patchIdrequiredpathstringmin length 1, max length 64

Response 200

{
  status: "opened" | "already_delivered" | "awaiting_approval" | "failed"
  patchId: string | null
  number: integer | null
  url: string | null
  branch: string | null
  base: string | null
  files: string[]
  reason: string | null
  merged: false
  draft: true
}

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}/projects/{projectSlug}/instrumentation-patches/{patchId}/deliver \
  -H "authorization: Bearer $BUCKER_TOKEN"