CRADDevelopers
English

Efficient CRAD integration

Open the full guide in English or browse the quick recommendations below.

Before going live — check deployed capabilities, grants and your integration’s readiness.

Check deployed capabilities, key grants and business readiness in your environment. HTTP examples were captured in isolated tests; their local-unreleased provenance neither says the API is offline nor certifies your integration. Customer self-service uses the business-configured WhatsApp authentication template; SMS is not supported. Authorized admin contact recording is a separate action without a code.

Load only what the screen needs

Choose the recommendations that fit your screen. These improvements are optional. Each operation’s contract defines its authorization and booking checks.

The full guide in English as Markdown
  1. Load one page and the required range

    Start with the range the user opened. The customer directory defaults to 50, maximum 100 per page. The Management calendar accepts up to 93 days and defaults to 100, maximum 200 per page. For a detailed history over a chosen interval, filter the calendar to that customer. Continue with the returned cursor and unchanged filters and page size. Restart after a change.

  2. Choose the appointments shown on a customer card

    Fetch recent and upcoming appointments for one customer across authorized calendars in one read. Choose recentLimit and upcomingLimit independently. For a completed treatments screen, add recentStatus=COMPLETED. For a Show more button, request includeRecentCursor=true and use recent.nextCursor on the next read.

  3. Open history on demand

    Load history when the user opens it. The 31-day range and 100-row page limit apply only to the Integration customer booking history route. It returns current states of that integration’s bookings under the customer mapping’s authority. The Management calendar and all-channel history have separate contracts.

  4. Load templates when the picker opens

    Use the campaign catalogue for a campaign and the conversation catalogue for the selected conversation. Refresh the list after a template, sender or integration changes. Choosing and sending are separate steps. Check sending readiness under the operation’s contract.

  5. Share an in-flight read in the same context

    Coalesce overlapping reads for the same authority, business, integration, recipient and request. Start a separate read when the user or recipient changes. Refresh affected reads after data or permission changes, and discard late responses from a previous context. Define a refresh budget for saved display copies.

  6. Keep booking commands authoritative in CRAD

    Preserve the operation’s availability, price, version and authorization checks. A saved display copy does not reserve a time. Keep writes separate. When acceptance is unknown, recover using the original operation ID before making a new attempt.

Keep one booking authority

CRAD owns canonical contacts, service terms and appointments. Your website owns its interface, accounts, photographs and private notes. A local CRAD projection makes permitted data fast to display; it does not reserve capacity or authorize a booking.

For a server integration, keep one CRAD_API_KEY in your backend secret store. Read Management metadata to derive the bound site/integration IDs and inspect scopes, expiry and resource grants; use Integration metadata for the customer integration view. Keep machine credentials out of HTML, browser bundles, URLs and logs. Customer sessions remain separate in-memory browser bearers.

Direct browser self-service is also supported without a machine key: use approved public identifiers and customer phone proof. Add a backend or replication only when the website needs its own accounts, local projections or delegated staff actions. An HTTP integration does not require an iframe, UI package or a second editable customer database.

Request only the permissions your screens use

Installed capabilities, credential scopes, resource grants and current intake/readiness are separate checks. A capability does not widen a key; a calendar grant does not grant directory, catalogue or provider access. Request creation, status, cancellation or rescheduling permissions only if the admin exposes those actions.

Existing keys gain no new scopes automatically. For an eligible existing custom Management key, the owner can open ownerSettings.websiteUrl from current metadata, then Website booking → Developers → Manage connection → Enable continuous display sync. This native owner action adds the missing display-read/sync permissions after explicit review; it preserves the key secret, existing resource boundaries and private-field approvals. It is not a public API for editing scopes, and other permissions still require their separate approval.

Do not choose a broad full-business preset merely to enable synchronization. If the installed owner screen does not offer this targeted approval or the connection is ineligible, have the owner or CRAD operator review the exact missing permissions. Re-read current metadata after any approval or credential change; never infer access from the button or installed capability alone.

Screen or workerExplicit server authority
Customer booking through a backend companionbookings:write:customer; current visitor session and phone proof are still required for customer commits.
Link an authenticated website accountcustomers:write and current same-phone proof; derive externalCustomerId on your authenticated backend.
Local business customer directorycontacts:read and contacts:sync. Approved notes/custom fields require separate field scopes and owner grants.
Local business calendarappointments:read and appointments:sync, plus a current calendar resource grant and a bounded range. Customer basics and appointment notes have separate disclosure permissions.
Local service catalogueservices:read and services:sync. Editing additionally requires services:write.
Local selected providersproviders:read and providers:sync, plus the explicit providerIds grant. Editing additionally requires providers:write.
Monthly operational reportreports:read for the whole business; this is independent of provider/calendar selections.

Load the first booking screen once

Choose and measure your display freshness budget. The prepared HALA implementation refreshes its public catalogue on demand with a maximum 60-second lease; it has no recurring catalogue network timer. Its separate Management worker uses bounded wake-ups and infrequent reconciliation. These are site implementation choices, not CRAD API guarantees or a claim that the rollout is active. Never carry a display lease into quotes, availability, phone proof or command authorization. A client cannot turn a stale capability into permission.

Measure cold and warm treatment display, quote response, selected-day availability and final acceptance separately. Record the environment, cache state and errors; a local database benchmark is not an end-to-end production latency claim. Avoid repeating metadata/catalogue reads within one display refresh, while preserving fresh checks where authority or a write requires them.

  1. Discover identity and read the published catalogue

    A backend first validates its current key binding. Load the public catalogue and returned timezone/capabilities for that site and integration. Do not substitute the complete Management catalogue: it can include inactive or unpublished services. Respect current intake refusals; a configured connection is not a ready-to-book claim.

    Retrieve integration accessRetrieve catalog
  2. Reuse one in-flight display refresh

    Coalesce simultaneous catalogue/configuration reads for the same server key, site and integration. A short, explicitly bounded local display snapshot can serve the treatment list while a background refresh runs. Revalidate authority after process restart; invalidate the snapshot on binding changes, expiry or an observed authorization refusal.

  3. Render before unrelated requests finish

    Show treatment name, duration and price as soon as the authorized catalogue is available. Prepare the visitor session once the integration is known; do not block treatment rendering on history, admin feeds, reports or WhatsApp diagnostics. Independent reads can run together after their identity and permission dependencies are satisfied.

    Create a visitor session

Fetch only the availability the visitor needs

  1. Quote the selected treatment

    Create a current quote for the exact service, supported provider and removal choice. If there is exactly one eligible provider for that service, the interface can select it automatically; preserve a choice when several are eligible. Retain the quote ID, expiry, timezone, duration and money from the response.

    Create a quote
  2. Select a day, then load its hours

    Show a week strip or a month calendar without requesting slots for every visible date. Request availability for the selected localDate and quote. Keep loading, no available times and a failed request distinct. A displayed slot is not reserved.

    Find available times
  3. Reject late answers

    Bind a response to the session, service/provider/removal selection, quote and localDate that requested it. Cancel obsolete reads or ignore their responses. Changing treatment invalidates the selected time; a late response must not restore it.

  4. Recheck before acceptance

    Use the exact returned startAt instant and its offset. Display it in the business timezone, including daylight-saving transitions. Refresh expired quotes and review changed terms. The authoritative intent/commit checks current authority, terms and capacity; local appointment replicas cannot replace them.

    Prepare a bookingSubmit a booking request

Keep phone proof and customer names separate

The standard Customer API requires current CRAD phone proof for booking intents and commits. The visitor can choose treatment and time before entering the phone; request a WhatsApp code only after an explicit action. Persist the challenge UUID and adopt the successful verification response's sessionToken and expiry timestamps. An unavailable sender is not permission to skip verification.

A booking display name is not an instruction to rename the canonical contact. Do not PATCH a profile on every booking. Reuse a name only through a currently authorized read, and keep explicit customer editing separate. For a new contact, collect the required name at the point it is needed. Website login, knowing a phone number and a synchronized customer ID do not establish phone ownership.

HALA also has an explicitly owner-approved delegated guest flow implemented in its own backend-for-frontend while phone codes are unavailable. It uses separately granted Management contact/calendar operations, current quote/availability and durable commands with bookingIntent: request. A clinic requiring approval receives a PENDING request; show the actual receipt instead of promising confirmation. This grants neither customer phone proof nor access to customer self-service history. It is not a general CRAD Customer API fallback.

In that site-specific flow, HALA asks for phone and an optional local note, then asks for a name only when a new contact must be recorded. Its preflight returns only whether a name is required, with no existing name, customer ID, blocked status or private fields before proof. Even that boolean discloses limited existence information: it requires owner approval, server-side admission and probing/rate limits. A final exact lookup rechecks the contact; existing names are preserved.

HALA's /booking-customer-context and /booking-without-verification are its own BFF routes, not endpoints in the CRAD public contract. Do not copy their paths into a CRAD client or expose a Management lookup to an anonymous browser. If this delegated model is not explicitly approved for your website, keep the verified Customer API flow and explain verification unavailability.

Keep request acceptance, clinic approval and message delivery separate

Read approvalRequired and customerAppointmentChanges from current public capabilities. When approval is required, the final customer commit reserves a pending request. Say “Request received; awaiting the clinic,” then refresh the authoritative booking/projection when either admin decides. Do not create or confirm an appointment in the website database while waiting.

A delegated server booking must use bookingIntent: request and the customer’s explicit communicationPreferences. A manually entered administrator appointment keeps its existing behavior. Approval or rejection queues a customer update once; do not add a website-owned duplicate sender. A proposed alternative remains pending until that customer agrees and capacity is checked again.

If customerAppointmentChanges is contact_business, show the saved business contact for cancellation or rescheduling, following current allowedActions. The customer can still accept or decline an offered alternative. The Customer requests and clinic approval guide explains the exact policy, proposal, recovery and per-business 24-hour reminder sequence.

Synchronize separate, permitted projections

The Sync, Business calendar, Services & website content and Providers guides describe each stream's exact membership, authorization and recovery rules. Integration customer/booking-lineage feeds are a different scope: they do not provide a complete business directory or bot-created business calendar. Do not apply one stream's version-filtering rules to another.

  1. Bootstrap each domain independently

    Keep independent cursor, staging, epoch and pending ACK state for each Management stream. Use {} for customer, service and provider snapshots. Appointment snapshots require a fixed authorized range of at most 93 days; when that window moves, rebuild its scope. Stage membership until the final snapshot page.

  2. Apply a whole page atomically

    Commit its current projections, removals and nextCursor in one local database transaction. Preserve website-owned accounts, media and notes. current:null or snapshot removed removes only the corresponding CRAD projection; non-null current wins over an older removed signal. Process empty filtered pages too.

  3. Persist and replay the acknowledgement

    Save one pending ACK UUID with the applied page and cursor. Partial snapshot cursors are for paging, not acknowledgement. ACK the final snapshot cursor and each durably applied changes-page cursor, even when changes hasMore:true. Recover an uncertain ACK with the exact saved UUID/cursor before another page.

  4. Wake and reconcile with bounded work

    Use one durable worker lease, page/time limits, jitter, backoff and Retry-After across all streams. hasMore:false means caught up to that read, not permanent synchronization. An approved signed wake-up can schedule the worker; otherwise use bounded server polling. Retain infrequent reconciliation even with callbacks. Native panel, bot and approved API edits converge through their respective streams; do not echo unchanged projections back as writes.

  5. Rebuild after authority or retention changes

    Inspect the current projection epoch and bootstrapRequired, including on ACK replay. An expired cursor, changed effective grants or a changed appointment scope needs a new staged bootstrap. Hide affected CRAD data on an observed revocation; preserve unrelated website data.

ProjectionSnapshot → pages/changes → acknowledgement
Business customerscustomer-snapshots → customer-changes → customer-sync-checkpoints
Business appointmentsappointment-snapshots → appointment-changes → appointment-checkpoints
Business servicesservice-snapshots → service-changes → service-checkpoints
Granted providersprovider-snapshots → provider-changes → provider-checkpoints

Discover wake-ups separately from activation

Signed synchronization wake-ups are a capability-gated Management integration feature. The current local implementation is restricted to an explicitly approved HALA pilot and its fixed callback. It is not general callback registration for new businesses, and publishing this guide does not activate it.

Require capabilities.syncWakeups === true in authenticated Management metadata, then inspect GET /v1/management/sync-webhook for its separate enabled state. Missing or false means unavailable. An approved but disabled subscription may still advertise the capability. Do not infer availability from the existence of a URL; general Integration externalWebhooks remains false.

A callback contains a signed event ID, integration binding and changed stream names, never customer data or a booking decision. Verify its raw-body HMAC and timestamp, then durably deduplicate and mark work dirty before acknowledging it. Fetch authorized changes through the same cursor/checkpoint protocol. Permission invalidation must stop shared reads; callbacks never clear a disabled or revoked connection.

The downloaded kit includes WEBSITE_SYNC_WAKEUPS_PILOT.md with the exact current callback restriction, signing format and explicit approval/registration steps. Other consumers should keep bounded server polling until their own current metadata and a reviewed activation contract permit wake-ups.

Budget synchronization across every stream

The sync request protection applies to every business using the affected Integration or Management feeds, independently of HALA pilot eligibility. Current limits are two concurrent sync requests per credential and four per Edge Function isolate, with a per-key burst of 12 and refill of one request per second. Booking commands, owner edits and operation recovery do not share this synchronization budget; their existing DB quotas and authorization still apply.

One key’s rate limit or backend circuit does not disable another key. The aggregate cap can nevertheless return 429 to another legitimate business while four slots are occupied. These are isolate-local safety limits, not reserved tenant capacity, a distributed quota or a guarantee against shared database outages. Preserve queued work and pending ACKs; honor Retry-After rather than rotate keys or add parallel workers.

Expose last successful projection time, unfinished bootstrap, pending ACK and oldest queued work separately. Measure all streams and retries together. Callback delivery and hasMore:false are not a complete synchronization status, and local fixture timings are not a production latency SLA.

For an actively viewed admin screen, coalesce a bounded refresh before its display-freshness deadline instead of waiting for the infrequent idle reconciliation. Stop foreground refresh while hidden or offline, defer it during unsaved edits and retain worker backoff after failures. A stale read can schedule one catch-up read; repeated stale responses must not create a rapid retry loop or clear a suspended connection. Display freshness and current authorization remain separate.

Show useful saved data without accepting offline writes

Label a local projection with its source, last successful sync and coverage. A transport failure is different from a known 401/403 or revoked grant. You may keep an authorized, bounded last-known display during a transient outage under your disclosed freshness policy; a stale disk snapshot never establishes current authority after restart. Hide data on known access loss, and never label an incomplete bootstrap as ready.

Keep stale customer/calendar displays read-only. Quotes, availability, contact recording and appointment changes go to CRAD and independently check current authority. Do not reserve a slot, create an offline appointment or queue a new write from the mirror. After an accepted website/admin command, refresh or invalidate the affected local domain so the old projection does not immediately overwrite the receipt.

Before a write, persist its exact body, preconditions and request/operation UUID. A timeout is uncertain, not a refusal: recover the original operation and retry it exactly only when appropriate. not_found does not prove an in-flight request cannot commit. Do not generate a new UUID, silently replace If-Match or auto-confirm a recovered review. For Customer API confirmation, use the saved intent's returned operationId, not its earlier request UUID.

An uncertain Management appointment creation has an explicit resolution endpoint in the reviewed contract: POST appointment-operations/{originalOperationId}/resolve with its original body. Use it only to settle that original intent, after verifying deployed support. A committed result retains the receipt and current lineage; a rejected receipt with outcome:not_executed durably blocks a late original create. A failed lookup, changed quote, elapsed time or failed resolution is never equivalent to this terminal proof.

Bind browser requests and every async continuation to the session that started them. A late success must not expose a previous customer's data, and a late 401 must not clear a newer login. Keep unresolved command handles across identity changes and recover them only under the matching authenticated identity.

Show immutable accepted receipt and current state separately. An accepted appointment is not proof that WhatsApp was delivered. Synchronization acknowledgement is a consumer report of durable progress, not proof that your remote database is correct or that a cached slot is bookable.