CRADالمطوّرون
العربية

Read booking changes

Read booking snapshot pages, then durable changes

قبل الاستخدام الفعلي — افحص القدرات المنشورة والصلاحيات وجاهزية ربطك.

تحقّق من القدرات المنشورة وصلاحيات المفتاح وجاهزية النشاط في بيئتك. أمثلة HTTP مسجّلة من اختبارات معزولة؛ وصفها local-unreleased لا يعني أن API غير عامل ولا يُثبت جاهزية ربطك. في مسار العميل يُتحقق من الهاتف بقالب واتساب أعدّه النشاط؛ SMS غير مدعوم. التسجيل بواسطة مسؤول مخوّل عملية منفصلة دون رمز.

GET/v1/integration/booking-changes

Behavior

Backend only; no Origin header. Requires bookings:read:integration. Includes only accepted booking lineages of this tenant, site and integration. It never grants legacy or other-channel history. A customer-facing site must authorize its own account before forwarding data. Booking changes are independent of notification delivery. Persist each complete page and its next cursor atomically. Snapshot cursors expire after 30 minutes; changes cursors expire after up to 30 days. An idle poll preserves the existing cursor and its expiry. HTTP 410 requires a new snapshot. Apply events by integration sequence, including external-reference changes at the same booking version. This is polling, not webhook delivery.

Authentication

IntegrationCredential OR ManagementCredential

Credential rules

Use the same server-only wbm_ API key as business management, with explicitly approved integration scopes; legacy wbi_ integration-only keys remain supported. No Origin request header. GET /v1/integration returns the integration-scoped view of the same credential/site/integration. Customer phone proof is still required for self-service.

One server-only owner-issued wbm_ API key can carry both management and integration permissions. Additional permissions require an explicit owner-issued grant. GET /v1/management returns the management discovery view, which may be empty for a booking-only key. For credentials with appointments:read, this discovery view omits whatsapp-templates:read, whatsapp-templates:write, whatsapp-profile:read and whatsapp-profile:write to preserve calendar-client compatibility. Discover these grants through GET /v1/management/messaging-capabilities. Template/profile command authorization still uses the stored grants. Server-only owner-issued Management authority with explicit application permissions. Calling this API does not expand a credential's grants. contacts:read/write/block/sync/fields:read/fields:write are separate approvals for canonical business contacts; fields also require current typed owner grants. contacts:record remains contact recording/recovery only. These grants create no customer phone proof, booking authority, messaging consent or automatic synchronization. Hours/blocks retain their independent resource grants. booking-policy:read/write separately delegate whole-business booking settings, without schedule/provider grants; write requires read. They preserve existing appointments and create no duration-rewrite authority. Provider duration policy additionally requires explicit provider-booking-policy:read/write and exact current providerIds; booking-duration:rewrite is separately approved and does not itself grant policy read/write. Service catalogue requires explicit services:read/write, independent of provider/calendar/schedule resources; write requires read. These operations do not expand an existing credential's grants. Public presentation and reviewed service selection require explicit website-content:read/write; write requires read, independently from services:* and provider resources. Existing provider metadata/activity/assignment additionally requires providers:read/write and a nonempty explicit current providerIds grant; write requires read. This grants no provider creation, deletion, login, invitation or schedule authority. WhatsApp template/profile management requires separate whatsapp-templates:read, whatsapp-templates:write, whatsapp-profile:read and whatsapp-profile:write application scopes. Write requires its matching read scope. These grants require explicit owner approval; Meta OAuth permissions remain separate.

Required application permissions

bookings:read:integration

Request

  • cursorquery · stringRequired
    Format and constraints
    cursor schema
    {
      "type": "string",
      "format": "uuid"
    }
  • limitquery · integerOptional
    Format and constraints
    limit schema
    {
      "type": "integer",
      "minimum": 1,
      "maximum": 100,
      "default": 50
    }

Successful responses

200 · BookingSyncPage

application/json · BookingSyncPage

Exactly one of these variants must match.

  • oneOf 1 · kind = "snapshot"objectSchema branch
    View branch fields and rules
    • kindstringRequired in this branch

      Value: "snapshot"

    • bookingsarrayRequired in this branch

      maxItems: 100

      View nested fields
      • []objectArray item
        View nested fields
        • bookingIdstring · uuidRequired in this branch
        • versionintegerRequired in this branch

          minimum: 1

        • statusstringRequired in this branch

          Allowed values: ["pending","confirmed","cancelled","completed","missed","now"]

        • startAtstring · date-timeRequired in this branch
        • endAtstring · date-timeRequired in this branch
        • snapshotobject; allOf (unspecified)Required in this branch

          All of these schema rules apply together.

          View nested fields
          • versionnumberRequired in this branch

            Value: 1

          • policystringRequired in this branch

            Allowed values: ["legacy_fixed_slot_v1","service_duration_v1"]

          • serviceIdstring · uuidRequired in this branch
          • serviceNameobjectRequired in this branch
            View nested fields
            • hestringOptional in this branch
            • arstringOptional in this branch
            • enstringOptional in this branch
            • additionalPropertiesno value allowedSchema rule
          • providerIdanyOf (string | null)Required in this branch

            At least one of these variants must match.

            View nested fields
            • anyOf 1string · uuidSchema branch
            • anyOf 2nullSchema branch
          • durationMinutesintegerRequired in this branch

            minimum: 1maximum: 1440

          • slotIntervalMinutesintegerRequired in this branch

            minimum: 1maximum: 1440

          • totalPriceMinoranyOf (integer | null)Required in this branch

            Frozen exact total in minor units. Null remains non-final; priceRangeMinor may carry frozen range bounds. Never turn the range minimum into an agreed total.

            At least one of these variants must match.

            View nested fields
            • anyOf 1integerSchema branch

              minimum: 0

            • anyOf 2nullSchema branch
          • currencystringRequired in this branch

            Value: "ILS"

          • includeRemovalbooleanRequired in this branch
          • baseDurationMinutesintegerRequired in this branch
          • removalDurationMinutesintegerRequired in this branch
          • basePriceMinoranyOf (integer | null)Required in this branch

            Null means the price will be decided later; zero remains an explicit free price.

            At least one of these variants must match.

            View nested fields
            • anyOf 1integerSchema branch

              minimum: 0

            • anyOf 2nullSchema branch
          • removalPriceMinorintegerRequired in this branch
          • priceRangeMinoranyOf (object | null)Optional in this branch

            Non-final inclusive bounds in minor currency units; 35000–60000 means 350–600 ILS. Both safe integer bounds are required and min must be strictly below max. The companion exact amount is null. Omitted or null means no range. Accepted bounds are immutable quote/booking terms.

            At least one of these variants must match.

            View nested fields
            • anyOf 1objectSchema branch
              View branch fields and rules
              • minintegerRequired in this branch

                minimum: 0maximum: 9007199254740991

              • maxintegerRequired in this branch

                minimum: 0maximum: 9007199254740991

              • additionalPropertiesno value allowedSchema rule
            • anyOf 2nullSchema branch
          • allOf 1unspecifiedSchema branch
            View branch fields and rules
            • ifobjectSchema rule
              View branch fields and rules
              • priceRangeMinorobjectCondition predicate
            • thenobjectSchema rule
              View branch fields and rules
              • totalPriceMinornullOptional in this branch
          • additionalPropertiesno value allowedSchema rule
        • replayedbooleanRequired in this branch
        • allowedActionsobjectOptional in this branch

          Fresh authorized GET projection, valid for at most thirty seconds and capped by proof expiry or the cancellation cutoff. Advisory only: a write rechecks current policy, status and locks. Immutable commit/replay receipts omit it. Site intake pause or service unpublication does not itself block an accepted booking.

          View nested fields
          • computedAtstring · date-timeRequired in this branch
          • validUntilstring · date-timeRequired in this branch
          • canceloneOf (object | object)Required in this branch

            Exactly one of these variants must match.

            View nested fields
            • oneOf 1 · allowed = trueobjectSchema branch
              View branch fields and rules
              • allowedbooleanRequired in this branch

                Value: true

              • reasonnullRequired in this branch
              • additionalPropertiesno value allowedSchema rule
            • oneOf 2 · allowed = falseobjectSchema branch
              View branch fields and rules
              • allowedbooleanRequired in this branch

                Value: false

              • reasonstringRequired in this branch

                Allowed values: ["BOOKING_NOT_CHANGEABLE","CANCELLATION_NOTICE_REQUIRED","REMINDER_IN_PROGRESS","CUSTOMER_UNAVAILABLE","PROVIDER_UNAVAILABLE","INVALID_SETTINGS","CONTACT_BUSINESS_REQUIRED"]

              • additionalPropertiesno value allowedSchema rule
          • rescheduleoneOf (object | object)Required in this branch

            Exactly one of these variants must match.

            View nested fields
            • oneOf 1 · allowed = trueobjectSchema branch
              View branch fields and rules
              • allowedbooleanRequired in this branch

                Value: true

              • reasonnullRequired in this branch
              • additionalPropertiesno value allowedSchema rule
            • oneOf 2 · allowed = falseobjectSchema branch
              View branch fields and rules
              • allowedbooleanRequired in this branch

                Value: false

              • reasonstringRequired in this branch

                Allowed values: ["BOOKING_NOT_CHANGEABLE","CANCELLATION_NOTICE_REQUIRED","REMINDER_IN_PROGRESS","CUSTOMER_UNAVAILABLE","PROVIDER_UNAVAILABLE","INVALID_SETTINGS","CONTACT_BUSINESS_REQUIRED"]

              • additionalPropertiesno value allowedSchema rule
          • contactPhoneNumberstring | nullOptional in this branch

            Business contact guidance in contact_business mode; null for self-service. Separate from the WhatsApp sending identity.

            pattern: "^\\+[1-9][0-9]{6,14}$"

          • additionalPropertiesno value allowedSchema rule
        • externalReferencestring | nullOptional in this branch

          Original immutable integration-scoped booking reference, retained across replacement/reschedule and key rotation. Null when no reference was provided; optional during rolling v1.

          minLength: 1maxLength: 120pattern: "^[A-Za-z0-9][A-Za-z0-9._:-]{0,119}$"

        • approvalRequiredbooleanOptional in this branch

          Customer request requiring a clinic decision. Existing appointments and manually entered appointments are preserved.

        • timeProposalanyOf (object | null)Optional in this branch

          At least one of these variants must match.

          View nested fields
          • anyOf 1objectSchema branch

            Version-bound alternative for a pending request. The original keeps its slot; the alternative is not held. Acceptance rechecks capacity and creates one confirmed successor preserving accepted terms. Expired or replaced offers cannot be accepted.

            View branch fields and rules
            • proposalIdstring · uuidRequired in this branch
            • appointmentVersionstringRequired in this branch

              Opaque physical appointment revision, a0 through a9223372036854775807. Preserve exactly; this is distinct from website lineage versions.

              pattern: "^a(?:0|[1-9][0-9]{0,18})$"

            • startAtstring · date-timeRequired in this branch
            • endAtstring · date-timeRequired in this branch
            • expiresAtstring · date-timeRequired in this branch
            • statestringRequired in this branch

              Allowed values: ["offered","accepted","declined"]

            • additionalPropertiesno value allowedSchema rule
          • anyOf 2nullSchema branch
        • additionalPropertiesno value allowedSchema rule
    • nextCursorstring · uuidRequired in this branch
    • hasMorebooleanRequired in this branch
    • watermarkintegerRequired in this branch

      minimum: 0maximum: 9007199254740991

    • additionalPropertiesno value allowedSchema rule
  • oneOf 2 · kind = "changes"objectSchema branch
    View branch fields and rules
    • kindstringRequired in this branch

      Value: "changes"

    • eventsarrayRequired in this branch

      maxItems: 100

      View nested fields
      • []objectArray item
        View nested fields
        • eventIdstring · uuidRequired in this branch
        • sequenceintegerRequired in this branch

          minimum: 1maximum: 9007199254740991

        • typestringRequired in this branch

          status_changed includes approval and alternative-time proposal state changes (offered, replaced or declined). Apply booking.version, approvalRequired and timeProposal from the current receipt. A proposal is not a confirmed reschedule; only an accepted actual time change is rescheduled.

          Allowed values: ["created","rescheduled","cancelled","status_changed","reference_linked"]

        • bookingobjectRequired in this branch
          View nested fields
          • bookingIdstring · uuidRequired in this branch
          • versionintegerRequired in this branch

            minimum: 1

          • statusstringRequired in this branch

            Allowed values: ["pending","confirmed","cancelled","completed","missed","now"]

          • startAtstring · date-timeRequired in this branch
          • endAtstring · date-timeRequired in this branch
          • snapshotobject; allOf (unspecified)Required in this branch

            All of these schema rules apply together.

            View nested fields
            • versionnumberRequired in this branch

              Value: 1

            • policystringRequired in this branch

              Allowed values: ["legacy_fixed_slot_v1","service_duration_v1"]

            • serviceIdstring · uuidRequired in this branch
            • serviceNameobjectRequired in this branch
              View nested fields
              • hestringOptional in this branch
              • arstringOptional in this branch
              • enstringOptional in this branch
              • additionalPropertiesno value allowedSchema rule
            • providerIdanyOf (string | null)Required in this branch

              At least one of these variants must match.

              View nested fields
              • anyOf 1string · uuidSchema branch
              • anyOf 2nullSchema branch
            • durationMinutesintegerRequired in this branch

              minimum: 1maximum: 1440

            • slotIntervalMinutesintegerRequired in this branch

              minimum: 1maximum: 1440

            • totalPriceMinoranyOf (integer | null)Required in this branch

              Frozen exact total in minor units. Null remains non-final; priceRangeMinor may carry frozen range bounds. Never turn the range minimum into an agreed total.

              At least one of these variants must match.

              View nested fields
              • anyOf 1integerSchema branch

                minimum: 0

              • anyOf 2nullSchema branch
            • currencystringRequired in this branch

              Value: "ILS"

            • includeRemovalbooleanRequired in this branch
            • baseDurationMinutesintegerRequired in this branch
            • removalDurationMinutesintegerRequired in this branch
            • basePriceMinoranyOf (integer | null)Required in this branch

              Null means the price will be decided later; zero remains an explicit free price.

              At least one of these variants must match.

              View nested fields
              • anyOf 1integerSchema branch

                minimum: 0

              • anyOf 2nullSchema branch
            • removalPriceMinorintegerRequired in this branch
            • priceRangeMinoranyOf (object | null)Optional in this branch

              Non-final inclusive bounds in minor currency units; 35000–60000 means 350–600 ILS. Both safe integer bounds are required and min must be strictly below max. The companion exact amount is null. Omitted or null means no range. Accepted bounds are immutable quote/booking terms.

              At least one of these variants must match.

              View nested fields
              • anyOf 1objectSchema branch
                View branch fields and rules
                • minintegerRequired in this branch

                  minimum: 0maximum: 9007199254740991

                • maxintegerRequired in this branch

                  minimum: 0maximum: 9007199254740991

                • additionalPropertiesno value allowedSchema rule
              • anyOf 2nullSchema branch
            • allOf 1unspecifiedSchema branch
              View branch fields and rules
              • ifobjectSchema rule
                View branch fields and rules
                • priceRangeMinorobjectCondition predicate
              • thenobjectSchema rule
                View branch fields and rules
                • totalPriceMinornullOptional in this branch
            • additionalPropertiesno value allowedSchema rule
          • replayedbooleanRequired in this branch
          • allowedActionsobjectOptional in this branch

            Fresh authorized GET projection, valid for at most thirty seconds and capped by proof expiry or the cancellation cutoff. Advisory only: a write rechecks current policy, status and locks. Immutable commit/replay receipts omit it. Site intake pause or service unpublication does not itself block an accepted booking.

            View nested fields
            • computedAtstring · date-timeRequired in this branch
            • validUntilstring · date-timeRequired in this branch
            • canceloneOf (object | object)Required in this branch

              Exactly one of these variants must match.

              View nested fields
              • oneOf 1 · allowed = trueobjectSchema branch
                View branch fields and rules
                • allowedbooleanRequired in this branch

                  Value: true

                • reasonnullRequired in this branch
                • additionalPropertiesno value allowedSchema rule
              • oneOf 2 · allowed = falseobjectSchema branch
                View branch fields and rules
                • allowedbooleanRequired in this branch

                  Value: false

                • reasonstringRequired in this branch

                  Allowed values: ["BOOKING_NOT_CHANGEABLE","CANCELLATION_NOTICE_REQUIRED","REMINDER_IN_PROGRESS","CUSTOMER_UNAVAILABLE","PROVIDER_UNAVAILABLE","INVALID_SETTINGS","CONTACT_BUSINESS_REQUIRED"]

                • additionalPropertiesno value allowedSchema rule
            • rescheduleoneOf (object | object)Required in this branch

              Exactly one of these variants must match.

              View nested fields
              • oneOf 1 · allowed = trueobjectSchema branch
                View branch fields and rules
                • allowedbooleanRequired in this branch

                  Value: true

                • reasonnullRequired in this branch
                • additionalPropertiesno value allowedSchema rule
              • oneOf 2 · allowed = falseobjectSchema branch
                View branch fields and rules
                • allowedbooleanRequired in this branch

                  Value: false

                • reasonstringRequired in this branch

                  Allowed values: ["BOOKING_NOT_CHANGEABLE","CANCELLATION_NOTICE_REQUIRED","REMINDER_IN_PROGRESS","CUSTOMER_UNAVAILABLE","PROVIDER_UNAVAILABLE","INVALID_SETTINGS","CONTACT_BUSINESS_REQUIRED"]

                • additionalPropertiesno value allowedSchema rule
            • contactPhoneNumberstring | nullOptional in this branch

              Business contact guidance in contact_business mode; null for self-service. Separate from the WhatsApp sending identity.

              pattern: "^\\+[1-9][0-9]{6,14}$"

            • additionalPropertiesno value allowedSchema rule
          • externalReferencestring | nullOptional in this branch

            Original immutable integration-scoped booking reference, retained across replacement/reschedule and key rotation. Null when no reference was provided; optional during rolling v1.

            minLength: 1maxLength: 120pattern: "^[A-Za-z0-9][A-Za-z0-9._:-]{0,119}$"

          • approvalRequiredbooleanOptional in this branch

            Customer request requiring a clinic decision. Existing appointments and manually entered appointments are preserved.

          • timeProposalanyOf (object | null)Optional in this branch

            At least one of these variants must match.

            View nested fields
            • anyOf 1objectSchema branch

              Version-bound alternative for a pending request. The original keeps its slot; the alternative is not held. Acceptance rechecks capacity and creates one confirmed successor preserving accepted terms. Expired or replaced offers cannot be accepted.

              View branch fields and rules
              • proposalIdstring · uuidRequired in this branch
              • appointmentVersionstringRequired in this branch

                Opaque physical appointment revision, a0 through a9223372036854775807. Preserve exactly; this is distinct from website lineage versions.

                pattern: "^a(?:0|[1-9][0-9]{0,18})$"

              • startAtstring · date-timeRequired in this branch
              • endAtstring · date-timeRequired in this branch
              • expiresAtstring · date-timeRequired in this branch
              • statestringRequired in this branch

                Allowed values: ["offered","accepted","declined"]

              • additionalPropertiesno value allowedSchema rule
            • anyOf 2nullSchema branch
          • additionalPropertiesno value allowedSchema rule
        • createdAtstring · date-timeRequired in this branch
        • additionalPropertiesno value allowedSchema rule
    • nextCursorstring · uuidRequired in this branch
    • hasMorebooleanRequired in this branch
    • watermarkintegerRequired in this branch

      minimum: 0maximum: 9007199254740991

    • additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
JSON Schema
{
  "oneOf": [
    {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kind": {
          "const": "snapshot"
        },
        "bookings": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "bookingId": {
                "type": "string",
                "format": "uuid"
              },
              "version": {
                "type": "integer",
                "minimum": 1
              },
              "status": {
                "enum": [
                  "pending",
                  "confirmed",
                  "cancelled",
                  "completed",
                  "missed",
                  "now"
                ]
              },
              "startAt": {
                "type": "string",
                "format": "date-time"
              },
              "endAt": {
                "type": "string",
                "format": "date-time"
              },
              "snapshot": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "version": {
                    "const": 1
                  },
                  "policy": {
                    "enum": [
                      "legacy_fixed_slot_v1",
                      "service_duration_v1"
                    ]
                  },
                  "serviceId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "serviceName": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "he": {
                        "type": "string"
                      },
                      "ar": {
                        "type": "string"
                      },
                      "en": {
                        "type": "string"
                      }
                    }
                  },
                  "providerId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "durationMinutes": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1440
                  },
                  "slotIntervalMinutes": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1440
                  },
                  "totalPriceMinor": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Frozen exact total in minor units. Null remains non-final; priceRangeMinor may carry frozen range bounds. Never turn the range minimum into an agreed total."
                  },
                  "currency": {
                    "const": "ILS"
                  },
                  "includeRemoval": {
                    "type": "boolean"
                  },
                  "baseDurationMinutes": {
                    "type": "integer"
                  },
                  "removalDurationMinutes": {
                    "type": "integer"
                  },
                  "basePriceMinor": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Null means the price will be decided later; zero remains an explicit free price."
                  },
                  "removalPriceMinor": {
                    "type": "integer"
                  },
                  "priceRangeMinor": {
                    "anyOf": [
                      {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "min",
                          "max"
                        ],
                        "properties": {
                          "min": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "max": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          }
                        }
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Non-final inclusive bounds in minor currency units; 35000–60000 means 350–600 ILS. Both safe integer bounds are required and min must be strictly below max. The companion exact amount is null. Omitted or null means no range. Accepted bounds are immutable quote/booking terms."
                  }
                },
                "required": [
                  "version",
                  "policy",
                  "serviceId",
                  "serviceName",
                  "providerId",
                  "durationMinutes",
                  "slotIntervalMinutes",
                  "totalPriceMinor",
                  "currency",
                  "includeRemoval",
                  "baseDurationMinutes",
                  "removalDurationMinutes",
                  "basePriceMinor",
                  "removalPriceMinor"
                ],
                "allOf": [
                  {
                    "if": {
                      "required": [
                        "priceRangeMinor"
                      ],
                      "properties": {
                        "priceRangeMinor": {
                          "type": "object"
                        }
                      }
                    },
                    "then": {
                      "properties": {
                        "totalPriceMinor": {
                          "type": "null"
                        }
                      }
                    }
                  }
                ]
              },
              "replayed": {
                "type": "boolean"
              },
              "allowedActions": {
                "type": "object",
                "additionalProperties": false,
                "description": "Fresh authorized GET projection, valid for at most thirty seconds and capped by proof expiry or the cancellation cutoff. Advisory only: a write rechecks current policy, status and locks. Immutable commit/replay receipts omit it. Site intake pause or service unpublication does not itself block an accepted booking.",
                "properties": {
                  "computedAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "validUntil": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "cancel": {
                    "oneOf": [
                      {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "allowed": {
                            "const": true
                          },
                          "reason": {
                            "type": "null"
                          }
                        },
                        "required": [
                          "allowed",
                          "reason"
                        ]
                      },
                      {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "allowed": {
                            "const": false
                          },
                          "reason": {
                            "enum": [
                              "BOOKING_NOT_CHANGEABLE",
                              "CANCELLATION_NOTICE_REQUIRED",
                              "REMINDER_IN_PROGRESS",
                              "CUSTOMER_UNAVAILABLE",
                              "PROVIDER_UNAVAILABLE",
                              "INVALID_SETTINGS",
                              "CONTACT_BUSINESS_REQUIRED"
                            ]
                          }
                        },
                        "required": [
                          "allowed",
                          "reason"
                        ]
                      }
                    ]
                  },
                  "reschedule": {
                    "oneOf": [
                      {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "allowed": {
                            "const": true
                          },
                          "reason": {
                            "type": "null"
                          }
                        },
                        "required": [
                          "allowed",
                          "reason"
                        ]
                      },
                      {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "allowed": {
                            "const": false
                          },
                          "reason": {
                            "enum": [
                              "BOOKING_NOT_CHANGEABLE",
                              "CANCELLATION_NOTICE_REQUIRED",
                              "REMINDER_IN_PROGRESS",
                              "CUSTOMER_UNAVAILABLE",
                              "PROVIDER_UNAVAILABLE",
                              "INVALID_SETTINGS",
                              "CONTACT_BUSINESS_REQUIRED"
                            ]
                          }
                        },
                        "required": [
                          "allowed",
                          "reason"
                        ]
                      }
                    ]
                  },
                  "contactPhoneNumber": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "pattern": "^\\+[1-9][0-9]{6,14}$",
                    "description": "Business contact guidance in contact_business mode; null for self-service. Separate from the WhatsApp sending identity."
                  }
                },
                "required": [
                  "computedAt",
                  "validUntil",
                  "cancel",
                  "reschedule"
                ]
              },
              "externalReference": {
                "type": [
                  "string",
                  "null"
                ],
                "minLength": 1,
                "maxLength": 120,
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,119}$",
                "description": "Original immutable integration-scoped booking reference, retained across replacement/reschedule and key rotation. Null when no reference was provided; optional during rolling v1."
              },
              "approvalRequired": {
                "type": "boolean",
                "description": "Customer request requiring a clinic decision. Existing appointments and manually entered appointments are preserved."
              },
              "timeProposal": {
                "anyOf": [
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "proposalId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "appointmentVersion": {
                        "type": "string",
                        "pattern": "^a(?:0|[1-9][0-9]{0,18})$",
                        "description": "Opaque physical appointment revision, a0 through a9223372036854775807. Preserve exactly; this is distinct from website lineage versions."
                      },
                      "startAt": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "endAt": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "expiresAt": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "state": {
                        "enum": [
                          "offered",
                          "accepted",
                          "declined"
                        ]
                      }
                    },
                    "required": [
                      "proposalId",
                      "appointmentVersion",
                      "startAt",
                      "endAt",
                      "expiresAt",
                      "state"
                    ],
                    "description": "Version-bound alternative for a pending request. The original keeps its slot; the alternative is not held. Acceptance rechecks capacity and creates one confirmed successor preserving accepted terms. Expired or replaced offers cannot be accepted."
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "bookingId",
              "version",
              "status",
              "startAt",
              "endAt",
              "snapshot",
              "replayed"
            ]
          }
        },
        "nextCursor": {
          "type": "string",
          "format": "uuid"
        },
        "hasMore": {
          "type": "boolean"
        },
        "watermark": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "kind",
        "bookings",
        "nextCursor",
        "hasMore",
        "watermark"
      ]
    },
    {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "kind": {
          "const": "changes"
        },
        "events": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "eventId": {
                "type": "string",
                "format": "uuid"
              },
              "sequence": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "type": {
                "enum": [
                  "created",
                  "rescheduled",
                  "cancelled",
                  "status_changed",
                  "reference_linked"
                ],
                "description": "status_changed includes approval and alternative-time proposal state changes (offered, replaced or declined). Apply booking.version, approvalRequired and timeProposal from the current receipt. A proposal is not a confirmed reschedule; only an accepted actual time change is rescheduled."
              },
              "booking": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "bookingId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "version": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "status": {
                    "enum": [
                      "pending",
                      "confirmed",
                      "cancelled",
                      "completed",
                      "missed",
                      "now"
                    ]
                  },
                  "startAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "endAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "snapshot": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "version": {
                        "const": 1
                      },
                      "policy": {
                        "enum": [
                          "legacy_fixed_slot_v1",
                          "service_duration_v1"
                        ]
                      },
                      "serviceId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "serviceName": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "he": {
                            "type": "string"
                          },
                          "ar": {
                            "type": "string"
                          },
                          "en": {
                            "type": "string"
                          }
                        }
                      },
                      "providerId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "uuid"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "durationMinutes": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 1440
                      },
                      "slotIntervalMinutes": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 1440
                      },
                      "totalPriceMinor": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "description": "Frozen exact total in minor units. Null remains non-final; priceRangeMinor may carry frozen range bounds. Never turn the range minimum into an agreed total."
                      },
                      "currency": {
                        "const": "ILS"
                      },
                      "includeRemoval": {
                        "type": "boolean"
                      },
                      "baseDurationMinutes": {
                        "type": "integer"
                      },
                      "removalDurationMinutes": {
                        "type": "integer"
                      },
                      "basePriceMinor": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "description": "Null means the price will be decided later; zero remains an explicit free price."
                      },
                      "removalPriceMinor": {
                        "type": "integer"
                      },
                      "priceRangeMinor": {
                        "anyOf": [
                          {
                            "type": "object",
                            "additionalProperties": false,
                            "required": [
                              "min",
                              "max"
                            ],
                            "properties": {
                              "min": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "max": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              }
                            }
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "description": "Non-final inclusive bounds in minor currency units; 35000–60000 means 350–600 ILS. Both safe integer bounds are required and min must be strictly below max. The companion exact amount is null. Omitted or null means no range. Accepted bounds are immutable quote/booking terms."
                      }
                    },
                    "required": [
                      "version",
                      "policy",
                      "serviceId",
                      "serviceName",
                      "providerId",
                      "durationMinutes",
                      "slotIntervalMinutes",
                      "totalPriceMinor",
                      "currency",
                      "includeRemoval",
                      "baseDurationMinutes",
                      "removalDurationMinutes",
                      "basePriceMinor",
                      "removalPriceMinor"
                    ],
                    "allOf": [
                      {
                        "if": {
                          "required": [
                            "priceRangeMinor"
                          ],
                          "properties": {
                            "priceRangeMinor": {
                              "type": "object"
                            }
                          }
                        },
                        "then": {
                          "properties": {
                            "totalPriceMinor": {
                              "type": "null"
                            }
                          }
                        }
                      }
                    ]
                  },
                  "replayed": {
                    "type": "boolean"
                  },
                  "allowedActions": {
                    "type": "object",
                    "additionalProperties": false,
                    "description": "Fresh authorized GET projection, valid for at most thirty seconds and capped by proof expiry or the cancellation cutoff. Advisory only: a write rechecks current policy, status and locks. Immutable commit/replay receipts omit it. Site intake pause or service unpublication does not itself block an accepted booking.",
                    "properties": {
                      "computedAt": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "validUntil": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "cancel": {
                        "oneOf": [
                          {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                              "allowed": {
                                "const": true
                              },
                              "reason": {
                                "type": "null"
                              }
                            },
                            "required": [
                              "allowed",
                              "reason"
                            ]
                          },
                          {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                              "allowed": {
                                "const": false
                              },
                              "reason": {
                                "enum": [
                                  "BOOKING_NOT_CHANGEABLE",
                                  "CANCELLATION_NOTICE_REQUIRED",
                                  "REMINDER_IN_PROGRESS",
                                  "CUSTOMER_UNAVAILABLE",
                                  "PROVIDER_UNAVAILABLE",
                                  "INVALID_SETTINGS",
                                  "CONTACT_BUSINESS_REQUIRED"
                                ]
                              }
                            },
                            "required": [
                              "allowed",
                              "reason"
                            ]
                          }
                        ]
                      },
                      "reschedule": {
                        "oneOf": [
                          {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                              "allowed": {
                                "const": true
                              },
                              "reason": {
                                "type": "null"
                              }
                            },
                            "required": [
                              "allowed",
                              "reason"
                            ]
                          },
                          {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                              "allowed": {
                                "const": false
                              },
                              "reason": {
                                "enum": [
                                  "BOOKING_NOT_CHANGEABLE",
                                  "CANCELLATION_NOTICE_REQUIRED",
                                  "REMINDER_IN_PROGRESS",
                                  "CUSTOMER_UNAVAILABLE",
                                  "PROVIDER_UNAVAILABLE",
                                  "INVALID_SETTINGS",
                                  "CONTACT_BUSINESS_REQUIRED"
                                ]
                              }
                            },
                            "required": [
                              "allowed",
                              "reason"
                            ]
                          }
                        ]
                      },
                      "contactPhoneNumber": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "pattern": "^\\+[1-9][0-9]{6,14}$",
                        "description": "Business contact guidance in contact_business mode; null for self-service. Separate from the WhatsApp sending identity."
                      }
                    },
                    "required": [
                      "computedAt",
                      "validUntil",
                      "cancel",
                      "reschedule"
                    ]
                  },
                  "externalReference": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "minLength": 1,
                    "maxLength": 120,
                    "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,119}$",
                    "description": "Original immutable integration-scoped booking reference, retained across replacement/reschedule and key rotation. Null when no reference was provided; optional during rolling v1."
                  },
                  "approvalRequired": {
                    "type": "boolean",
                    "description": "Customer request requiring a clinic decision. Existing appointments and manually entered appointments are preserved."
                  },
                  "timeProposal": {
                    "anyOf": [
                      {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "proposalId": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "appointmentVersion": {
                            "type": "string",
                            "pattern": "^a(?:0|[1-9][0-9]{0,18})$",
                            "description": "Opaque physical appointment revision, a0 through a9223372036854775807. Preserve exactly; this is distinct from website lineage versions."
                          },
                          "startAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "endAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "expiresAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "state": {
                            "enum": [
                              "offered",
                              "accepted",
                              "declined"
                            ]
                          }
                        },
                        "required": [
                          "proposalId",
                          "appointmentVersion",
                          "startAt",
                          "endAt",
                          "expiresAt",
                          "state"
                        ],
                        "description": "Version-bound alternative for a pending request. The original keeps its slot; the alternative is not held. Acceptance rechecks capacity and creates one confirmed successor preserving accepted terms. Expired or replaced offers cannot be accepted."
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "bookingId",
                  "version",
                  "status",
                  "startAt",
                  "endAt",
                  "snapshot",
                  "replayed"
                ]
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "eventId",
              "sequence",
              "type",
              "booking",
              "createdAt"
            ]
          }
        },
        "nextCursor": {
          "type": "string",
          "format": "uuid"
        },
        "hasMore": {
          "type": "boolean"
        },
        "watermark": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "kind",
        "events",
        "nextCursor",
        "hasMore",
        "watermark"
      ]
    }
  ]
}

Errors and recovery

Error responses declared in the contract (10)

The preview contract shares generic error definitions across operations. This list is not an exhaustive list of runtime errors.

401 · Structured error.

application/json · Error

  • errorobjectRequired
    View nested fields
    • codestringRequired
    • requestIdstring · uuidRequired
    • retryAfterintegerOptional

      minimum: 1

    • additionalPropertiesno value allowedSchema rule
  • additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "error": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string"
        },
        "requestId": {
          "type": "string",
          "format": "uuid"
        },
        "retryAfter": {
          "type": "integer",
          "minimum": 1
        }
      },
      "required": [
        "code",
        "requestId"
      ]
    }
  },
  "required": [
    "error"
  ]
}
403 · Structured error.

application/json · Error

  • errorobjectRequired
    View nested fields
    • codestringRequired
    • requestIdstring · uuidRequired
    • retryAfterintegerOptional

      minimum: 1

    • additionalPropertiesno value allowedSchema rule
  • additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "error": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string"
        },
        "requestId": {
          "type": "string",
          "format": "uuid"
        },
        "retryAfter": {
          "type": "integer",
          "minimum": 1
        }
      },
      "required": [
        "code",
        "requestId"
      ]
    }
  },
  "required": [
    "error"
  ]
}
404 · Structured error.

application/json · Error

  • errorobjectRequired
    View nested fields
    • codestringRequired
    • requestIdstring · uuidRequired
    • retryAfterintegerOptional

      minimum: 1

    • additionalPropertiesno value allowedSchema rule
  • additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "error": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string"
        },
        "requestId": {
          "type": "string",
          "format": "uuid"
        },
        "retryAfter": {
          "type": "integer",
          "minimum": 1
        }
      },
      "required": [
        "code",
        "requestId"
      ]
    }
  },
  "required": [
    "error"
  ]
}
409 · Structured error.

application/json · Error

  • errorobjectRequired
    View nested fields
    • codestringRequired
    • requestIdstring · uuidRequired
    • retryAfterintegerOptional

      minimum: 1

    • additionalPropertiesno value allowedSchema rule
  • additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "error": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string"
        },
        "requestId": {
          "type": "string",
          "format": "uuid"
        },
        "retryAfter": {
          "type": "integer",
          "minimum": 1
        }
      },
      "required": [
        "code",
        "requestId"
      ]
    }
  },
  "required": [
    "error"
  ]
}
410 · Structured error.

application/json · Error

  • errorobjectRequired
    View nested fields
    • codestringRequired
    • requestIdstring · uuidRequired
    • retryAfterintegerOptional

      minimum: 1

    • additionalPropertiesno value allowedSchema rule
  • additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "error": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string"
        },
        "requestId": {
          "type": "string",
          "format": "uuid"
        },
        "retryAfter": {
          "type": "integer",
          "minimum": 1
        }
      },
      "required": [
        "code",
        "requestId"
      ]
    }
  },
  "required": [
    "error"
  ]
}
412 · Structured error.

application/json · Error

  • errorobjectRequired
    View nested fields
    • codestringRequired
    • requestIdstring · uuidRequired
    • retryAfterintegerOptional

      minimum: 1

    • additionalPropertiesno value allowedSchema rule
  • additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "error": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string"
        },
        "requestId": {
          "type": "string",
          "format": "uuid"
        },
        "retryAfter": {
          "type": "integer",
          "minimum": 1
        }
      },
      "required": [
        "code",
        "requestId"
      ]
    }
  },
  "required": [
    "error"
  ]
}
422 · Structured error.

application/json · Error

  • errorobjectRequired
    View nested fields
    • codestringRequired
    • requestIdstring · uuidRequired
    • retryAfterintegerOptional

      minimum: 1

    • additionalPropertiesno value allowedSchema rule
  • additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "error": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string"
        },
        "requestId": {
          "type": "string",
          "format": "uuid"
        },
        "retryAfter": {
          "type": "integer",
          "minimum": 1
        }
      },
      "required": [
        "code",
        "requestId"
      ]
    }
  },
  "required": [
    "error"
  ]
}
428 · Structured error.

application/json · Error

  • errorobjectRequired
    View nested fields
    • codestringRequired
    • requestIdstring · uuidRequired
    • retryAfterintegerOptional

      minimum: 1

    • additionalPropertiesno value allowedSchema rule
  • additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "error": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string"
        },
        "requestId": {
          "type": "string",
          "format": "uuid"
        },
        "retryAfter": {
          "type": "integer",
          "minimum": 1
        }
      },
      "required": [
        "code",
        "requestId"
      ]
    }
  },
  "required": [
    "error"
  ]
}
429 · Rate limit; honor Retry-After.

application/json · Error

  • errorobjectRequired
    View nested fields
    • codestringRequired
    • requestIdstring · uuidRequired
    • retryAfterintegerOptional

      minimum: 1

    • additionalPropertiesno value allowedSchema rule
  • additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "error": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string"
        },
        "requestId": {
          "type": "string",
          "format": "uuid"
        },
        "retryAfter": {
          "type": "integer",
          "minimum": 1
        }
      },
      "required": [
        "code",
        "requestId"
      ]
    }
  },
  "required": [
    "error"
  ]
}
503 · Outcome may be unknown. Keep operation key and reconcile.

application/json · Error

  • errorobjectRequired
    View nested fields
    • codestringRequired
    • requestIdstring · uuidRequired
    • retryAfterintegerOptional

      minimum: 1

    • additionalPropertiesno value allowedSchema rule
  • additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "error": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "code": {
          "type": "string"
        },
        "requestId": {
          "type": "string",
          "format": "uuid"
        },
        "retryAfter": {
          "type": "integer",
          "minimum": 1
        }
      },
      "required": [
        "code",
        "requestId"
      ]
    }
  },
  "required": [
    "error"
  ]
}