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

Set business customer blocking

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

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

POST/v1/management/customers/{businessCustomerId}/block

Behavior

Server only, with an owner-issued Management credential bound to one tenant/site/integration. The backend must authorize its administrator. Public intake, WhatsApp availability, customer phone verification and website customer mappings are not prerequisites. Existing contacts:record keys are not widened. Persist the exact request and its operation UUID. On an uncertain response retry that command or use its dedicated recovery route; a not_found result does not prove that an in-flight command cannot still commit. Receipts are immutable references, while current is reread under current authority and is null with contact_unavailable after deletion/reparent. Requires the separate contacts:block scope and contacts:read. isBlocked is explicit state, not a toggle. Use the current canonical If-Match version. This changes neither communication consent nor customer proof and sends no message. It does not cancel existing appointments.

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

contacts:readcontacts:block

Request

Idempotency and recovery

Persist one UUID and the exact request before sending. After an uncertain result, retain that UUID, body and preconditions; do not create a replacement operation just to retry.

  • businessCustomerIdpath · stringRequired
    Format and constraints
    businessCustomerId schema
    {
      "type": "string",
      "format": "uuid"
    }
  • Idempotency-Keyheader · stringRequired

    Persist a UUID before sending. Retry only the same UUID and exact body after an uncertain outcome.

    Format and constraints
    Idempotency-Key schema
    {
      "type": "string",
      "format": "uuid"
    }
  • If-Matchheader · stringRequired

    Quoted current canonical version from GET /management/customers/{businessCustomerId} or its ETag. Weak validators and * are refused.

    Format and constraints
    If-Match schema
    {
      "type": "string",
      "pattern": "^\"c(0|[1-9][0-9]{0,18})\"$"
    }

Request body · required

application/json · BusinessCustomerBlockPatch

  • isBlockedbooleanRequired
  • additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "isBlocked": {
      "type": "boolean"
    }
  },
  "required": [
    "isBlocked"
  ]
}

Successful responses

200 · BusinessCustomerCommandResult

Success.

application/json · BusinessCustomerCommandResult

All of these schema rules apply together.

  • receiptobjectRequired
    View nested fields
    • operationIdstring · uuidRequired
    • businessCustomerIdstring · uuidRequired
    • actionstringRequired

      Allowed values: ["basic","block","phone_correction"]

    • acceptedVersionstringRequired

      Database-owned canonical customer revision. Read a current customer and its ETag before a basic or block command. Native and API edits share this revision; no-op writes do not increment it. It is not a customer-mapping version.

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

    • additionalPropertiesno value allowedSchema rule
  • currentanyOf (object | null)Required

    At least one of these variants must match.

    View nested fields
    • anyOf 1objectSchema branch

      Current basic canonical contact projection, including unmapped and blocked contacts. An unavailable stored name/phone/language is null with its fieldUnavailableReasons entry; source data is preserved. Notes, email, arbitrary custom data, consent, customer proof and booking history are absent.

      View branch fields and rules
      • businessCustomerIdstring · uuidRequired in this branch
      • versionstringRequired in this branch

        Database-owned canonical customer revision. Read a current customer and its ETag before a basic or block command. Native and API edits share this revision; no-op writes do not increment it. It is not a customer-mapping version.

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

      • displayNamestring | nullRequired in this branch

        maxLength: 4096

      • phonestring | nullRequired in this branch

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

      • languageanyOf (string | null)Required in this branch

        At least one of these variants must match.

        View nested fields
        • anyOf 1stringSchema branch

          Allowed values: ["he","ar","en"]

        • anyOf 2nullSchema branch
      • isBlockedbooleanRequired in this branch
      • createdAtstring · date-timeRequired in this branch
      • fieldUnavailableReasonsobjectRequired in this branch
        View nested fields
        • displayNamestringOptional in this branch

          Allowed values: ["too_large","invalid_stored_value"]

        • phonestringOptional in this branch

          Allowed values: ["too_large","invalid_stored_value"]

        • languagestringOptional in this branch

          Allowed values: ["too_large","invalid_stored_value"]

        • additionalPropertiesno value allowedSchema rule
      • additionalPropertiesno value allowedSchema rule
    • anyOf 2nullSchema branch
  • currentUnavailableReasonnull | stringRequired

    Allowed values: [null,"contact_unavailable"]

  • replayedbooleanRequired
  • allOf 1unspecifiedSchema branch
    View branch fields and rules
    • ifobjectSchema rule
      View branch fields and rules
      • currentnullCondition predicate
    • thenobjectSchema rule
      View branch fields and rules
      • currentUnavailableReasonstringOptional in this branch

        Value: "contact_unavailable"

    • elseobjectSchema rule
      View branch fields and rules
      • currentUnavailableReasonnullOptional in this branch
  • additionalPropertiesno value allowedSchema rule
Complete schema and nested fields
JSON Schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "receipt": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "operationId": {
          "type": "string",
          "format": "uuid"
        },
        "businessCustomerId": {
          "type": "string",
          "format": "uuid"
        },
        "action": {
          "enum": [
            "basic",
            "block",
            "phone_correction"
          ]
        },
        "acceptedVersion": {
          "type": "string",
          "pattern": "^c(0|[1-9][0-9]{0,18})$",
          "description": "Database-owned canonical customer revision. Read a current customer and its ETag before a basic or block command. Native and API edits share this revision; no-op writes do not increment it. It is not a customer-mapping version."
        }
      },
      "required": [
        "operationId",
        "businessCustomerId",
        "action",
        "acceptedVersion"
      ]
    },
    "current": {
      "anyOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "businessCustomerId": {
              "type": "string",
              "format": "uuid"
            },
            "version": {
              "type": "string",
              "pattern": "^c(0|[1-9][0-9]{0,18})$",
              "description": "Database-owned canonical customer revision. Read a current customer and its ETag before a basic or block command. Native and API edits share this revision; no-op writes do not increment it. It is not a customer-mapping version."
            },
            "displayName": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 4096
            },
            "phone": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^\\+[1-9][0-9]{7,14}$"
            },
            "language": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "he",
                    "ar",
                    "en"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            },
            "isBlocked": {
              "type": "boolean"
            },
            "createdAt": {
              "type": "string",
              "format": "date-time"
            },
            "fieldUnavailableReasons": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "displayName": {
                  "enum": [
                    "too_large",
                    "invalid_stored_value"
                  ]
                },
                "phone": {
                  "enum": [
                    "too_large",
                    "invalid_stored_value"
                  ]
                },
                "language": {
                  "enum": [
                    "too_large",
                    "invalid_stored_value"
                  ]
                }
              },
              "required": []
            }
          },
          "required": [
            "businessCustomerId",
            "version",
            "displayName",
            "phone",
            "language",
            "isBlocked",
            "createdAt",
            "fieldUnavailableReasons"
          ],
          "description": "Current basic canonical contact projection, including unmapped and blocked contacts. An unavailable stored name/phone/language is null with its fieldUnavailableReasons entry; source data is preserved. Notes, email, arbitrary custom data, consent, customer proof and booking history are absent."
        },
        {
          "type": "null"
        }
      ]
    },
    "currentUnavailableReason": {
      "enum": [
        null,
        "contact_unavailable"
      ]
    },
    "replayed": {
      "type": "boolean"
    }
  },
  "required": [
    "receipt",
    "current",
    "currentUnavailableReason",
    "replayed"
  ],
  "allOf": [
    {
      "if": {
        "properties": {
          "current": {
            "type": "null"
          }
        },
        "required": [
          "current"
        ]
      },
      "then": {
        "properties": {
          "currentUnavailableReason": {
            "const": "contact_unavailable"
          }
        }
      },
      "else": {
        "properties": {
          "currentUnavailableReason": {
            "type": "null"
          }
        }
      }
    }
  ]
}

Errors and recovery

Error responses declared in the contract (12)

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

401 · Missing or invalid Management bearer.

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 · Current scope, grant or authority denied; browser Origin is refused.

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 · Canonical contact unavailable in this credential tenant.

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"
  ]
}
405 · Method not allowed.

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 · Operation, field value, identity or checkpoint conflict. No partial write.

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 · Current canonical version or owner grant revision changed.

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"
  ]
}
413 · Request exceeds the bounded body size.

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"
  ]
}
415 · JSON content type required.

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 · Malformed or unsupported request; no tenant/resource selector is accepted.

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 · Required operation UUID or version precondition is missing.

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 · Request/snapshot limit reached.

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 · Storage unavailable or outcome uncertain. Retain the original UUID and exact command to 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"
  ]
}