Webhooks
Create a webhook subscription
Create a subscription and return its signing secret once. Send an Idempotency-Key header.
Method
POST
Path
/v1/webhook-subscriptions
Required scope
webhooks:writeRequest
curl -X POST "https://api.endurancehq.app/v1/webhook-subscriptions" \
-H "Authorization: Bearer $EHQ_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"JSON body schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"organizationId": {
"type": "string",
"minLength": 1
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 120
},
"endpointUrl": {
"type": "string",
"maxLength": 2048,
"format": "uri"
},
"events": {
"minItems": 1,
"maxItems": 20,
"type": "array",
"items": {
"type": "string",
"enum": [
"task.created",
"task.updated",
"task.comment.created",
"task.investigation.ready",
"tax_product.draft_detected",
"tax_product.revision_published",
"tax_product.mapping_validated",
"tax_product.mapping_blocked",
"tax_product.revision_activated",
"organization.document_refresh_recommended"
]
}
}
},
"required": [
"organizationId",
"name",
"endpointUrl",
"events"
],
"additionalProperties": false
}Response
Success status: 201
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"data": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"organizationId": {
"type": "string"
},
"name": {
"type": "string"
},
"endpointUrl": {
"type": "string",
"format": "uri"
},
"events": {
"type": "array",
"items": {
"type": "string",
"enum": [
"task.created",
"task.updated",
"task.comment.created",
"task.investigation.ready",
"tax_product.draft_detected",
"tax_product.revision_published",
"tax_product.mapping_validated",
"tax_product.mapping_blocked",
"tax_product.revision_activated",
"organization.document_refresh_recommended"
]
}
},
"status": {
"type": "string",
"enum": [
"active",
"disabled"
]
},
"lastDeliveryAt": {
"anyOf": [
{
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
{
"type": "null"
}
]
},
"createdAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
"updatedAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
"signingSecret": {
"type": "string"
}
},
"required": [
"id",
"organizationId",
"name",
"endpointUrl",
"events",
"status",
"lastDeliveryAt",
"createdAt",
"updatedAt",
"signingSecret"
],
"additionalProperties": false
}
},
"required": [
"data"
],
"additionalProperties": false
}Other surfaces
CLI: ehq webhooks create --organization <org_id> --url <https_url> --events task.created,task.updated
MCP tool: ehq_webhooks_create