Publish an event to your Topic
Please refer to our API documentation for the latest API specifications.
In order to publish an Event to your Topic, you’ll need a Secret Key (check the Create an API Key section), along with the Environment ID.
The Environment ID can be conveniently accessed and copied to your clipboard by clicking the environment name on the top menu.
All the request to publish an event must have the environment ID on the x-environment-id
header, and set x-auth-token
header using the Secret Key in the step Create an API Key.
An Event will only be published to the Topic if the type is a valid Event Type within the Event Registry. If you have an Event where it’s not defined in the Event Registry, or if the event is not associated with a Topic, you will receive a 400 bad request.
An array of events can be sent using the /v1/topics/{{topicname}}/events/publish
endpoint.
Example
{
"events": [
{
"type": "customer.email.deleted",
"data": {
"event_type": "customer.email.deleted",
"deleted_email": "deleted@letsqala.com",
"timestamp": "2024-05-04T15:30:00"
},
"id": "Example1"
},
{
"type": "customer.created",
"data": {
"event_type": "customer_created",
"customer_id": "123456",
"name": "John Doe",
"email": "johndoe@letsqala.com",
"timestamp": "2024-04-30T08:45:00"
},
"id": "Example2"
}
]
}