# 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","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"}}},"schemas":{"conversations.allowblock.rule.type":{"description":"The type of the AllowBlockRule.","enum":["allow","reject","suspend"],"type":"string"},"conversations.allowblock.rule.category":{"description":"The category of the AllowBlockRule.","enum":["all","domain","domain_suffix","email"],"type":"string"},"common.paginated_list.response_body":{"description":"A list of results that supports pagination.","properties":{"nextPageToken":{"description":"The token to fetch the next page of results. If empty, there are no more results to fetch.","type":"string"}},"title":"PaginatedList","type":"object"},"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"}}},"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"},{"name":"type","description":"Allow/Block type","in":"query","schema":{"$ref":"#/components/schemas/conversations.allowblock.rule.type"}},{"name":"category","description":"Allow/Block category","in":"query","schema":{"$ref":"#/components/schemas/conversations.allowblock.rule.category"}},{"name":"value","description":"Allow/Block value","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"A paginated list of Allow/Block rules.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/common.paginated_list.response_body"},{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/conversations.allowblock.rule"}}},"required":["results"]}]}}}}}}}}}
```

## 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`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bird.com/api/conversations-api/api-reference/workspace-settings/list-allow-block-rules.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
