# Rename audience

`opensend.audiences.update(id, input)`

Gives an audience another name. Its contacts and its broadcasts stay as they are.

Needs the scope: `audiences:write`

## Input

`id` goes first, on its own, and the rest in one object. One object that holds `id` works too.

- `id` (string, required): The id of the item. Up to 64 characters.
- `name` (string, required): The new name of the audience. Up to 120 characters.

## Returns

The call resolves to the answer, already parsed. A call the API refuses throws `OpenSendError` with the code and the message of the answer. [SDK](https://opensend.sh/docs/sdk) lists the errors of the client itself.

- `object` ("audience"): Always `audience`.
- `id` (string): The id of the audience.
- `name` (string): The name of the audience.
- `contacts` (integer): How many contacts are in it.
- `subscribed` (integer): How many of them are subscribed.
- `unsubscribed` (integer): How many of them have unsubscribed.
- `createdAt` (string): When the audience was made.

## Example

TypeScript:

```ts
await opensend.audiences.update('aud_03', {
  name: 'Early access',
})
```

CLI:

```bash
opensend audiences update aud_03 --name 'Early access'
```

Answer:

```json
{
  "object": "audience",
  "id": "aud_03",
  "name": "Early access",
  "contacts": 248,
  "subscribed": 244,
  "unsubscribed": 4,
  "createdAt": "2026-11-22T09:30:00.000Z"
}
```
