# Create topic

`opensend topics create`

Makes a kind of mail readers can say yes or no to, such as product news. A broadcast sent on a topic only reaches the contacts who get that topic.

Needs the scope: `audiences:write`

## Flags

- `--name` (string, required): A name for the topic, such as `Product news`. Up to 120 characters.
- `--description` (string): A line about what the topic is, shown to readers. Up to 300 characters.
- `--default-subscription` (string): `opt_in` when contacts get the topic unless they say no, `opt_out` when they only get it after they say yes. Without it, `opt_in`. It cannot be changed later. One of: `opt_in`, `opt_out`.
- `--visibility` (string): `public` or `private`. Without it, `public`. One of: `public`, `private`.

## Returns

The command prints the answer: as JSON when its output goes to a file or another program, and as a table or a list of fields in a terminal. When the API refuses, the error goes to the error stream and the command ends with a code that names the failure. [Output and scripts](https://opensend.sh/docs/scripting) lists the codes.

- `object` ("topic"): Always `topic`.
- `id` (string): The id of the topic.
- `name` (string): The name of the topic, as readers see it.
- `description` (string): What the topic is about, as readers see it. Empty when not set.
- `defaultSubscription` (string): What holds for a contact who never chose: `opt_in`, they get it, or `opt_out`, they do not. One of: `opt_in`, `opt_out`.
- `visibility` (string): `public` when every reader sees the topic on the page where they manage their mail, `private` when only those who chose it do. One of: `public`, `private`.
- `subscription` (string | null): What the contact you listed the topics for gets: `opt_in` or `opt_out`. `null` when you named no contact. One of: `opt_in`, `opt_out`.
- `createdAt` (string): When the topic was made.

## Example

CLI:

```bash
opensend topics create \
  --name 'Product news' \
  --description 'What we shipped, once a month.'
```

Answer:

```json
{
  "object": "topic",
  "id": "top_02",
  "name": "Product news",
  "description": "What we shipped, once a month.",
  "defaultSubscription": "opt_in",
  "visibility": "public",
  "subscription": null,
  "createdAt": "2026-11-27T09:30:00.000Z"
}
```
