The key to providing an easy webhook integration experience for your users lies in your event types. The first thing your users are interested in seeing when integrating with you is what events you send and what information those events provide.
You should consider event types (and their schemas) as part of your API. Hence, they need to be accurate and up-to-date.
If you have an API you offer to your customers, it's quite likely you have an OpenAPI specification already documenting it. You can now use that same OpenAPI file as a quick and easy way to create and update Svix Event Types.
The OpenAPI 3.1 spec already defines a webhooks
section
This can be a great option if you want to avoid error-prone manual changes and don't need to update event types very often. If you update event types frequently, a
In the Event Types section in your
Once your spec is uploaded, Svix will parse the webhooks
section and suggest event types based on your existing definitions.
All you need to do is set the event type name and hit 'Save'. For better readability, you might want this name to be slightly different than the name in your API definition. If an event type with that name already exists, it will get updated.
That's it! You used your existing API definition to add event types to Svix; no extra work is needed. Schemas, descriptions, and examples can all be read from the OpenAPI spec and can be kept up to date with your API this way.
Check out
For more content like this, make sure to follow us on
Also published here