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_typesin 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 ofevent_typesis 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
- 200
- 201
- 400
- 422
Subscription for such parameters already exists. Returns subscription object that already existed.
Response Headers
The relative URI for this subscription resource.
Subscription was successfuly created. Returns subscription object that was created.
Response Headers
The relative URI for the created resource.
If the Content-Location header is present and the same as the Location header the client can assume it has an up to date representation of the Subscription and a corresponding GET request is not needed.
Bad Request
Unprocessable Entity