# Set who a page is shown to

Works out who on a page a blast would reach. `:mode` is `preview` — the counts plus a small sample, 10 rows by default and at most 25 — or `resolve`, the full list the send will use, 500 by default and at most 2500 with a `truncated` flag; any other word is a 404. The body narrows by `row_ids`, `statuses`, `tags`, `search`, `state`, `send_type`, `has_email`, `has_phone`, `require_any_contact` and `exclude_do_not_contact`, and the summary counts how many are reachable by email, by SMS and by both. A body that selects nothing answers `no_selection` rather than the whole page, and archived records are never included.

Access class: `def:read`.

## Endpoint

`POST /v1/definitions/{key}/audience/{mode}`

## Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| key | path | string | Yes |
| mode | path | string | Yes |

## Request body

Content type: `application/json`.

```json
{
  "body": {
    "exclude_do_not_contact": true,
    "has_email": true,
    "has_phone": true,
    "limit": 1,
    "require_any_contact": true,
    "row_ids": [
      "string"
    ],
    "sample_limit": 1,
    "search": "string",
    "send_type": "string",
    "state": "string",
    "statuses": [
      "string"
    ],
    "tags": [
      "string"
    ]
  },
  "params": {
    ":key": "string",
    ":mode": "string"
  },
  "query": {}
}
```

## Responses

### 201

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "limit": 1,
    "no_selection": true,
    "rows": [
      {
        "archived_at": "string",
        "assignees": "string",
        "cells": "string",
        "createdBy": "string",
        "display": "string",
        "externalId": "",
        "groupId": "",
        "id": "",
        "position": "string",
        "source": "string"
      }
    ],
    "summary": {
      "email_and_sms_eligible": 1,
      "email_eligible": 1,
      "sms_eligible": 1,
      "total": 1
    },
    "truncated": true
  }
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
