Subscribe to a topic

Subscribes the authenticated user to the given topic. The request
body is the subscription's context and is validated before it is
stored: it must be a JSON object matching the topic's context JSON
Schema, any dataset it references (organizationId + datasetId)
must exist, a subjectUserId must be the caller's own id, and an
organization it is scoped to without a dataset must be one the caller
belongs to. An empty body is treated as {}. Calling this again with
the same context returns that subscription rather than creating a
duplicate, re-enabling it if the caller had disabled it.

The body may also carry notification_channels
({"email": bool, "push": bool, "sms": bool}) to choose how this
subscription's notifications are delivered instead of the user's
preferences. It is not part of the context, so it is neither
validated against the topic's schema nor used to match events.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
int64
required

Numeric id of the topic

Body Params

Free-form JSON object stored as the subscription's context. It must satisfy the JSON Schema in the topic's context (see GET /notification/topics). When it carries organizationId and datasetId, that dataset must exist in that organization. When it carries subjectUserId (personal topics such as ADD_TEAM_USER), that must be the caller's own user id. When it carries organizationId without datasetId (workspace and personal topics such as DATASET_PUBLISHED), the caller must be a member of that organization.
The one exception is the optional notification_channels field, which is not part of the context: it is removed before validation and stored as the subscription's own delivery-channel override. Omitting it (or sending null) leaves the subscription following the user's preferences; re-subscribing to an existing subscription without it keeps whatever override that subscription already had.

notification_channels
object

How this subscription's notifications are delivered, overriding the user's email/push preferences for this one subscription. Present only when the subscription carries an override; when it is absent, the subscription follows the user's preferences (GET /notification/user/{userId}). All three channels are required.

Responses

Language
Credentials
Bearer
JWT
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json