Skip to main content

Webhook Subscribers

Create a webhook subscriber​

POST /webhook-subscribers

Code samples


curl -X POST https://localhost:9543/api-portal/api/v0.9/webhook-subscribers \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d @payload.json

Registers a webhook subscriber for the organization. Event deliveries (apikey., subscription., etc.) matching the subscriber's events filter are fanned out to its target URL. The secret, if provided, is encrypted at rest using AES-256-GCM. When id is omitted, the server generates a UUID handle; the assigned handle is returned as id in the response and is what later requests address.

Payload

{
"id": "production-gateway",
"displayName": "Production Gateway",
"targetUrl": "https://gateway.example.com/api-portal-webhook",
"secret": "<shared-secret>",
"events": [
"apikey.*",
"subscription.*"
],
"enabled": true,
"timeoutMs": 5000
}

Authentication​

This operation requires a Bearer JWT access token in the Authorization header. Required scopes (the token must carry at least one of): `dp:webhook_subscriber:create`, `dp:webhook_subscriber:manage`

Parameters​

NameInTypeRequiredDescription
bodybodyWebhookSubscriberRequesttrueWebhook subscriber configuration payload.

Example responses

201 Response

{
"id": "production-gateway",
"orgId": "org-12345",
"displayName": "Production Gateway",
"targetUrl": "https://gateway.example.com/api-portal-webhook",
"enabled": true,
"events": [
"apikey.*",
"subscription.*"
],
"timeoutMs": 5000,
"hasSecret": true,
"createdBy": "[email protected]",
"updatedBy": "[email protected]",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
}

Bad request. Validation and other bad-request errors are returned as a standard error object (field-level details, when present, are carried in its errors array); some legacy handlers return a message-only object.

{
"status": "error",
"code": "MISSING_REQUIRED_PARAMETER",
"message": "Missing required parameter."
}
{
"message": "Missing or invalid fields in the request payload"
}

409 Response

{
"status": "error",
"code": "CONFLICT",
"message": "Conflict"
}

500 Response

{
"status": "error",
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred."
}

Responses​

StatusMeaningDescriptionSchema
201CreatedWebhook subscriber configuration response.WebhookSubscriberResponseSchema
400Bad RequestBad request. Validation and other bad-request errors are returned as a standard error object (field-level details, when present, are carried in its errors array); some legacy handlers return a message-only object.Inline
409ConflictThe request conflicts with an existing resource.ErrorResponse
500Internal Server ErrorInternal server error.ErrorResponse

Response schema​

Enumerated Values​

PropertyValue
statuserror

Response Headers​

StatusHeaderTypeFormatDescription
201LocationstringuriURL of the created webhook subscriber.

List webhook subscribers​

GET /webhook-subscribers

Code samples


curl -X GET https://localhost:9543/api-portal/api/v0.9/webhook-subscribers \
-H 'Authorization: Bearer {access_token}' \
-H 'Accept: application/json'

Returns all webhook subscriber configurations for the organization. Secrets are never included in the response.

Authentication​

This operation requires a Bearer JWT access token in the Authorization header. Required scopes (the token must carry at least one of): `dp:webhook_subscriber:read`, `dp:webhook_subscriber:manage`

Parameters​

NameInTypeRequiredDescription
limitqueryintegerfalseMaximum number of records to return.
offsetqueryintegerfalseNumber of records to skip before returning results.

Example responses

200 Response

{
"list": [
{
"id": "production-gateway",
"orgId": "org-12345",
"displayName": "Production Gateway",
"targetUrl": "https://gateway.example.com/api-portal-webhook",
"enabled": true,
"events": [
"apikey.*",
"subscription.*"
],
"timeoutMs": 5000,
"hasSecret": true,
"createdBy": "[email protected]",
"updatedBy": "[email protected]",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
}
],
"count": 1,
"pagination": {
"total": 42,
"limit": 20,
"offset": 0
}
}

500 Response

{
"status": "error",
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred."
}

Responses​

StatusMeaningDescriptionSchema
200OKList of webhook subscriber configurations.Inline
500Internal Server ErrorInternal server error.ErrorResponse

Response schema​

Status Code 200

NameTypeRequiredRestrictionsDescription
» list[WebhookSubscriberResponseSchema]falsenone[Webhook subscriber configuration. The secret is never included.]
»» idstringfalsenoneThe webhook subscriber's handle (unique per org). Not the internal database uuid.
»» orgIdstringfalsenonenone
»» displayNamestringfalsenonenone
»» targetUrlstring(uri)falsenonenone
»» enabledbooleanfalsenonenone
»» events[string]falsenonenone
»» timeoutMsintegerfalsenonenone
»» hasSecretbooleanfalsenoneWhether a secret is configured. The same secret serves two purposes. It signs outgoing payloads with a hash-based message authentication code (HMAC), and it derives the AES-256-GCM key that encrypts sensitive fields. Encrypted fields arrive as data.iv, data.tag, and data.ciphertext; the derivation and a worked decryption example are documented in the webhook event catalog.
»» createdBystringfalsenoneIdentity of the user who created this webhook subscriber, or deleted_user if that user's IDP reference no longer exists. Present on single-resource GET responses and list items.
»» updatedBystringfalsenoneIdentity of the user who last updated this webhook subscriber, or deleted_user if that user's IDP reference no longer exists. Present on single-resource GET responses only, omitted on list items.
»» createdAtstring(date-time)falsenonenone
»» updatedAtstring(date-time)falsenonenone
» countintegerfalsenoneNumber of items returned in this page.
» paginationPaginationfalsenoneStandard pagination metadata returned with collection responses.
»» totalintegertruenoneTotal number of records matching the query.
»» limitintegertruenoneMaximum number of records returned in this response.
»» offsetintegertruenoneNumber of records skipped before this page.

Get a webhook subscriber​

GET /webhook-subscribers/{subscriberId}

Code samples


curl -X GET https://localhost:9543/api-portal/api/v0.9/webhook-subscribers/{subscriberId} \
-H 'Authorization: Bearer {access_token}' \
-H 'Accept: application/json'

Retrieves a single webhook subscriber configuration by ID.

Authentication​

This operation requires a Bearer JWT access token in the Authorization header. Required scopes (the token must carry at least one of): `dp:webhook_subscriber:read`, `dp:webhook_subscriber:manage`

Parameters​

NameInTypeRequiredDescription
subscriberIdpathstringtrueThe webhook subscriber's handle (its id in request/response payloads), not the internal database uuid.

Example responses

200 Response

{
"id": "production-gateway",
"orgId": "org-12345",
"displayName": "Production Gateway",
"targetUrl": "https://gateway.example.com/api-portal-webhook",
"enabled": true,
"events": [
"apikey.*",
"subscription.*"
],
"timeoutMs": 5000,
"hasSecret": true,
"createdBy": "[email protected]",
"updatedBy": "[email protected]",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
}

404 Response

{
"status": "error",
"code": "ORG_NOT_FOUND",
"message": "Organization not found."
}

500 Response

{
"status": "error",
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred."
}

Responses​

StatusMeaningDescriptionSchema
200OKWebhook subscriber configuration response.WebhookSubscriberResponseSchema
404Not FoundResource not found.ErrorResponse
500Internal Server ErrorInternal server error.ErrorResponse

Update a webhook subscriber​

PUT /webhook-subscribers/{subscriberId}

Code samples


curl -X PUT https://localhost:9543/api-portal/api/v0.9/webhook-subscribers/{subscriberId} \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d @payload.json

Updates an existing webhook subscriber configuration. Only supplied fields are updated; omitted fields retain their stored values.

Payload

{
"id": "production-gateway",
"displayName": "Production Gateway",
"targetUrl": "https://gateway.example.com/api-portal-webhook",
"secret": "<shared-secret>",
"events": [
"apikey.*",
"subscription.*"
],
"enabled": true,
"timeoutMs": 5000
}

Authentication​

This operation requires a Bearer JWT access token in the Authorization header. Required scopes (the token must carry at least one of): `dp:webhook_subscriber:update`, `dp:webhook_subscriber:manage`

Parameters​

NameInTypeRequiredDescription
bodybodyWebhookSubscriberRequestfalseWebhook subscriber update payload. All fields are optional; only supplied fields are updated.
subscriberIdpathstringtrueThe webhook subscriber's handle (its id in request/response payloads), not the internal database uuid.

Example responses

200 Response

{
"id": "production-gateway",
"orgId": "org-12345",
"displayName": "Production Gateway",
"targetUrl": "https://gateway.example.com/api-portal-webhook",
"enabled": true,
"events": [
"apikey.*",
"subscription.*"
],
"timeoutMs": 5000,
"hasSecret": true,
"createdBy": "[email protected]",
"updatedBy": "[email protected]",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
}

Bad request. Validation and other bad-request errors are returned as a standard error object (field-level details, when present, are carried in its errors array); some legacy handlers return a message-only object.

{
"status": "error",
"code": "MISSING_REQUIRED_PARAMETER",
"message": "Missing required parameter."
}
{
"message": "Missing or invalid fields in the request payload"
}

404 Response

{
"status": "error",
"code": "ORG_NOT_FOUND",
"message": "Organization not found."
}

409 Response

{
"status": "error",
"code": "CONFLICT",
"message": "Conflict"
}

500 Response

{
"status": "error",
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred."
}

Responses​

StatusMeaningDescriptionSchema
200OKWebhook subscriber configuration response.WebhookSubscriberResponseSchema
400Bad RequestBad request. Validation and other bad-request errors are returned as a standard error object (field-level details, when present, are carried in its errors array); some legacy handlers return a message-only object.Inline
404Not FoundResource not found.ErrorResponse
409ConflictThe request conflicts with an existing resource.ErrorResponse
500Internal Server ErrorInternal server error.ErrorResponse

Response schema​

Enumerated Values​

PropertyValue
statuserror

Delete a webhook subscriber​

DELETE /webhook-subscribers/{subscriberId}

Code samples


curl -X DELETE https://localhost:9543/api-portal/api/v0.9/webhook-subscribers/{subscriberId} \
-H 'Authorization: Bearer {access_token}' \
-H 'Accept: application/json'

Deletes a webhook subscriber configuration by ID.

Authentication​

This operation requires a Bearer JWT access token in the Authorization header. Required scopes (the token must carry at least one of): `dp:webhook_subscriber:delete`, `dp:webhook_subscriber:manage`

Parameters​

NameInTypeRequiredDescription
subscriberIdpathstringtrueThe webhook subscriber's handle (its id in request/response payloads), not the internal database uuid.

Example responses

404 Response

{
"status": "error",
"code": "ORG_NOT_FOUND",
"message": "Organization not found."
}

500 Response

{
"status": "error",
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred."
}

Responses​

StatusMeaningDescriptionSchema
204No ContentWebhook subscriber deleted successfully.None
404Not FoundResource not found.ErrorResponse
500Internal Server ErrorInternal server error.ErrorResponse

List recent deliveries for a webhook subscriber​

GET /webhook-subscribers/{subscriberId}/deliveries

Code samples


curl -X GET https://localhost:9543/api-portal/api/v0.9/webhook-subscribers/{subscriberId}/deliveries \
-H 'Authorization: Bearer {access_token}' \
-H 'Accept: application/json'

Returns the most recent webhook delivery attempts for a single subscriber, newest first.

Authentication​

This operation requires a Bearer JWT access token in the Authorization header. Required scopes (the token must carry at least one of): `dp:webhook_subscriber:read`, `dp:webhook_subscriber:manage`

Parameters​

NameInTypeRequiredDescription
subscriberIdpathstringtrueThe webhook subscriber's handle (its id in request/response payloads), not the internal database uuid.

Example responses

200 Response

{
"list": [
{
"deliveryId": "del-abc123",
"eventType": "apikey.generated",
"occurredAt": "2019-08-24T14:15:22Z",
"status": "DELIVERED",
"lastHttpStatus": 200,
"lastError": "string",
"lastAttemptAt": "2019-08-24T14:15:22Z",
"deliveredAt": "2019-08-24T14:15:22Z"
}
]
}

404 Response

{
"status": "error",
"code": "ORG_NOT_FOUND",
"message": "Organization not found."
}

500 Response

{
"status": "error",
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred."
}

Responses​

StatusMeaningDescriptionSchema
200OKRecent delivery attempts for this webhook subscriber.Inline
404Not FoundResource not found.ErrorResponse
500Internal Server ErrorInternal server error.ErrorResponse

Response schema​

Status Code 200

NameTypeRequiredRestrictionsDescription
» list[WebhookSubscriberDeliverySummary]falsenone[A single delivery attempt made to a webhook subscriber.]
»» deliveryIdstringfalsenonenone
»» eventTypestring¦nullfalsenonenone
»» occurredAtstring(date-time)¦nullfalsenonenone
»» statusstringfalsenonenone
»» lastHttpStatusinteger¦nullfalsenonenone
»» lastErrorstring¦nullfalsenonenone
»» lastAttemptAtstring(date-time)¦nullfalsenonenone
»» deliveredAtstring(date-time)¦nullfalsenonenone

Enumerated Values​

PropertyValue
statusPENDING
statusIN_FLIGHT
statusDELIVERED
statusFAILED

Was this page helpful?