# Set who sees a messenger

```http
PATCH https://trydimmi.com/api/v1/widget-settings/{widget}/audiences
```

## Authorization

Send an API token as `Authorization: Bearer <token>`.
The token needs: `settings:write`.

## Path parameters

- `widget` (string, required): Id of the messenger, starting with wgt_, such as wgt_01jx2m8k4t. Find it with GET /widget-settings.

## Body

- `launcher` (any): An audience rule for who sees the launcher; null means everyone.
- `start` (any): An audience rule for who may start a conversation; null means everyone.
- `tabs` (object): A rule per tab, keyed help or changelog.

## Response 200 (OK)

- `data` (object, required)
  - `object` (string, required): The kind of record this is, the same for every record of its kind, such as article.
  - `rules` (any, required): The messenger's audience rules as stored, a JSON object with launcher (who sees the launcher), start (who may start a conversation) and tabs (who sees each tab).

## Response default (Error)

- `code` (string, required): Stable code for programs to tell errors apart, such as validation_failed or internal_error.
- `errors` (object): Each rejected field mapped to its messages. Only present when the input was invalid.
- `message` (string, required): What went wrong, in words safe to show a person.

## Example request

```bash
curl --request PATCH \
  --url 'https://trydimmi.com/api/v1/widget-settings/{widget}/audiences' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "launcher": null,
  "start": null,
  "tabs": {
    "<key>": null
  }
}'
```

## Example response

```json
{
  "data": {
    "object": "<string>",
    "rules": null
  }
}
```

---

Index of all dimmi docs: https://trydimmi.com/llms.txt (full text: https://trydimmi.com/llms-full.txt)
