Skip to content
bucker

API reference

change-population

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

GET/orgs/{orgSlug}/change-population/checkpoints

Requires bearerAuth

The organization’s change-population checkpoints, newest first: tree size and root, the consistency proof from the previous checkpoint, the signed receipt, exception counts and coverage per change source. This is the population Bucker observed, not a claim that it is all change; the response says so in `disclosure`. The log spans every project, so a caller who cannot reach all of them is refused.

Parameters

Parameters for GET /orgs/{orgSlug}/change-population/checkpoints
NameInTypeNotes
orgSlugrequiredpathstringmin length 1
limitqueryintegermin 1, max 36
beforequeryintegermin 1

Response 200

{
  data: {
    id: string
    treeSize: integer
    rootHash: string
    checkpointDigest: string
    previousCheckpointDigest: string | null
    createdAt: string
    witnessedAt: string | null
    witnessRef: string | null
    origin: string
    period: {
      start: string
      end: string
    } | null
    sources: {
      source: "deploy" | "flag" | "config" | "mitigation" | "gate_override" | "agent_act"
      leaves: integer
      coverage: "observed" | "partial" | "not_observed"
    }[]
    withoutApproval: integer | null
    emergencyChanges: integer | null
    overrides: integer | null
    witnessKind: "object_store" | "webhook" | "none" | null
    consistencyFromPrevious: {
      oldSize: integer
      oldRoot: string
      newSize: integer
      newRoot: string
      proof: string[]
    } | null
    receipt: {
      seq: integer
      digest: string
      envelope: object
    } | null
  }[]
  nextBefore: integer | null
  head: {
    leaves: integer
    uncheckpointed: integer
    bySource: Record<string, integer>
    coverage: Record<string, "observed" | "partial" | "not_observed">
    disclosure: 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}/change-population/checkpoints \
  -H "authorization: Bearer $BUCKER_TOKEN"

POST/orgs/{orgSlug}/change-population/sample

Requires bearerAuth

Draws an auditor’s sample from one checkpoint’s population by a seeded, reproducible rule (SHA-256 rank over the seed, the checkpoint root and each leaf hash): the same seed draws the same sample. Returns one evidence bundle per sampled change with its inclusion proof, every exception in the population (never filtered; a capped list says so and gives the exact total), and coverage per change source. Writes one audit row.

Parameters

Parameters for POST /orgs/{orgSlug}/change-population/sample
NameInTypeNotes
orgSlugrequiredpathstringmin length 1

Request body (required) · application/json

{
  seed: string
  size?: integer
  treeSize?: integer
  scope?: "period" | "all"
  source?: "deploy" | "flag" | "config" | "mitigation" | "gate_override" | "agent_act"
}

Response 200

{
  algorithm: string
  orgId: string
  origin: string
  seedDigest: string
  seed: string
  requested: integer
  drawn: integer
  exhaustive: boolean
  checkpoint: {
    id: string
    treeSize: integer
    rootHash: string
    checkpointDigest: string
    witnessedAt: string | null
  }
  scope: {
    kind: "period" | "all"
    fromIndex: integer
    toIndex: integer
    source: "deploy" | "flag" | "config" | "mitigation" | "gate_override" | "agent_act" | null
  }
  population: {
    leaves: integer
    bySource: Record<string, integer>
    withoutApproval: integer
    emergency: integer
    overrides: integer
  }
  coverage: Record<string, "observed" | "partial" | "not_observed">
  items: {
    rank: integer
    score: string
    logIndex: integer
    source: "deploy" | "flag" | "config" | "mitigation" | "gate_override" | "agent_act"
    sourceId: string
    leafHash: string
    approvalEvidence: unknown
    testEvidence: unknown
    exceptions: "no_approval" | "emergency" | "override"[]
    inclusionProof: string[]
  }[]
  exceptions: {
    total: integer
    truncated: boolean
    listed: {
      logIndex: integer
      source: "deploy" | "flag" | "config" | "mitigation" | "gate_override" | "agent_act"
      sourceId: string
      leafHash: string
      exceptions: "no_approval" | "emergency" | "override"[]
    }[]
  }
  consistencyFromPrevious: {
    oldSize: integer
    oldRoot: string
    newSize: integer
    newRoot: string
    proof: string[]
  } | null
  disclosure: 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}/change-population/sample \
  -H "authorization: Bearer $BUCKER_TOKEN" \
  -H 'content-type: application/json' \
  -d '{ … }'