Skip to main content

Create a subscription

POST 

/subscriptions

This endpoint creates a subscription for event_types. Event types must first be specified using the Mambu UI following the instructions in our Event Streaming API article.

  • The subscription is needed to be able to consume events from event_types in a high level way when Mambu stores the offsets and manages the rebalancing of consuming clients.

  • The subscription is identified by its key parameters (owning_application, event_types, consumer_group).

  • If this endpoint is invoked several times with the same key subscription properties in body (order of event_types is not important) - the subscription will be created only once and for all other calls it will just return the subscription that was already created.

You do not need to call POST /subscriptions repeatedly before consuming events. Once a subscription is created using this endpoint (based on owning_application, event_types, and consumer_group), it is persisted and can be reused. Repeated calls with the same parameters will simply return the existing subscription and do not create a new one.

Calling this endpoint multiple times unnecessarily increases load and is not required for each connection attempt. We recommend storing the subscription configuration client-side and only creating it once during setup or onboarding.

Request​

Responses​

Subscription for such parameters already exists. Returns subscription object that already existed.

Response Headers
    Location

    The relative URI for this subscription resource.