Create allow/block rule

Create Allow/Block Rule

post

Allow/Block rules are an abuse prevention mechanism that allows you to define an allow-list and a block-list indicating whether a conversation can be start for a given contact.

Authorizations
Path parameters
workspaceIdstring · uuidrequired

The workspace ID

Example: b4e02c85-c6d2-4b15-8885-e09671799c61
Body
categorystring · enumrequired

The category of the AllowBlockRule.

Options: all, domain, domain_suffix, email
valuestringrequired
typestring · enumrequired

The type of the AllowBlockRule.

Options: allow, reject, suspend
Responses
curl -L \
  --request POST \
  --url 'https://api.bird.com/workspaces/{workspaceId}/conversation-allowblock-rules' \
  --header 'Authorization: Bearer JWT' \
  --header 'Content-Type: application/json' \
  --data '{
    "category": "all",
    "value": "text",
    "type": "allow"
  }'
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "workspaceId": "123e4567-e89b-12d3-a456-426614174000",
  "category": "all",
  "value": "text",
  "type": "allow",
  "createdBy": "123e4567-e89b-12d3-a456-426614174000",
  "createdAt": "2025-03-29T04:45:52.495Z",
  "updatedBy": "123e4567-e89b-12d3-a456-426614174000",
  "updatedAt": "2025-03-29T04:45:52.495Z"
}

Examples

curl -X POST "https://api.bird.com/workspaces/a1405560-c8d3-4b1a-877d-3f449ad95352/conversation-allowblock-rules" \
-H "Content-Type: application/json" \
-H "Authorization: AccessKey abcd" \
-d '{
  "category": "domain",
  "value": "test.com",
  "type": "reject"
}'

Last updated

Was this helpful?