CRADמפתחים
עברית

Recover errors and uncertain results

Keep the right identifier, restore current authority, and establish the original outcome before creating a replacement operation.

לפני שימוש חי — בדקו יכולות פרוסות, הרשאות ומוכנות של החיבור שלכם.

בדקו את היכולות הפרוסות, הרשאות המפתח ומוכנות העסק בסביבה שלכם. דוגמאות HTTP נלכדו בבדיקות מבודדות; הסימון local-unreleased שלהן אינו אומר שה־API אינו פועל, ואינו מאשר את החיבור שלכם. במסלול הלקוח מאמתים טלפון בתבנית WhatsApp שהעסק הגדיר; SMS אינו נתמך. רישום בידי אדמין מורשה הוא פעולה נפרדת ללא קוד.

Keep request, intent and operation IDs distinct

Keep customer bearers, OTPs and customer payloads out of browser recovery URLs/storage. A non-authorizing original intent request UUID can survive reload; fresh authorized lookup recovers the saved command. Durable backend writes and sync workers must retain the exact pending command and preconditions in their protected server store, except for provider login creation. For provider logins, persist only the operation UUID, providerId and original version; never persist the password, even in protected server storage. If credentials leave memory, require original credential reentry before an explicit same-operation retry.

Phone-change recovery still requires current proof for the intended new phone. After proof expiry, obtain a fresh session proving that same new phone and replace only newSessionToken. Keep the original operation UUID, customerId and If-Match; do not change the target phone or advance the precondition to disguise a new command.

IdentifierCreated byUse
Challenge request UUIDYour client before requesting a codeIdempotency-Key for verification challenge replay in the original session. It is not a booking locator.
Intent request UUIDYour client before preparing create/cancel/rescheduleIdempotency-Key for that intent POST; recover or abandon through intent-requests/{requestId}. Persist it before sending.
intentId / locatorThe intent responseIdentifies the saved command for review and commit. Keep its original requestId too.
intent.operationIdThe intent responseThe only valid Idempotency-Key for committing that exact booking intent; used for operation-result recovery.
Management/customer/preference/checkpoint UUIDYour backend or client before the relevant writeA stable command key. Save the body and required preconditions; reuse them after uncertainty, except for provider login creation. For provider logins, persist only the operation UUID, providerId and original version; never persist the password. If credentials leave memory, require original credential reentry before an explicit same-operation retry. Phone-change proof renewal is the separate exception below.
bookingIdThe accepted receiptKnown-booking access with current phone proof. It is not a bearer or phone-history search.
error.requestId / X-Request-IdThe server for one HTTP requestA support trace identifier. It is not the intent request UUID or an idempotency key.

Recover a lost booking response

If an older response omits the original requestId, retain your pre-persisted request UUID. Missing recovery metadata is not permission to forget an uncertain operation. There is no client timer after which not_found alone makes a replacement safe.

  1. Restore authority without replacing the command

    After reload, obtain a new session and same-phone proof for the original site/integration. Keep the original request locator. An expired bearer is not evidence that the booking failed.

  2. Recover a lost intent POST

    GET intent-requests/{requestId}. found returns the saved intent for review. not_found is not a fence against a late POST. abandoned is terminal for that request. Recovery must never auto-confirm.

    Recover an intent request
  3. Recover a lost commit response

    GET operations/{operationId}. committed contains the original receipt and currentBooking; present the current state separately from the historical action. If unresolved, retain the same intent and operation key for an exact retry.

    Retrieve operation result
  4. Close an unfinished request before replacing it

    For an explicit customer choice to stop, POST an empty object to intent-requests/{requestId}/abandon. Keep that locator until its terminal outcome is known. Success prevents the delayed intent POST/commit from completing this request.

    Abandon an intent request
Recovery resultNext action
200 status: not_foundKeep the original locator. Poll/retry the same command, or explicitly abandon the original request; do not assume no in-flight request can commit.
200 status: abandonedThis original request is closed. A different request can begin after a new customer action.
409 REQUEST_ALREADY_COMMITTED during abandonmentRecover the original operation and show the saved appointment; abandonment is not cancellation. Use the normal cancellation workflow if requested.
409 REQUEST_ABANDONED during a delayed writeDo not revive the old request. Recover its authoritative request state before offering a separate new action.
404 INTENT_NOT_FOUNDThis can be an identity/access refusal. Keep the locator and verify the original phone/site/integration; do not turn it into terminal not_found.
409 OPERATION_CONFLICTThe saved request and submitted UUID/body/target disagree, or the request cannot be disambiguated. Preserve evidence and resolve the original command; changing the UUID is not recovery.

Use the verification challenge’s original session

verification.available indicates configured code verification; newChallengeAvailable separately advises whether a new send can be requested. A stop on new sends need not invalidate an already issued code or existing proof. The final request remains authoritative.

A WhatsApp disconnection blocks new verification sends while preserving unexpired proof and otherwise permitted website actions. Expiry, authorization and site intake rules continue to apply. An issued code remains verifiable until expiry. Contact recording by an authorized administration backend does not require an OTP.

ConditionAction
Challenge POST timed outRepeat the same challenge UUID/body with the original customer session. That request does not send another code.
deliveryState: unknownAllow code entry if the code arrives. Offer checking the same request; do not report delivery or automatically send a replacement.
Original session is lost/expiredDo not replay its challenge using a renewed session as if it were the same send. Require a separate explicit new-code action and a fresh UUID when allowed.
401 VERIFICATION_INVALIDThe code is wrong, expired, exhausted, rejected or does not match this challenge/session. Allow correction or an explicit new-code request after resendAt.
409 PHONE_CHANGE_REQUIRES_NEW_SESSIONCreate a new session for a different phone. Do not mutate a verified session’s identity.
429 RATE_LIMITEDHonor Retry-After and the returned resendAt. A fresh UUID does not bypass the quota.
503 VERIFICATION_UNAVAILABLE / VERIFICATION_DELIVERY_REJECTEDShow verification unavailable and retain an uncertain request’s identity. Recheck capability/advice; never silently loop through new code requests.

Turn a booking refusal into a new review

allowedActions is advisory and valid for at most thirty seconds, capped by proof expiry or the cancellation cutoff. Refresh before a new action and after focus/reconnection. Its absence in an older response does not grant permission, and commit/replay receipts do not provide current action advice.

Saved quote and intent reads support recovery of the earlier review. Retrieving an expired summary is not permission to execute a new write with stale terms.

ResponseUser-facing action
409 SLOT_UNAVAILABLEExplain that the time is no longer available. Resolve/close the old request before preparing a different slot; refresh availability and preserve entered details.
409 QUOTE_EXPIRED / QUOTE_CHANGED / BOOKING_POLICY_CHANGEDRead current capabilities and obtain a current quote. Present price/duration/policy changes and require confirmation before preparing a replacement request.
409 INTENT_EXPIREDRecover any accepted outcome first. An expired review cannot authorize a new commit; close the uncommitted request before preparing current terms.
412 VERSION_CONFLICT / 409 APPOINTMENT_CHANGEDRead the current booking and allowedActions, then prepare and review a new change. Do not overwrite the newer appointment.
409 CANCELLATION_NOTICE_REQUIRED / BOOKING_NOT_CHANGEABLERefresh allowedActions and explain that this appointment cannot currently be changed online; offer the business contact route.
409 REMINDER_IN_PROGRESSKeep the current booking visible and refresh its action availability later. Do not assume cancellation succeeded.
409 EXTERNAL_REFERENCE_CONFLICTRecover the earlier exact request/operation before any competing attempt. A reference is not a search or ownership token.

Preserve evidence when the outcome is uncertain

The cases in these guides are selected workflow rules, not an exhaustive error catalog. Check both HTTP status and error.code. Treat unknown states conservatively and retain the original operation until its outcome is established.

For support, retain the API contract version, UTC time, method/route, HTTP status, error code and server request ID. Share a non-authorizing operation reference when needed. Keep bearer tokens, machine keys, OTPs and customer payloads out of support reports.

ResponseAction
401 UNAUTHENTICATED / SESSION_EXPIRED / VERIFICATION_REQUIREDRestore the required session/proof. Keep pending request references. Verification-code refusal is handled separately above.
403 SERVER_CREDENTIAL_REQUIREDMove machine/companion calls to your backend; do not send an Origin header or expose a machine key in the browser.
403 SCOPE_REQUIRED / ACCESS_REVOKED / FORBIDDENStop and repair legitimate access. A retry with different customer data or a different UUID does not create authority.
404 on a known private resourceMay hide missing or unauthorized data. Preserve pending locators; check the original identity and integration.
410 CURSOR_EXPIREDUse the sync guide’s fresh snapshot procedure; do not treat this as a generic booking-retry instruction.
428 missing precondition / 422 invalid requestCorrect the documented body/header shape. Do not reuse an unanswered operation key with a changed command.
429Honor Retry-After, back off and retain pending state.
Network loss / 503 OUTCOME_UNCERTAIN, PERSISTENCE_FAILED or BACKEND_UNAVAILABLEA write may have committed. Recover it or repeat the saved command with its original key and preconditions. Preserve the body except for the documented same-phone proof-token renewal on phone change. Never manufacture a replacement operation solely to retry.