Create Webhook

POST
/api/v1/webhooks

Create a new webhook subscription for a tenant

Authorization

headerX-Api-Key<token>

API key in format: sti_env_prefix_secret

Header Parameters

idempotency-key*string

Required for mutating calls. Use a V4 UUID. The server stores the first result for 24h and returns it on subsequent retries with the same key.

Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Formatuuid

Request Body

application/json
  1. body
name*string

Webhook subscription name

url*string

Webhook endpoint URL

Formaturi
eventTypes*array<>

Event types to subscribe to

secret?string

Optional webhook signing secret

metadata?

Response Body

Default Response

application/json
  1. response
subscription*
Example Request
curl -X POST 'https://api.sandbox.stables.money/api/v1/webhooks' \  -H 'idempotency-key: 497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "url": "http://example.com",  "eventTypes": [    "customer.created"  ]}'
Example Response200
{  "subscription": {    "subscriptionId": "d079718b-ff63-45dd-947b-4950c023750f",    "name": "string",    "url": "http://example.com",    "eventTypes": [      "customer.created"    ],    "active": true,    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "metadata": {      "property1": "string",      "property2": "string"    }  }}