Skip to main content
POST
/
subscriptions
Create a subscription type
curl --request POST \
  --url https://apix.spotzee.com/api/client/subscriptions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Weekly newsletter",
  "channel": "email"
}
'
{
  "id": 7,
  "project_id": 42,
  "name": "Weekly newsletter",
  "channel": "email",
  "is_public": true,
  "created_at": "<string>",
  "updated_at": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.spotzee.com/llms.txt

Use this file to discover all available pages before exploring further.

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 false.

Response

The newly created subscription type.

A named opt-in channel a contact can subscribe to. Used to drive sends and customer-facing preference centres. Distinct from a contact’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.