post
https://api.cloud.mbanq.com/v1/subscriptions
Use this API to create one or more subscriptions for a subscriber. Subscriptions define which entity events (e.g., CLIENT, ADDRESS) and actions (e.g., CREATE, UPDATE, DELETE) will trigger notifications to be sent to the subscriber's configured target (URL or email).
Subscription Creation Modes:
- Single Subscription: Provide
entity,action,subscriberId, and optionallytemplateIdto create one subscription. - Bulk Subscription: Provide
subscriberIdandentityMap(a map of entities to their actions and optional templateIds) to create multiple subscriptions in one request.
Discovering Available Events and Templates:
Before creating subscriptions, use these helper APIs to discover valid values:
- GET /v1/subscriptions/events?type={subscriberType}: Retrieve the list of available entities and their supported actions for a specific subscriber type. Use this to populate the
entityandactionfields. - GET /v1/templates: Retrieve the list of available notification templates. Use this to find the appropriate
templateIdfor your subscription.
Template Requirements by Subscriber Type:
- EMAIL: Template is required. The template must be of type
EMAIL. - PUSH_NOTIFICATION: Template is required. The template must be of type
PUSH_NOTIFICATION. - CORE_EVENT_PROCESSOR: Template is optional. If provided, it must be of type
E_SIGNING_DOCUMENT. - WEBHOOK: Template is optional and not validated.
Validation Rules:
subscriberIdmust reference an existing subscriber- If
templateIdis provided, the template must exist and match the subscriber type requirements - For bulk creation via
entityMap, each entry must include anactionfield - Template type validation is enforced based on subscriber type (see above)
Behavior:
- Successfully created subscriptions are saved to the database
- For non-CORE_EVENT_PROCESSOR subscribers, a notification is sent to SQS with event type "CREATE"
- Returns a list of IDs for all created subscriptions
