Create a webhook endpoint

Registers an https endpoint for the organization's events and returns its signing secret, ONCE. Every delivery carries `Trama-Signature: t=<unix>,v1=<hex>`, HMAC-SHA256 of `<t>.<raw body>` with that secret. An organization has at most 20 endpoints, disabled ones included: one more answers 409 `WEBHOOK_ENDPOINT_LIMIT_REACHED`.

POST
/v1/webhooks

Registers an https endpoint for the organization's events and returns its signing secret, ONCE. Every delivery carries Trama-Signature: t=<unix>,v1=<hex>, HMAC-SHA256 of <t>.<raw body> with that secret. An organization has at most 20 endpoints, disabled ones included: one more answers 409 WEBHOOK_ENDPOINT_LIMIT_REACHED.

Authorization

AuthorizationBearer <token>

The organization API key, sent as Authorization: Bearer <key>.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

eventTypes*array<>

The events this endpoint receives. One or more of: sale.won, sale.updated.

Items1 <= items
url*string

Where the events are POSTed. Must be https:// on a public host.

Lengthlength <= 2048

Response Body

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 '{    "eventTypes": [      "sale.won"    ],    "url": "string"  }'
{  "createdAt": "2019-08-24T14:15:22Z",  "eventTypes": [    "sale.won"  ],  "id": "string",  "previousSecretExpiresAt": "2019-08-24T14:15:22Z",  "status": "enabled",  "updatedAt": "2019-08-24T14:15:22Z",  "url": "string",  "secret": "string"}