Webhooks allow integrated applications to be notified when an event occurs in VOCUS. This functionality is currently available for FlightRisk Risk Assessments.
HTTP POST Service Account
Creates or updates a webhook subscription. The subscription is automatically scoped to the domain to which the service account belongs, and will only notify the callback URL for events within the service account's scope.
The subscription's properties may be updated at any time by calling this endpoint. This will not create a different subscription.
| Field | Type | Constraints | Detail |
| eventNames | String Array | Required |
Supported Values:
|
| url | String | Required | A publicly-routable URL for VOCUS to call when the event occurs. |
| sharedSecret | String | Required 64-1024 | The value that VOCUS will use to sign the authorization header when calling the URL. This value should be cryptographically random, and may be rotated at any time by calling this endpoint. |
// register to be notified when a risk assessment is run for legs within the scope of the service account
const payload = {
eventNames: ["FlightRisk.RiskAssessmentExecuted"],
url: "https://example.org/url-to-notify",
sharedSecret: "A_LONG_CRYPTOGRAPHICALLY_STRONG_VALUE"
};
| HTTP Status | Data |
| 200 |
When VOCUS notifies the callback URL, the request will follow a specific structure.
application/json
The authorization header will be in this format: Authorization: Token <JWT_TOKEN>
The JWT token will be signed with the shared secret used to register the webhook subscription.
Token will contain claims:
payloadHash - SHA-256 hash of the request bodyiat - Issued at timeexp - Expiration timenbf - Not before timeTo validate incoming webhook requests:
Authorization header.payloadHash claim.payloadHash claim.If the webhook endpoint returns an error or is unreachable, VOCUS will automatically retry the webhook delivery with the following schedule:
The total retry period spans approximately 8.5 minutes. After the final retry attempt, VOCUS will stop attempting delivery for that specific event.
Retries are only attempted for HTTP errors that suggest temporary problems (such as 5xx server errors or network timeouts). Authentication failures (4xx errors) will not be retried.
When a FlightRisk.RiskAssessmentExecuted event occurs, the JSON payload will contain:
// Example payload for FlightRisk.RiskAssessmentExecuted event
{
"legIds": ["EXTERNAL_LEG_ID_12345", "EXTERNAL_LEG_ID_67890"]
}
The webhook callback endpoint should:
HTTP DELETE Service Account
Deletes a webhook subscription for all registered event types. The subscription is automatically scoped to the domain to which the service account belongs.
HTTP POST Service Account
Sends a test payload to the subscribed webhook URL to verify configuration. A subscription must be created before calling this endpoint.
| Field | Type | Constraints | Detail |
| payloadToEcho | Object | Required | The test payload to send to the webhook URL. |
const payload = {
payloadToEcho: { testField: "testValue" }
};
If the request is valid and no server errors occurred, the response status will be HTTP 200 even if the webhook invocation failed. Check the success property to see if invocation succeeded.
| Field | Type | Detail |
| success | Boolean | Indicates if VOCUS received an HTTP success status code when invoking the subscribed webhook URL. |
| diagnostics | Object | Contains diagnostic information collected by the server. |
API Version 15.0.9426.23016
Copyright ©2008-2025 Polaris Aero, LLC.