Create a webhook

Creates a signed webhook endpoint for Samva delivery and inbound events, stores subscriptions, and returns the endpoint and signing secret with a 201 response.

POST
/v1/webhooks

Creates a signed webhook endpoint for Samva delivery and inbound events, stores subscriptions, and returns the endpoint and signing secret with a 201 response.

x-api-key<token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

name*string
Length1 <= length <= 100
url*string
eventTypes*array<>
Items1 <= items
channels?array<>|null
headers?|null
status?|null

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/webhooks" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "url": "string",    "eventTypes": [      "message.sent"    ]  }'
{  "endpoint": {    "id": "string",    "name": "string",    "url": "string",    "eventTypes": [      "message.sent"    ],    "channels": [      "email"    ],    "status": "active",    "hasCustomHeaders": true,    "failureStartedAt": "string",    "lastSucceededAt": "string",    "createdAt": "string",    "updatedAt": "string"  },  "secret": "string"}