Skip to main content
POST
/
v1
/
webhooks
Create a webhook subscription
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({url: '<string>', events: [], label: '<string>'})
};

fetch('https://sandbox.api.enfinitos.com/v1/webhooks', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "ok": true,
  "data": {
    "subscription": {
      "subscriptionId": "<string>",
      "developerId": "<string>",
      "url": "<string>",
      "events": [],
      "label": "<string>",
      "active": true,
      "createdAt": "2023-11-07T05:31:56Z",
      "lastDeliveredAt": "2023-11-07T05:31:56Z",
      "secretLastRotatedAt": "2023-11-07T05:31:56Z"
    },
    "signingSecret": "<string>"
  },
  "contractVersion": "<string>"
}

Authorizations

Authorization
string
header
required

API key sent as Authorization: Bearer <api-key>.

Body

application/json
url
string<uri>
required

HTTPS endpoint that receives delivery POSTs.

events
enum<string>[]
required

Event kinds to subscribe to. Use ["*"] for everything.

Minimum array length: 1

Webhook event taxonomy. Note that some kinds are defined but do not currently fire on the sandbox surface (e.g. right.resumed, right.expired, challenge.withdrawn, proof_pack.sealed, and the key.* kinds); subscribe to them safely for forward-compatibility.

Available options:
*,
right.issued,
right.suspended,
right.resumed,
right.revoked,
right.expired,
basis.registered,
offer.proposed,
offer.accepted,
offer.rejected,
offer.countered,
offer.withdrawn,
challenge.opened,
challenge.resolved,
challenge.withdrawn,
delivery.observed,
proof_pack.sealed,
key.issued,
key.revoked,
key.rotated
label
string
required
Required string length: 1 - 60

Response

The created subscription plus the one-time signing secret.

ok
boolean
required
data
object
required

Route-specific payload. Operation responses refine this.

contractVersion
string
required
Allowed value: "v1.0"