Create webhook
curl --request POST \
--url https://test-api.shodai.network/v0/webhooks \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"url": "https://example.com/shodai/webhooks"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: 'https://example.com/shodai/webhooks'})
};
fetch('https://test-api.shodai.network/v0/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "wh_123",
"principalId": "account_123",
"createdByApiKeyId": null,
"url": "https://example.com/shodai/webhooks",
"status": "active",
"eventTypes": [
"agreement.transitioned",
"agreement.notification.triggered"
],
"filters": {
"templateIds": [
"did:template:service-retainer-v0-1"
]
},
"createdAt": "2026-05-26T16:00:00.000Z",
"updatedAt": "2026-05-26T16:00:00.000Z",
"secret": "whsec_0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
},
"meta": {
"apiVersion": "v0",
"requestId": "req_123"
}
}{
"error": {
"code": "unauthorized",
"message": "Missing API credential",
"requestId": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "unauthorized",
"message": "Missing API credential",
"requestId": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "unauthorized",
"message": "Missing API credential",
"requestId": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "unauthorized",
"message": "Missing API credential",
"requestId": "<string>",
"details": "<unknown>"
}
}Webhooks
Create webhook
Registers a signed webhook endpoint for subscribed agreement activity and notification events visible to the authenticated Shodai account. The signing secret is returned only in the create response.
POST
/
v0
/
webhooks
Create webhook
curl --request POST \
--url https://test-api.shodai.network/v0/webhooks \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"url": "https://example.com/shodai/webhooks"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: 'https://example.com/shodai/webhooks'})
};
fetch('https://test-api.shodai.network/v0/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": "wh_123",
"principalId": "account_123",
"createdByApiKeyId": null,
"url": "https://example.com/shodai/webhooks",
"status": "active",
"eventTypes": [
"agreement.transitioned",
"agreement.notification.triggered"
],
"filters": {
"templateIds": [
"did:template:service-retainer-v0-1"
]
},
"createdAt": "2026-05-26T16:00:00.000Z",
"updatedAt": "2026-05-26T16:00:00.000Z",
"secret": "whsec_0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
},
"meta": {
"apiVersion": "v0",
"requestId": "req_123"
}
}{
"error": {
"code": "unauthorized",
"message": "Missing API credential",
"requestId": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "unauthorized",
"message": "Missing API credential",
"requestId": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "unauthorized",
"message": "Missing API credential",
"requestId": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "unauthorized",
"message": "Missing API credential",
"requestId": "<string>",
"details": "<unknown>"
}
}
Create a signed webhook endpoint for agreement activity and notification events. The signing secret is returned only in the create response.
Authorizations
ApiKeyAuthOAuthBearerAuth
Canonical API-key credential. Send X-API-Key: cns_pk_..., or Authorization: Bearer cns_pk_... only as an API-key compatibility alias.
Body
application/json
HTTPS endpoint that receives signed webhook POSTs.
Subscribable event types. On create, omitted, null, or empty eventTypes defaults to agreement.transitioned.
Available options:
agreement.transitioned, agreement.notification.triggered On create, omitted, null, or an empty object all mean no filters, and the subscription receives every event it is subscribed to.
Show child attributes
Show child attributes
Response
Created webhook subscription.
Show child attributes
Show child attributes
Example:
{ "id": "wh_123", "principalId": "account_123", "createdByApiKeyId": null, "url": "https://example.com/shodai/webhooks", "status": "active", "eventTypes": [ "agreement.transitioned", "agreement.notification.triggered" ], "filters": { "templateIds": ["did:template:service-retainer-v0-1"] }, "createdAt": "2026-05-26T16:00:00.000Z", "updatedAt": "2026-05-26T16:00:00.000Z", "secret": "whsec_0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" }
Show child attributes
Show child attributes
Was this page helpful?
⌘I