Webhook subscriptions and delivery rules for Portal's public API.
Webhooks allow external systems to receive real-time notifications when specific events occur in Portal.
Developers can register webhook subscriptions by providing an HTTPS endpoint URL and selecting which events they want to receive. When a subscribed event occurs, Portal sends an HTTP POST request to the configured endpoint.
Each request contains a structured JSON payload describing the event.
Webhook deliveries are signed using a secret key to allow consumers to verify that the request was sent by Portal.
If a webhook delivery fails, Portal automatically retries the delivery several times. Current implementation schedule: 1 minute, 5 minutes, 30 minutes, 2 hours, 12 hours.
Webhook requests are signed so consumers can verify that the request was sent by Portal.
Each subscription has a secretKey, which is used to generate a signature for every webhook request.
Each webhook request includes the following header:
X-Webhook-Signature
Example:
X-Webhook-Signature: t=1710000000,v1=5f2b3e7a9d1c4f8e6b2a3c9d7f4e1a6b5c3d2f7e9a1b4c6d8e0f2a3b5c7d9e1
Where:
t - timestamp when the webhook was generated (Unix time)v1 - HMAC-SHA256 signatureThe signature is calculated using HMAC-SHA256 with the subscription secretKey.
The message being signed is:
timestamp + "." + requestBody
Example:
1710000000.{"id":10025,"number":4123,...}
Signature calculation:
signature = HMAC_SHA256(secretKey, timestamp + "." + requestBody)
Consumers should verify webhook requests using the following steps:
X-Webhook-Signature header.t and v1.t + "." + requestBody.HMAC_SHA256(secretKey, signedMessage).v1.Creates a new webhook subscription for the authenticated dealer. The response includes the signing secret key used to verify delivered webhook requests.
Success
Validation failed. Common causes: subscription not found or does not belong to this account, URL is not HTTPS or resolves to a private address, unrecognised event names, or no changes were provided.
HMAC signature validation failed or credentials are invalid. Verify X-MSS-SIGNATURE, X-MSS-CUSTOM-DATE, and X-MSS-API-USERKEY headers.
The dealer's subscription is inactive or expired. An active subscription is required to use this endpoint.
You do not have permission for this action.
{- "subscriptionId": 0,
- "url": "string",
- "description": "string",
- "enabled": true,
- "secretKey": "string",
- "events": [
- "string"
]
}Returns all active webhook subscriptions for the authenticated dealer account.
Success
HMAC signature validation failed or credentials are invalid. Verify X-MSS-SIGNATURE, X-MSS-CUSTOM-DATE, and X-MSS-API-USERKEY headers.
The dealer's subscription is inactive or expired. An active subscription is required to use this endpoint.
You do not have permission for this action.
[- {
- "subscriptionId": 0,
- "url": "string",
- "description": "string",
- "enabled": true,
- "secretKey": "string",
- "events": [
- "string"
]
}
]Partially updates an existing webhook subscription. Only supplied fields are changed; omitted (null) fields retain their current values. At least one field must be provided.
Success
Validation failed. Common causes: subscription not found or does not belong to this account, URL is not HTTPS or resolves to a private address, unrecognised event names, or no changes were provided.
HMAC signature validation failed or credentials are invalid. Verify X-MSS-SIGNATURE, X-MSS-CUSTOM-DATE, and X-MSS-API-USERKEY headers.
The dealer's subscription is inactive or expired. An active subscription is required to use this endpoint.
You do not have permission for this action.
{- "subscriptionId": 0,
- "url": "string",
- "description": "string",
- "enabled": true,
- "secretKey": "string",
- "events": [
- "string"
]
}Permanently deletes a webhook subscription and all of its event bindings. No further events will be delivered to the endpoint.
Success
No active webhook subscription with the given SubscriptionId exists for the authenticated account.
HMAC signature validation failed or credentials are invalid. Verify X-MSS-SIGNATURE, X-MSS-CUSTOM-DATE, and X-MSS-API-USERKEY headers.
The dealer's subscription is inactive or expired. An active subscription is required to use this endpoint.
You do not have permission for this action.
{- "success": true,
- "subscriptionId": 0
}