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

Preview a block change

Preview create/update/release block

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

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

POST/v1/management/block-change-previews

Behavior

Send one action body. Create requires exactly one period form and omits blockId/expectedVersion. Update requires blockId, current numeric expectedVersion and a complete replacement period; include reason to retain or change it, because omission clears the previous text. Release requires blockId/expectedVersion and accepts no period or reason. Optional providerId on update/release must match the existing resource. Review the preview before committing its previewId.

Authentication

ManagementCredential

Credential rules

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

blocks:write

The credential must explicitly grant the block’s business or provider resource. Changing a block owned by another origin also requires blocks:write:any.

Request

Request body · required

application/json · BlockProposal

Choose exactly one action. Create and update require either localDate or both explicit-offset startAt and endAt, never both forms. Update and release require the current blockId and expectedVersion. Update replaces the period and reason; omitting reason clears its previous value. An optional providerId on update/release must match the existing resource. Release accepts no period or reason. Interval bounds, current versions, resource grants and appointment impacts are checked by the server.

Exactly one of these variants must match.

  • oneOf 1 · action = "create"object; oneOf (unspecified | unspecified)Schema branch

    Exactly one of these variants must match.

    View branch fields and rules
    • actionstringRequired in this branch

      Value: "create"

    • providerIdanyOf (string | null)Optional in this branch

      At least one of these variants must match.

      View nested fields
      • anyOf 1string · uuidSchema branch
      • anyOf 2nullSchema branch
    • startAtstring · date-timeOptional in this branch
    • endAtstring · date-timeOptional in this branch
    • localDatestring · dateOptional in this branch
    • reasonstringOptional in this branch

      maxLength: 250

    • oneOf 1unspecifiedSchema branch
      View branch fields and rules
      • localDateunspecifiedRequired in this branch

        Presence constraint in this rule; evaluate its enclosing condition or negation. The field’s type may be defined elsewhere.

      • notanyOf (unspecified | unspecified)Schema rule

        At least one of these variants must match.

        This rule must not match.

        View branch fields and rules
        • anyOf 1unspecifiedSchema branch
          View branch fields and rules
          • startAtunspecifiedPart of a negated rule

            Presence constraint in this rule; evaluate its enclosing condition or negation. The field’s type may be defined elsewhere.

        • anyOf 2unspecifiedSchema branch
          View branch fields and rules
          • endAtunspecifiedPart of a negated rule

            Presence constraint in this rule; evaluate its enclosing condition or negation. The field’s type may be defined elsewhere.

    • oneOf 2unspecifiedSchema branch
      View branch fields and rules
      • startAtunspecifiedRequired in this branch

        Presence constraint in this rule; evaluate its enclosing condition or negation. The field’s type may be defined elsewhere.

      • endAtunspecifiedRequired in this branch

        Presence constraint in this rule; evaluate its enclosing condition or negation. The field’s type may be defined elsewhere.

      • notunspecifiedSchema rule

        This rule must not match.

        View branch fields and rules
        • localDateunspecifiedPart of a negated rule

          Presence constraint in this rule; evaluate its enclosing condition or negation. The field’s type may be defined elsewhere.

    • additionalPropertiesno value allowedSchema rule
  • oneOf 2 · action = "update"object; oneOf (unspecified | unspecified)Schema branch

    Exactly one of these variants must match.

    View branch fields and rules
    • actionstringRequired in this branch

      Value: "update"

    • providerIdanyOf (string | null)Optional in this branch

      At least one of these variants must match.

      View nested fields
      • anyOf 1string · uuidSchema branch
      • anyOf 2nullSchema branch
    • blockIdstring · uuidRequired in this branch
    • expectedVersionintegerRequired in this branch

      minimum: 1

    • startAtstring · date-timeOptional in this branch
    • endAtstring · date-timeOptional in this branch
    • localDatestring · dateOptional in this branch
    • reasonstringOptional in this branch

      maxLength: 250

    • oneOf 1unspecifiedSchema branch
      View branch fields and rules
      • localDateunspecifiedRequired in this branch

        Presence constraint in this rule; evaluate its enclosing condition or negation. The field’s type may be defined elsewhere.

      • notanyOf (unspecified | unspecified)Schema rule

        At least one of these variants must match.

        This rule must not match.

        View branch fields and rules
        • anyOf 1unspecifiedSchema branch
          View branch fields and rules
          • startAtunspecifiedPart of a negated rule

            Presence constraint in this rule; evaluate its enclosing condition or negation. The field’s type may be defined elsewhere.

        • anyOf 2unspecifiedSchema branch
          View branch fields and rules
          • endAtunspecifiedPart of a negated rule

            Presence constraint in this rule; evaluate its enclosing condition or negation. The field’s type may be defined elsewhere.

    • oneOf 2unspecifiedSchema branch
      View branch fields and rules
      • startAtunspecifiedRequired in this branch

        Presence constraint in this rule; evaluate its enclosing condition or negation. The field’s type may be defined elsewhere.

      • endAtunspecifiedRequired in this branch

        Presence constraint in this rule; evaluate its enclosing condition or negation. The field’s type may be defined elsewhere.

      • notunspecifiedSchema rule

        This rule must not match.

        View branch fields and rules
        • localDateunspecifiedPart of a negated rule

          Presence constraint in this rule; evaluate its enclosing condition or negation. The field’s type may be defined elsewhere.

    • additionalPropertiesno value allowedSchema rule
  • oneOf 3 · action = "release"objectSchema branch
    View branch fields and rules
    • actionstringRequired in this branch

      Value: "release"

    • providerIdanyOf (string | null)Optional in this branch

      At least one of these variants must match.

      View nested fields
      • anyOf 1string · uuidSchema branch
      • anyOf 2nullSchema branch
    • blockIdstring · uuidRequired in this branch
    • expectedVersionintegerRequired in this branch

      minimum: 1

    • additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
JSON Schema
{
  "description": "Choose exactly one action. Create and update require either localDate or both explicit-offset startAt and endAt, never both forms. Update and release require the current blockId and expectedVersion. Update replaces the period and reason; omitting reason clears its previous value. An optional providerId on update/release must match the existing resource. Release accepts no period or reason. Interval bounds, current versions, resource grants and appointment impacts are checked by the server.",
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "action": {
          "type": "string",
          "const": "create"
        },
        "providerId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ]
        },
        "startAt": {
          "type": "string",
          "format": "date-time"
        },
        "endAt": {
          "type": "string",
          "format": "date-time"
        },
        "localDate": {
          "type": "string",
          "format": "date"
        },
        "reason": {
          "type": "string",
          "maxLength": 250
        }
      },
      "required": [
        "action"
      ],
      "additionalProperties": false,
      "oneOf": [
        {
          "required": [
            "localDate"
          ],
          "not": {
            "anyOf": [
              {
                "required": [
                  "startAt"
                ]
              },
              {
                "required": [
                  "endAt"
                ]
              }
            ]
          }
        },
        {
          "required": [
            "startAt",
            "endAt"
          ],
          "not": {
            "required": [
              "localDate"
            ]
          }
        }
      ]
    },
    {
      "type": "object",
      "properties": {
        "action": {
          "type": "string",
          "const": "update"
        },
        "providerId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ]
        },
        "blockId": {
          "type": "string",
          "format": "uuid"
        },
        "expectedVersion": {
          "type": "integer",
          "minimum": 1
        },
        "startAt": {
          "type": "string",
          "format": "date-time"
        },
        "endAt": {
          "type": "string",
          "format": "date-time"
        },
        "localDate": {
          "type": "string",
          "format": "date"
        },
        "reason": {
          "type": "string",
          "maxLength": 250
        }
      },
      "required": [
        "action",
        "blockId",
        "expectedVersion"
      ],
      "additionalProperties": false,
      "oneOf": [
        {
          "required": [
            "localDate"
          ],
          "not": {
            "anyOf": [
              {
                "required": [
                  "startAt"
                ]
              },
              {
                "required": [
                  "endAt"
                ]
              }
            ]
          }
        },
        {
          "required": [
            "startAt",
            "endAt"
          ],
          "not": {
            "required": [
              "localDate"
            ]
          }
        }
      ]
    },
    {
      "type": "object",
      "properties": {
        "action": {
          "type": "string",
          "const": "release"
        },
        "providerId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ]
        },
        "blockId": {
          "type": "string",
          "format": "uuid"
        },
        "expectedVersion": {
          "type": "integer",
          "minimum": 1
        }
      },
      "required": [
        "action",
        "blockId",
        "expectedVersion"
      ],
      "additionalProperties": false
    }
  ]
}

Successful responses

200 · BlockPreview

application/json · BlockPreview

  • previewIdstring · uuidRequired
  • proposalobjectRequired
    View nested fields
    • actionstringRequired

      Allowed values: ["create","update","release"]

    • providerIdanyOf (string | null)Required

      At least one of these variants must match.

      View nested fields
      • anyOf 1string · uuidSchema branch
      • anyOf 2nullSchema branch
    • blockIdanyOf (string | null)Required

      At least one of these variants must match.

      View nested fields
      • anyOf 1string · uuidSchema branch
      • anyOf 2nullSchema branch
    • expectedVersionanyOf (integer | null)Required

      At least one of these variants must match.

      View nested fields
      • anyOf 1integerSchema branch

        minimum: 1

      • anyOf 2nullSchema branch
    • startAtanyOf (string | null)Required

      At least one of these variants must match.

      View nested fields
      • anyOf 1string · date-timeSchema branch
      • anyOf 2nullSchema branch
    • endAtanyOf (string | null)Required

      At least one of these variants must match.

      View nested fields
      • anyOf 1string · date-timeSchema branch
      • anyOf 2nullSchema branch
    • reasonanyOf (string | null)Required

      At least one of these variants must match.

      View nested fields
      • anyOf 1stringSchema branch
      • anyOf 2nullSchema branch
    • requiresAnyBlockGrantbooleanRequired
    • additionalPropertiesno value allowedSchema rule
  • affectedAppointmentsarrayRequired
    View nested fields
    • []objectArray item
      View nested fields
      • appointmentIdstring · uuidRequired
      • versionstring · date-timeRequired
      • startTimestring · date-timeRequired
      • endTimestring · date-timeRequired
      • additionalPropertiesno value allowedSchema rule
  • affectedCountintegerRequired

    minimum: 0

  • expiresAtstring · date-timeRequired
  • existingAppointmentsPreservedbooleanRequired

    Value: true

  • additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
JSON Schema
{
  "type": "object",
  "properties": {
    "previewId": {
      "type": "string",
      "format": "uuid"
    },
    "proposal": {
      "type": "object",
      "properties": {
        "action": {
          "enum": [
            "create",
            "update",
            "release"
          ]
        },
        "providerId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ]
        },
        "blockId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ]
        },
        "expectedVersion": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 1
            },
            {
              "type": "null"
            }
          ]
        },
        "startAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "endAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ]
        },
        "reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "requiresAnyBlockGrant": {
          "type": "boolean"
        }
      },
      "required": [
        "action",
        "providerId",
        "blockId",
        "expectedVersion",
        "startAt",
        "endAt",
        "reason",
        "requiresAnyBlockGrant"
      ],
      "additionalProperties": false
    },
    "affectedAppointments": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "appointmentId": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "string",
            "format": "date-time"
          },
          "startTime": {
            "type": "string",
            "format": "date-time"
          },
          "endTime": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "appointmentId",
          "version",
          "startTime",
          "endTime"
        ],
        "additionalProperties": false
      }
    },
    "affectedCount": {
      "type": "integer",
      "minimum": 0
    },
    "expiresAt": {
      "type": "string",
      "format": "date-time"
    },
    "existingAppointmentsPreserved": {
      "const": true
    }
  },
  "required": [
    "previewId",
    "proposal",
    "affectedAppointments",
    "affectedCount",
    "expiresAt",
    "existingAppointmentsPreserved"
  ],
  "additionalProperties": false
}

Errors and recovery

Input validation

  • 413REQUEST_TOO_LARGE

    The JSON request body exceeds 8,192 bytes.

  • 415JSON_REQUIRED

    Send Content-Type: application/json.

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"
  ]
}