> For the complete documentation index, see [llms.txt](https://docs.bird.com/api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bird.com/api/conversations-api/api-reference/workspace-settings/update-allow-block-rule.md).

# Update allow/block rule

## PATCH /workspaces/{workspaceId}/conversation-allowblock-rules/{allowBlockRuleId}

> Update Allow/Block rule

```json
{"openapi":"3.0.3","info":{"title":"Conversations","version":"v1"},"tags":[{"name":"email_allowblock_rules","description":"Manage Allow/Block rules for your inbox"}],"servers":[{"url":"https://api.bird.com","description":"Production API"}],"security":[{"accessKey":[]}],"components":{"securitySchemes":{"accessKey":{"description":"Uses the Authorization header: 'AccessKey ' followed by your access key token","scheme":"AccessKey","type":"http"}},"schemas":{"conversations.allowblock.rule.update":{"properties":{"category":{"allOf":[{"$ref":"#/components/schemas/conversations.allowblock.rule.category"}],"nullable":true},"type":{"allOf":[{"$ref":"#/components/schemas/conversations.allowblock.rule.type"}],"nullable":true},"value":{"nullable":true,"type":"string"}}},"conversations.allowblock.rule.category":{"description":"The category of the AllowBlockRule.","enum":["all","domain","domain_suffix","email"],"type":"string"},"conversations.allowblock.rule.type":{"description":"The type of the AllowBlockRule.","enum":["allow","reject","suspend"],"type":"string"},"conversations.allowblock.rule":{"description":"An AllowBlockRule is a rule that allows or blocks a specific value in a specific category.","properties":{"category":{"$ref":"#/components/schemas/conversations.allowblock.rule.category"},"createdAt":{"format":"date-time","type":"string"},"createdBy":{"format":"uuid","type":"string"},"id":{"format":"uuid","type":"string"},"type":{"$ref":"#/components/schemas/conversations.allowblock.rule.type"},"updatedAt":{"format":"date-time","type":"string"},"updatedBy":{"format":"uuid","type":"string"},"value":{"type":"string"},"workspaceId":{"format":"uuid","type":"string"}},"required":["id","workspaceId","category","value","type","createdBy","createdAt","updatedBy","updatedAt"],"type":"object"},"error.detailed":{"additionalProperties":false,"description":"An error returned from the API that includes additional details about the error. The `details` property can contain any additional information about the error that may be helpful for debugging or understanding the error.\n","properties":{"code":{"description":"A unique code that identifies the error. This code can be used to programmatically identify the error.","minLength":3,"type":"string"},"details":{"additionalProperties":true,"description":"Any additional information about the error that may be helpful for debugging or understanding the error.","type":"object"},"message":{"description":"A human-readable message that describes the error.","minLength":1,"type":"string"}},"required":["code","message"],"title":"DetailedError","type":"object"},"error.validation":{"additionalProperties":false,"description":"A validation error returned from the API. The `details` map keys are JSON paths\npointing into the request body / parameters; values are arrays of human-readable\nmessages describing each problem with that path.\n","properties":{"code":{"description":"A unique code that identifies the error. This code can be used to programmatically identify the error.","minLength":3,"type":"string"},"details":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"description":"Per-field validation messages keyed by JSON path.","type":"object"},"message":{"description":"A human-readable message that describes the error.","minLength":1,"type":"string"}},"required":["code","message"],"title":"ValidationError","type":"object"}},"responses":{"conversations.response.allowblock.rule":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/conversations.allowblock.rule"}}},"description":"The Allow/Block rule."},"notFound":{"$ref":"#/components/responses/error.response.not_found"},"error.response.not_found":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.detailed"}}},"description":"The requested resource was not found."},"validationFailed":{"$ref":"#/components/responses/error.response.invalid_request"},"error.response.invalid_request":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.validation"}}},"description":"The request contains invalid parameters or body fields."}}},"paths":{"/workspaces/{workspaceId}/conversation-allowblock-rules/{allowBlockRuleId}":{"patch":{"summary":"Update Allow/Block rule","operationId":"updateAllowBlockRule","tags":["email_allowblock_rules"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/conversations.allowblock.rule.update"}}}},"responses":{"200":{"$ref":"#/components/responses/conversations.response.allowblock.rule"},"404":{"$ref":"#/components/responses/notFound"},"422":{"$ref":"#/components/responses/validationFailed"}}}}}}
```

## Examples

{% tabs %}
{% tab title="Request" %}

```bash
curl -X PATCH "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"
}'
```

{% endtab %}

{% tab title="Response (200 - OK)" %}

```json
{
  "id": "01937888-e7c4-79dd-af1f-c00d91a0f3a6",
  "workspaceId": "6b1908bd-2bc7-409e-bab4-ccfcd3ec69b9",
  "category": "domain",
  "value": "test.com",
  "type": "reject",
  "createdBy": "00000000-0000-0000-0000-000000000000",
  "createdAt": "2024-11-29T15:27:38.436082756Z",
  "updatedBy": "00000000-0000-0000-0000-000000000000",
  "updatedAt": "2024-11-29T15:27:38.436082756Z"
}
```

{% endtab %}
{% endtabs %}
