Management API
Server-side endpoints for reading event schedules and syncing custom activity definitions, translations and PDF documents.
Early access. Use the API base, channel key and allowed origins supplied by Buchung before running examples. Interactive API requests are disabled here.
Advanced backend integration
Use these twenty-two /management operations from a trusted backend to read event schedules or sync custom activity data and PDFs. Operators can manage these resources in the Buchung dashboard.
Authentication
Send a server-side integration token issued by Buchung on request:
Authorization: Bearer bg_it_<32 lowercase hex characters>An integration token acts as the integration itself, not as a staff member. It is bound to one operator and a fixed list of capabilities, and it carries no access to participant or booker data.
Never place bg_it_ credentials in browser code, public config or logs, and always authorize callers in your own backend. Storefront keys (bg_st_) never authorize management operations, and management tokens never authorize checkout handoffs.
Management endpoints do not use the Buchung-Locale header; translations are addressed explicitly with ?locale=.
- Definition and value reads require
activities:read; writes requireactivities:write. - Event reads require
events:readand use the operator assigned to the credential. - PDF upload prepare/finalize/create/replace require
media:upload; status/list/get requiremedia:read; rename/publish/unpublish/delete requiremedia:write. - Invalid, revoked or ungranted credentials return
401 unauthorized; missing scopes return403 forbidden; foreign or unknown IDs return404 not_found.
Events
GET /v1/management/eventslists events visible in the operator's dashboard event list. An event matches when it overlaps the inclusivefromandtocalendar dates (YYYY-MM-DD, years 1900 to 9998) in the operator's time zone.fromdefaults to today, so the list includes events that ended earlier today. Omittofor an open end. The window computes the day aftertoas its exclusive upper bound, which must remain a representable four-digit-year instant. Usequeryto search for keywords in the internal title and handle. The 80-character limit bounds input to the full-text search.GET /v1/management/events/{eventId}returns one event with up to 100 current availabilities. Each availability includes its ID, activity, variation, start and end. CheckavailabilitiesTruncatedfor larger events. Missing, deleted, hidden and foreign events return404 not_found.
Both responses include timeZone and evaluatedAt, the instant used to evaluate event timing and the default list date. Timestamps include the operator's UTC offset at each instant. Event reads carry no registration or occupancy data. Registration reads are unavailable to integration tokens, because those tokens carry no access to personal data.
List responses contain items, nextCursor and totalCount, the exact number of matches in that request’s snapshot, including when the page is empty. The default limit is 20 and the maximum is 100. Repeat the same filters and limit with cursor=nextCursor until nextCursor is null. The cursor preserves a defaulted from across midnight. Each request takes a fresh snapshot, so totals can change. If a cursor returns 400 validation_failed, restart from the first page. If you pass only a past to, include an explicit from or use a later to. A database statement timeout on the list endpoint returns retryable 503 count_timeout.
Custom definitions and value types
Each operator may have up to 200 active (non-retired) definitions. Keys match ^[a-z][a-z0-9-]{1,63}$ and cannot be reused after retirement. Labels map explicit supported locale keys (case-insensitive) to strings up to 120 characters. Choice definitions also accept optionLabels.
| Type | Value and limits | Definition constraints |
|---|---|---|
text | Trimmed plain string (never rendered as HTML) | maxLength 1–4000 (default 1000) |
text_list | String array (max 500 chars per item); replaces the whole list per locale | maxItems 1–50 (default 20) |
boolean | Strict JSON boolean (absence differs from false) | {} |
number | Finite JSON number with absolute value at most 1e15, no rounding | Optional integer, min, max, precision (0–6) |
choice | Declared option key (^[a-z0-9][a-z0-9_-]{0,63}$) | options array ([{ key }]), max 100 |
json | Any valid JSON including null (max 16 KiB UTF-8, depth 16, 5000 nodes) | {} |
pdf | { documentId } referencing a live catalogue PDF OperatorDocument of the same operator | {} |
Only text, text_list, json and pdf may set localized: true. Type and localization are immutable after creation; updates may widen constraints or edit labels, never narrow constraints or remove in-use choice keys.
Example POST /management/custom-definitions body (creates an initially unexposed localized text definition):
{
"key": "packing-note",
"type": "text",
"localized": true,
"constraints": { "maxLength": 1000 },
"labels": { "en": "Packing note", "nl": "Pakadvies" }
}GET /management/custom-definitions returns all active definitions (add ?includeRetired=true to also include up to 500 recently retired definitions) with valueCount.
Translations and optimistic concurrency (expectedRevision)
GET /management/activities/{id}/custom-values returns every stored translation with its revision and no fallback (locale: null for invariant values). For localized definitions, PUT and DELETE require ?locale=<code>; for invariant definitions, omit locale. Unsupported locales return 400 validation_failed.
Example PUT /management/activities/{id}/custom-values/{definitionId}?locale=en:
{
"value": "Bring a waterproof jacket.",
"expectedRevision": null
}Pass expectedRevision: null when creating a new value, or the stored integer revision when updating or deleting (for DELETE, send expectedRevision in the JSON body). Revisions increase monotonically (gaps are normal; compare for equality only). A stale write returns 409 revision_conflict with details.currentRevision (nullable) and optional currentValue:
{
"error": {
"code": "revision_conflict",
"message": "The value is currently absent",
"doc_url": "https://api.buchungapp.com/v1/docs#errors/revision_conflict",
"request_id": "example-management-conflict",
"details": { "currentRevision": null }
}
}Reconcile against currentRevision / currentValue before retrying.
Exposing and retiring definitions
New definitions start private (exposed: false). Call POST /management/custom-definitions/{id}/exposure with { exposed, expectedRevision } to toggle public projection in Activity.customFacts. Enabling exposure publishes existing valid values on published/unlisted activities and returns affectedValueCount.
Call POST /management/custom-definitions/{id}/retire with { expectedRevision } to block new writes and stop public projection while retaining stored values for management reads (and cleanup deletes).
On public reads, localized text, text_list and json values fall back from requested locale to operator default; localized pdf values require an exact locale match.
Publishing PDF documents
A PDF is an operator-level OperatorDocument with a stable documentId, displayName, validated file, revision, published flag and referenceCount. PDF preparation, creation and publication must be enabled for the operator (otherwise they return 403 forbidden; unpublishing is always allowed). Only catalogue-PDF documents appear in /management/documents.
- Prepare:
POST /management/documents/uploadswithfileName,byteSize(1 to 20,971,520) andmimeType: "application/pdf"(optionalactivityIdis attribution only). ReturnsuploadSessionId, signeduploadUrl(do not log) andexpiresAt. - Upload and finalize: upload bytes to
uploadUrl, then callPOST /management/documents/uploads/{id}/finalize(pollGET /management/documents/uploads/{id}as needed).status: "ready"returnsmediaId; structural validation failures return200withstatus: "failed"andreason. - Create:
POST /management/documentswithcandidateMediaIdanddisplayNameto mint the unpublishedOperatorDocument. - Publish:
POST /management/documents/{documentId}/publishwithexpectedRevision. Itsurlresolves through the storefront's document route (302to a short-lived signed URL). - Reference: assign
{ "documentId": "..." }to apdfcustom definition viaPUT /management/activities/{id}/custom-values/{definitionId}(with?locale=if localized). - Replace, rename, unpublish or delete:
POST /management/documents/{documentId}/fileswaps in a new ready candidate while keeping all links intact.PATCHrenames.POST .../unpublishhides the file on the next request (already-downloaded copies cannot be recalled).DELETE(withexpectedRevisionin the JSON body) requiresreferenceCount === 0; if references remain (including on archived activities or event attachments), it returns409 document_referencedwithreferenceCountand up to 50 deletable custom-value slots inreferences({ activityId, handle, archived, definitionId, key, locale, revision }). Delete those values viaDELETE /management/activities/{activityId}/custom-values/{definitionId}(usingexpectedRevisionand?locale=when non-null; works for retired definitions and archived activities) and detach any event attachments in the dashboard before retrying deletion.
Example createDocument body:
{
"candidateMediaId": "22222222-2222-4222-8222-222222222222",
"displayName": "Trip notes"
}Example prepareDocument body:
{
"activityId": "11111111-1111-4111-8111-111111111111",
"fileName": "trip-notes-en.pdf",
"byteSize": 48213,
"mimeType": "application/pdf"
}Example putValue body for a pdf definition:
{
"value": { "documentId": "33333333-3333-4333-8333-333333333333" },
"expectedRevision": null
}Errors and limits
- Request bodies: capped at 64 KiB across all methods with a body, including
DELETE(413 payload_too_large). PDF uploads allow up to 20 MiB. - Per-activity custom-value budget: 64 KiB serialized cumulative values at write time (
400 validation_failed); storefront list pages enforce a 4 MiB custom-fact read budget. - Upload validation: upload endpoints return
422 validation_failedfor ineligible requests;putValuereturns400 validation_failedfor an unusabledocumentId. - Rate limits: 600 reads/minute and 300 writes/minute per machine across its credentials (
429 rate_limited). During a limiter outage, writes fail closed with503 service_unavailable(Retry-After: 30). Writes are not idempotent in general; inspect current state before retrying uncertain outcomes.