# List allow/block rules

## List Allow/Block rules

> List allow/block rules. This will return a maximum of 100 rules per page, with 10 as default. You can use the \`limit\` and \`pageToken\` query parameters to paginate the results. Learn more about pagination in the Common API Usage pagination section.<br>

```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"}},"parameters":{"limit":{"name":"limit","in":"query","required":false,"schema":{"format":"int64","type":"integer"}},"pageToken":{"name":"pageToken","in":"query","required":false,"schema":{"type":"string"}},"reverse":{"name":"reverse","in":"query","required":false,"schema":{"type":"boolean"}},"AllowBlockRuleType":{"name":"type","description":"Allow/Block type","in":"query","schema":{"$ref":"#/components/schemas/AllowBlockRuleType"}},"AllowBlockRuleCategory":{"name":"category","description":"Allow/Block category","in":"query","schema":{"$ref":"#/components/schemas/AllowBlockRuleCategory"}},"AllowBlockRuleValue":{"name":"value","description":"Allow/Block value","in":"query","schema":{"type":"string"}}},"schemas":{"AllowBlockRuleType":{"description":"The type of the AllowBlockRule.","type":"string","enum":["allow","reject","suspend"]},"AllowBlockRuleCategory":{"description":"The category of the AllowBlockRule.","type":"string","enum":["all","domain","domain_suffix","email"]},"responseBody":{"type":"object","title":"PaginatedList","description":"A list of results that supports pagination.","properties":{"nextPageToken":{"type":"string","description":"The token to fetch the next page of results. If empty, there are no more results to fetch."}}},"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"}}}},"responses":{"AllowBlockRuleList":{"description":"A paginated list of Allow/Block rules.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/responseBody"},{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/AllowBlockRule"}}},"required":["results"]}]}}}}}},"paths":{"/workspaces/{workspaceId}/conversation-allowblock-rules":{"get":{"summary":"List Allow/Block rules","operationId":"listAllowBlockRules","description":"List allow/block rules. This will return a maximum of 100 rules per page, with 10 as default. You can use the `limit` and `pageToken` query parameters to paginate the results. Learn more about pagination in the Common API Usage pagination section.\n","tags":["email_allowblock_rules"],"parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/pageToken"},{"$ref":"#/components/parameters/reverse"},{"$ref":"#/components/parameters/AllowBlockRuleType"},{"$ref":"#/components/parameters/AllowBlockRuleCategory"},{"$ref":"#/components/parameters/AllowBlockRuleValue"}],"responses":{"200":{"$ref":"#/components/responses/AllowBlockRuleList"}}}}}}
```

## Examples

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

```bash
curl "https://api.bird.com/workspaces/e58899bf-1e8d-4ff7-b9db-a60befaf90d2/conversation-allowblock-rules" \
-H "Authorization: AccessKey abcd"
```

{% endtab %}

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

```json
{
  "results": [
    {
      "id": "01937899-aa2c-7224-bf2b-db9ca8f6362c",
      "workspaceId": "6b1908bd-2bc7-409e-bab4-ccfcd3ec69b9",
      "category": "email",
      "value": "test@example.com",
      "type": "allow",
      "createdBy": "00000000-0000-0000-0000-000000000000",
      "createdAt": "2024-11-29T15:45:56.780546536Z",
      "updatedBy": "00000000-0000-0000-0000-000000000000",
      "updatedAt": "2024-11-29T15:45:56.780546536Z"
    },
    {
      "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 %}

**Note**: if there are more than 10 allow/block rules, the results may be paginated. Please refer to [Pagination](https://docs.bird.com/api/api-access/common-api-usage#pagination) on how to use `nextPageToken`.
