---
title: "Create a topic"
method: POST
path: "/topics"
tags: ["Topics"]
---

# Create a topic

`POST /topics`

## Request

- Base URL: `https://api.eusend.dev`
- URL: `https://api.eusend.dev/topics`
- Auth: HTTP bearer

A topic is a kind of email a contact can subscribe to and leave independently of the audience they sit on, so an unsubscribe becomes a preference change rather than losing the contact. The default subscription is fixed at creation.

## Request body

- CreateTopicRequest
  - `name` string, required: What the recipient reads on the unsubscribe page. Unique within the organization.
  - `default_subscription` 'opt_in' | 'opt_out', required: `opt_in` reaches everyone until they unsubscribe; `opt_out` reaches nobody until they explicitly subscribe. **Cannot be changed after creation** — flipping it would start mailing every contact who never asked, and nothing stored says which of them would have agreed.
  - `description` string, nullable
  - `visibility` 'public' | 'private': Whether the topic is listed on the hosted unsubscribe page to a contact who is not already opted in. A contact who explicitly opted in always sees it.

## Response `201`

Created.

- Topic
  - `id` string, uuid, required
  - `name` string, required
  - `description` string, nullable, required
  - `defaultSubscription` 'opt_in' | 'opt_out', required: What a contact who has never expressed a preference receives. Fixed at creation.
  - `visibility` 'public' | 'private', required
  - `subscriberCount` integer: Contacts who explicitly opted in. Returned by create and list, not by get. For an `opt_out` topic this is the reachable audience; for an `opt_in` topic it is not, since everyone who never chose is subscribed too.
  - `createdAt` string, date-time, required
  - `updatedAt` string, date-time, nullable

## Other responses

- `400`: The request body or query failed validation (`VALIDATION_ERROR`).
- `401`: Missing, malformed, or revoked API key (`UNAUTHORIZED`).
- `403`: The key exists but may not reach this resource — a `sending_access` key outside the send paths, a test-mode key writing live state, or an account on hold (`FORBIDDEN`, `ACCOUNT_RESTRICTED`).
- `409`: A topic with that name already exists (`CONFLICT`).
- `429`: Rate limit exceeded (`RATE_LIMITED`).
- `500`: Unexpected server error (`INTERNAL_ERROR`). Carries `request_id`.

---

[API](https://skmtc.dev/eusend/apis/eusend-api.md) · [All operations](https://skmtc.dev/eusend/apis/eusend-api/llms.txt) · [OpenAPI document](https://skmtc.dev/eusend/apis/eusend-api/revisions/bec561f55488?raw)
