Skip to main content
POST
Create a subscription type

Authorizations

Authorization
string
header
required

Project-scoped secret API key (sk_…). Pass in the Authorization: Bearer <key> header. Grants access to the project the key was issued for.

Body

application/json

Create a new subscription type.

name
string
required

Human-readable subscription-type name.

Minimum string length: 1
Example:

"Weekly newsletter"

channel
enum<string>
required

Delivery channel a subscription type covers.

Available options:
email,
text,
push,
webhook,
in_app
Example:

"email"

is_public
boolean

Whether to expose this subscription type on customer-facing preference centres. Defaults to true.

Response

The newly created subscription type.

A named opt-in channel a user can subscribe to. Used to drive sends and customer-facing preference centres. Distinct from a user’s per-channel subscription state.

id
integer
required

Numeric subscription-type identifier.

Example:

7

project_id
integer
required

Identifier of the owning project.

Example:

42

name
string
required

Human-readable subscription-type name shown on preference centres.

Example:

"Weekly newsletter"

channel
enum<string>
required

Delivery channel a subscription type covers.

Available options:
email,
text,
push,
webhook,
in_app
Example:

"email"

is_public
boolean
required

Whether this subscription type is shown on customer-facing preference centres.

created_at
string | null
required

Time the subscription type was created. ISO 8601.

updated_at
string | null
required

Time the subscription type was last modified. ISO 8601.