Skip to content
bucker

API reference

block-rules

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

GET/orgs/{orgSlug}/projects/{projectSlug}/block-rules

Requires bearerAuth

The project’s block rules, newest first, with mode, whether each is enforcing right now, its end, its would-match count over the last 24 hours, how many it matched in all and the share of what it saw it would match (null is unmeasured). Refused while the block-rules capability is off.

Parameters

Parameters for GET /orgs/{orgSlug}/projects/{projectSlug}/block-rules
NameInTypeNotes
orgSlugrequiredpathstringmin length 1, max length 128
projectSlugrequiredpathstringmin length 1, max length 128

Response 200

{
  rules: {
    id: string
    projectId: string
    target: string
    matcher: {
      kind: "ip"
      cidr: string
    } | {
      kind: "user_agent"
      family: string
    } | {
      kind: "sdk"
      name: string
      version?: string
    } | {
      kind: "dsn_key"
      keyId: string
    } | {
      kind: "content"
      contentClass: "injection" | "instruction_in_error"
    }
    name: string | null
    mode: "monitor" | "enforce"
    enforcing: boolean
    expiresAt: string
    releasedAt: string | null
    createdAt: string
    wouldMatch24h: integer
    matchedTotal: integer
    trafficShare: number | null
  }[]
  limit: integer
  trust: {
    untrustedFields: string[]
    note: 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}/block-rules \
  -H "authorization: Bearer $BUCKER_TOKEN"

POST/orgs/{orgSlug}/projects/{projectSlug}/block-rules/{ruleId}/enable

Requires bearerAuth

A person enables a block rule that has been watching in monitor mode: it refuses what it matches for at most seven days. Human-only, with a reason and a step-up bound to the rule and the reason. Below 20 % of what the rule saw in the last 24 hours it applies at once (200); above it, or unmeasured, it opens a two-approver request (202, step_up_required, with its requestId) and changes nothing yet.

Parameters

Parameters for POST /orgs/{orgSlug}/projects/{projectSlug}/block-rules/{ruleId}/enable
NameInTypeNotes
orgSlugrequiredpathstringmin length 1, max length 128
projectSlugrequiredpathstringmin length 1, max length 128
ruleIdrequiredpathstringmin length 1, max length 64

Request body (required) · application/json

{
  reason: string
  stepUp?: {
    kind: "webauthn"
    nonce: string
    assertion: {
      credentialId: string
      clientDataJSON: string
      authenticatorData: string
      signature: string
    }
  } | {
    kind: "totp"
    code: string
  }
}

Response 200

{
  status: "applied" | "step_up_required" | "held"
  ruleId: string
  wouldMatch24h: integer
  seen24h: integer
  volume24h: integer
  trafficShare: number | null
  line: "below" | "above"
  expiresAt: string | null
  operationId: string | null
  requestId: string | null
  holdUntil: string | null
}

Response 202

{
  status: "applied" | "step_up_required" | "held"
  ruleId: string
  wouldMatch24h: integer
  seen24h: integer
  volume24h: integer
  trafficShare: number | null
  line: "below" | "above"
  expiresAt: string | null
  operationId: string | null
  requestId: string | null
  holdUntil: 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 -X POST https://api.bucker.io/orgs/{orgSlug}/projects/{projectSlug}/block-rules/{ruleId}/enable \
  -H "authorization: Bearer $BUCKER_TOKEN" \
  -H 'content-type: application/json' \
  -d '{ … }'

POST/orgs/{orgSlug}/projects/{projectSlug}/block-rules/{ruleId}/enable/challenge

Requires bearerAuth

The step-up challenge a person signs to enable this block rule with this reason: bound to the project, the rule and the reason, a few minutes long and single use. Human-only. Refused for a rule that is not in monitor mode.

Parameters

Parameters for POST /orgs/{orgSlug}/projects/{projectSlug}/block-rules/{ruleId}/enable/challenge
NameInTypeNotes
orgSlugrequiredpathstringmin length 1, max length 128
projectSlugrequiredpathstringmin length 1, max length 128
ruleIdrequiredpathstringmin length 1, max length 64

Request body (required) · application/json

{
  reason: string
}

Response 200

{
  requestId: string
  digest: string
  expiresAt: string
  methods: "webauthn" | "totp"[]
  webauthn: {
    challenge: string
    nonce: string
    rpId: string
    timeout: integer
    userVerification: "discouraged"
    allowCredentials: {
      type: "public-key"
      id: string
      transports: string[]
    }[]
  } | null
  enrolUrl: 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}/projects/{projectSlug}/block-rules/{ruleId}/enable/challenge \
  -H "authorization: Bearer $BUCKER_TOKEN" \
  -H 'content-type: application/json' \
  -d '{ … }'