Webhook Subscriptions
Register your endpoint, choose events, rotate the signing secret, pause, and delete
These seven operations manage the one endpoint that receives events for all your client orgs. What arrives there is documented in Webhooks.
Scope: PARTNER_ADMIN. All seven accept either an API key holding that scope or a member login on the provider org (kind TECH_PROVIDER).
All of them take the subscription's ID as the GraphQL ID! scalar - not String - though the value is the same hex string.
registerPartnerWebhook
registerPartnerWebhook(
url: String!
events: [OutboundWebhookEventName!]!
organisationIds: [ID!]
): RegisteredPartnerWebhook!Registers an endpoint and returns its signing secret.
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
url | String! | Yes | Your public https:// endpoint. Plain http://, localhost, private addresses and URLs with credentials are refused with a 400. It receives events for every client org you cover. |
events | [OutboundWebhookEventName!]! | Yes | Which events to deliver, as enum names. See the event catalogue. |
organisationIds | [ID!] | No | Restrict this subscription to specific managed client orgs. Omit or pass an empty list for all children, which is the original behaviour and what every existing subscription does. |
Returns RegisteredPartnerWebhook!
| Field | Type | Description |
|---|---|---|
id | ID! | The subscription ID. Pass it to the operations that take an id. |
signingSecret | String! | The whsec_ secret used to verify signatures. Returned only here and on rotate. |
One Endpoint per Client
Passing organisationIds gives a client its own URL and its own signing secret, which is what you want when each client's traffic goes somewhere different, or when you want a leaked secret to be one customer's problem rather than everyone's.
| Ids accepted | Only MANAGED children of the caller. Anything else is a generic 400 Invalid client organisation, with no indication of which id was wrong. |
| Per-child cap | 3 subscriptions per client org, refused with a 400 once reached. |
| Partner cap | Per-child subscriptions sit outside the limit of 10 all-children subscriptions per provider. |
Example
mutation Register {
registerPartnerWebhook(
url: "https://api.crmco.com/wexio/webhook"
events: [MESSAGE_INBOUND_CREATED, MESSAGE_OUTBOUND_CREATED, CONTACT_MERGED, ORGANISATION_DELETED]
) {
id
signingSecret
}
}{
"data": {
"registerPartnerWebhook": {
"id": "6716b4121c34d0012ab89f22",
"signingSecret": "whsec_7Hn2QpV4rT8yB1eK5mZ9xL3sW6jD0aC"
}
}
}Store signingSecret immediately. It is never returned by partnerWebhooks. If you lose it, call rotatePartnerWebhookSecret and deploy the new one.
setPartnerWebhookOrganisations
setPartnerWebhookOrganisations(id: ID!, organisationIds: [ID!]!): PartnerWebhookOutput!Replaces which client orgs a subscription covers. The ids follow the same rules as in registerPartnerWebhook.
The list must be non-empty. An empty list is rejected rather than treated as "all children", so a subscription can never be silently widened to every customer by an empty array from a buggy client. To widen deliberately, register a new subscription without organisationIds.
partnerWebhooks
partnerWebhooks: [PartnerWebhookOutput!]!Lists your subscriptions. Never returns a secret. Takes no arguments.
Returns [PartnerWebhookOutput!]!
| Field | Type | Description |
|---|---|---|
id | ID! | The subscription ID. |
url | String! | The registered endpoint. |
subscribedEvents | [OutboundWebhookEventName!]! | Events currently delivered. |
status | PartnerWebhookStatus! | ACTIVE or PAUSED. |
createdAt | DateTime | When it was registered. |
updatedAt | DateTime | Last change to the subscription. |
organisationIds | [ID!]! | Which client orgs it covers. Empty means all of them. |
previousSecretExpiresAt | DateTime | End of the rotation grace window, or null when no window is open. Read it to know whether two secrets are currently in play. |
Example
query Hooks {
partnerWebhooks {
id
url
subscribedEvents
status
}
}{
"data": {
"partnerWebhooks": [
{
"id": "6716b4121c34d0012ab89f22",
"url": "https://api.crmco.com/wexio/webhook",
"subscribedEvents": ["MESSAGE_INBOUND_CREATED", "ORGANISATION_DELETED"],
"status": "ACTIVE"
}
]
}
}rotatePartnerWebhookSecret
rotatePartnerWebhookSecret(id: ID!, revokePrevious: Boolean = false): RotatedPartnerWebhookSecret!Issues a new signing secret. The previous one keeps verifying for 24 hours, so you can deploy without dropping deliveries.
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
id | ID! | Yes | The subscription to rotate. |
revokePrevious | Boolean | No | true drops the old secret immediately. For a leak, where overlap is the thing you do not want. Default false. |
Returns RotatedPartnerWebhookSecret!
| Field | Type | Description |
|---|---|---|
signingSecret | String! | The new whsec_ secret. Shown once. |
previousSecretExpiresAt | DateTime | When the old secret stops verifying. null when revokePrevious: true. |
The Grace Window
During the 24 hours, deliveries carry two v1 values in X-Wexio-Signature - the new secret first, the previous second - and a delivery is authentic if either matches.
Your receiver must collect every v1, not only the first. Parsing the header into a name-keyed map keeps only the last value, so a receiver that has already stored the new secret would reject everything for 24 hours. The envelope reference has a rotation-aware snippet.
Only ever two secrets are valid. Rotating again inside the window makes the then-current secret the previous one and drops the older one, so a second rotation is not a way to keep three alive.
Example
mutation Rotate {
rotatePartnerWebhookSecret(id: "6716b4121c34d0012ab89f22") { signingSecret }
}{
"data": {
"rotatePartnerWebhookSecret": {
"signingSecret": "whsec_2Bf6LmQ9tX4vR7wZ1yH8jN0pS3dG5kA"
}
}
}setPartnerWebhookEvents
setPartnerWebhookEvents(id: ID!, events: [OutboundWebhookEventName!]!): PartnerWebhookOutput!Replaces the subscribed event list - it is not additive. Send the complete list you want.
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
id | ID! | Yes | The subscription to update. |
events | [OutboundWebhookEventName!]! | Yes | The full replacement list. Passing [] stops all deliveries. |
Returns PartnerWebhookOutput! - the updated subscription.
Example
mutation Events {
setPartnerWebhookEvents(
id: "6716b4121c34d0012ab89f22"
events: [MESSAGE_INBOUND_CREATED, MESSAGE_OUTBOUND_CREATED, CONTACT_MERGED, CONTACT_SPLIT, ORGANISATION_DELETED]
) {
id
subscribedEvents
}
}setPartnerWebhookStatus
setPartnerWebhookStatus(id: ID!, status: PartnerWebhookStatus!): PartnerWebhookOutput!Pauses or resumes delivery without losing the subscription or its secret. While PAUSED, matching events are dropped, not queued - they are not replayed when you resume.
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
id | ID! | Yes | The subscription to update. |
status | PartnerWebhookStatus! | Yes | ACTIVE or PAUSED. |
Returns PartnerWebhookOutput! - the updated subscription.
Example
mutation Status {
setPartnerWebhookStatus(id: "6716b4121c34d0012ab89f22", status: PAUSED) {
id
status
}
}deletePartnerWebhook
deletePartnerWebhook(id: ID!): Boolean!Deletes the subscription and its secret permanently. Use setPartnerWebhookStatus if you only want to stop deliveries temporarily.
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
id | ID! | Yes | The subscription to delete. |
Returns Boolean! - true when deleted.
Example
mutation Delete {
deletePartnerWebhook(id: "6716b4121c34d0012ab89f22")
}{ "data": { "deletePartnerWebhook": true } }Related
- Webhooks - the events your endpoint receives
- Webhook Envelope - the signature headers to verify
- Client Orgs -
createClientOrgWithWebhookcreates a client and its subscription in one call