Skip to documentation

API · Topics

Create Topic

Create a topic to manage subscription preferences (requires full access). Your team can have up to 100 topics.

POST/topicsFull access

Request parameters

ParameterTypeDescription
Idempotency-Key
header · optional
string
1–256 characters
Makes the request safe to retry. See Idempotency.
name
body · required
stringTopic name, up to 50 characters.
description
body · optional
string | nullTopic description, up to 200 characters, defaulting to an empty string.
visibility
body · optional
"public" | "private" | nullVisibility, defaulting to private; public topics appear for all contacts and private topics only for opted-in contacts on the unsubscribe page.
default_subscription
body · required
"opt_in" | "opt_out"Default subscription: opt_in subscribes contacts and opt_out does not; this setting cannot be changed after creation.

Request example

Set OPENSEND_BASE_URL=https://api.example.com and OPENSEND_API_KEY=os_replace_me on your server.

bash
curl -X POST "$OPENSEND_BASE_URL/topics" \
  -H "Authorization: Bearer $OPENSEND_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"name":"Updates","default_subscription":"opt_in","visibility":"public"}'

Response

201 · application/json. Example IDs stand for IDs returned by your installation.

json
{
  "object": "topic",
  "id": "YOUR_ID"
}

Behavior and errors

At most 100 topics per team. visibility defaults to private; The SDK’s types have no visibility option, so set it with opensend.post("/topics", …) or over HTTP as the cURL example does. Explicit contact preferences override defaults. The dashboard names the consent mode inversely to the API subscription value.

Use a full-access credential. Resource IDs belong to your team; an unknown or foreign resource returns 404. See authentication, errors, rate limits, and compatibility for the shared contract.