Create a new webhook subscription

POST /subscriptions

Register a new webhook subscription to receive events.

application/json

Body Required

  • target_url string(uri) Required

    The endpoint to which webhooks will be delivered

  • secret string | null

    Secret used for HMAC signature verification (optional)

  • event_types string | null

    Comma-separated list of event types this subscription receives (optional)

Responses

  • 201 application/json

    Subscription created. Returns the ID of the new subscription.

    Hide response attribute Show response attribute object
    • id string(uuid)

      Unique identifier for the created subscription.

  • 400 application/json

    The request was malformed or invalid.

    Hide response attribute Show response attribute object
    • error string
  • 500 application/json

    An unexpected error occurred on the server.

    Hide response attribute Show response attribute object
    • error string
POST /subscriptions
curl \
 --request POST 'http://localhost:8080/subscriptions' \
 --header "Content-Type: application/json" \
 --data '{"secret":"mysecret","target_url":"https://webhook.site/your-url","event_types":"order.created,user.updated"}'
Request example
{
  "secret": "mysecret",
  "target_url": "https://webhook.site/your-url",
  "event_types": "order.created,user.updated"
}
Response examples (201)
{
  "id": "string"
}
Response examples (400)
{
  "error": "string"
}
Response examples (500)
{
  "error": "string"
}