# 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 (e.g., 'Authorization: AccessKey AbCdEfGhIjKlMnOpQrStUvWxYzAbCdEfGhIj')","scheme":"AccessKey","type":"http"}},"schemas":{"UpdateAllowBlockRule":{"properties":{"category":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/AllowBlockRuleCategory"}]},"value":{"type":"string","nullable":true},"type":{"nullable":true,"allOf":[{"$ref":"#/components/schemas/AllowBlockRuleType"}]}}},"AllowBlockRuleCategory":{"description":"The category of the AllowBlockRule.","type":"string","enum":["all","domain","domain_suffix","email"]},"AllowBlockRuleType":{"description":"The type of the AllowBlockRule.","type":"string","enum":["allow","reject","suspend"]},"AllowBlockRule":{"description":"An AllowBlockRule is a rule that allows or blocks a specific value in a specific category.","type":"object","required":["id","workspaceId","category","value","type","createdBy","createdAt","updatedBy","updatedAt"],"properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"category":{"$ref":"#/components/schemas/AllowBlockRuleCategory"},"value":{"type":"string"},"type":{"$ref":"#/components/schemas/AllowBlockRuleType"},"createdBy":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"updatedBy":{"type":"string","format":"uuid"},"updatedAt":{"type":"string","format":"date-time"}}},"NotFoundError":{"additionalProperties":false,"properties":{"code":{"type":"string","description":"A unique code that identifies the error. This code can be used to programmatically identify the error.","pattern":"^([A-Z][a-z]*)+$"},"message":{"type":"string","description":"A human-readable message that describes the error."},"details":{"type":"object","description":"Additional details about the error. This object can contain any additional information that may be useful for debugging.","additionalProperties":true}},"required":["code","message"]},"ValidationError":{"title":"A validation error description","additionalProperties":false,"properties":{"code":{"type":"string","description":"A unique code that identifies the error. This code can be used to programmatically identify the error.","pattern":"^([A-Z][a-z]*)+$"},"message":{"type":"string","description":"A human-readable message that describes the error."},"details":{"type":"object","description":"Additional details about the error. This object can contain any additional information that may be useful for debugging.","additionalProperties":true}},"required":["code","message"]}},"responses":{"AllowBlockRule":{"description":"The Allow/Block rule.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllowBlockRule"}}}},"notFound":{"description":"The resource specified in the URL was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundError"}}}},"validationFailed":{"description":"The request body did not pass validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}},"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/UpdateAllowBlockRule"}}}},"responses":{"200":{"$ref":"#/components/responses/AllowBlockRule"},"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 %}
