# Add contact to audience

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

Puts a contact of the workspace into an audience. A contact can be in many, and one that is already in it stays as it is.

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 audience. Up to 64 characters.
- `contact` (string, required): The id of the contact, or their address. 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` ("contact"): Always `contact`.
- `id` (string): The id of the contact.
- `email` (string): The address of the contact. A workspace holds an address once.
- `firstName` (string): The first name of the contact. Empty when it is not known.
- `lastName` (string): The last name of the contact. Empty when it is not known.
- `status` (string): `subscribed` while the contact gets broadcasts, `unsubscribed` after they leave. One of: `subscribed`, `unsubscribed`.
- `unsubscribedAt` (string | null): When the contact unsubscribed, or `null`.
- `properties` (Record<string, string | number | boolean>): Values of your own on the contact, by name. Automations can test them, and broadcasts and automations fill `{{name}}` slots with them.
- `audienceIds` (string[]): The ids of the audiences the contact is in.
- `topics` (Record<string, string>): What the contact chose for a topic, by the id of the topic: `opt_in` or `opt_out`. A topic that is not here follows its own default.
- `createdAt` (string): When the contact was added.

## Example

TypeScript:

```ts
await opensend.audiences.join('aud_02', {
  contact: 'ada@example.com',
})
```

CLI:

```bash
opensend audiences join aud_02 --contact ada@example.com
```

Answer:

```json
{
  "object": "contact",
  "id": "con_486cf92a1e02a43d335e2ff1",
  "email": "ada@example.com",
  "firstName": "Ada",
  "lastName": "Lovelace",
  "status": "subscribed",
  "unsubscribedAt": null,
  "properties": {},
  "audienceIds": [
    "aud_01",
    "aud_02"
  ],
  "topics": {},
  "createdAt": "2026-11-27T09:30:00.000Z"
}
```
