
To learn more about Cobalt Events, you can refer to our guide here.
Create Event
Follow these steps to create an Event in Cobalt:- Create Event : Navigate to
Developer
in Cobalt >Events
> Click onNew Event
> Select aModel
> Update the sample Payload to your requirements > Click onCreate Event
.
It is expected that you pass on the data as the Sample Payload while you are triggering this event. This is because, the properties defined in the sample payload can be used as trigger variables inside a workflow.
Trigger an Event
You can trigger an event that was created in Cobalt by using the Trigger Event API.- Request : Make a POST request to the
/event/:slug
endpoint.linked_account_id
is a mandatory field to be passed while making the request.
Request
Param | Required | Type | Description |
---|---|---|---|
linked_account_id | Mandatory | String | Unique customer identifier |
event | Mandatory | String | Name of the event |
payload | Optional | Object | Event payload with user data required for the workflow. |
- Response : On a successful request, you will get a message that the event was triggered successfully.
200
- Handle Errors : If the
/event/:slug
endpoint returns a 400 error, your server-side code should handle it gracefully. The error is returned if you provided the wrong name of the event.
400
Checkpoint
You have now created an event in Cobalt and can send data from your app to other third party apps or integrations enabled in Cobalt.