Beacon

Authentication and idempotency

View as Markdown

Authentication and idempotency

Authentication contract, scopes, and exactly-once guarantees in Beacon APIs.

reference • updated 2026-03-15

Base headers

HeaderRequiredDescription
Authorization: Bearer <access_token>YesAccess token scoped to organization context
Content-Type: application/jsonYes (POST/PATCH)Payload format
Idempotency-KeyRecommendedDeduplication key for mutable operations

Idempotency rules

  • Same Idempotency-Key + same endpoint + same organization must produce the same logical outcome.
  • Use different keys for distinct operations, even with similar payloads.
  • Persist keys for a defined time window in your operations policy.

Common errors

CodeMeaningAction
401invalid or missing tokenrefresh credentials and retry
403insufficient scopereview organization permissions
409idempotent conflictverify if operation already completed
429throttlingapply retry with backoff

Safe request example

bash
curl -X POST https://api.beacon.pt/v1/billing/subscription-checkouts \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: org-acme-20260315-0001" \
  -d '{"plan":"plus","billing":"monthly"}'