API · Topics
Create Topic
Create a topic to manage subscription preferences (requires full access). Your team can have up to 100 topics.
/topicsFull accessRequest parameters
| Parameter | Type | Description |
|---|---|---|
Idempotency-Keyheader · optional | string1–256 characters | Makes the request safe to retry. See Idempotency. |
namebody · required | string | Topic name, up to 50 characters. |
descriptionbody · optional | string | null | Topic description, up to 200 characters, defaulting to an empty string. |
visibilitybody · optional | "public" | "private" | null | Visibility, defaulting to private; public topics appear for all contacts and private topics only for opted-in contacts on the unsubscribe page. |
default_subscriptionbody · 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.
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.
{
"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.