Webhook Management
Webhooks enable event-driven notifications for tenant-related activities, such as credential issuance or proof requests, across multiple ecosystems (OpenID, Privado ID, Indicio, Cheqd). This section covers methods to add, retrieve, and delete webhooks associated with a tenant.
Add Webhook
Adds a new webhook URL to a tenant for event notifications.
import { OpenIDEcosystem } from '@openid/core-sdk';
const openid = new OpenIDEcosystem({
apiKey: 'your-ecosystem-api-key',
});
const webhook = await openid.addWebhook({
tenantId: 'your-tenant-id',
webhookUrl: 'https://webhook.example.com/receive',
});
Params
| Parameter | Type | Description |
|---|---|---|
| tenantId | string (Required) | The ID of the tenant to associate the webhook with. |
| webhookUrl | string (Required) | The URL where webhook notifications will be sent. |
note
- Ensure the
webhookUrlis a secure, publicly accessible HTTPS endpoint. - Webhooks are tenant-specific; verify the
tenantIdmatches your configuration.
Get Webhooks
Retrieves a list of webhooks associated with a tenant, with an optional filter by webhook ID.
import { OpenIDEcosystem } from '@openid/core-sdk';
const openid = new OpenIDEcosystem({
apiKey: 'your-ecosystem-api-key',
});
const webhooks = await openid.getWebhooks({
tenantId: 'your-tenant-id',
});
Params
| Parameter | Type | Description |
|---|---|---|
| tenantId | string (Required) | The ID of the tenant to query. |
| webhookId | string (Optional) | The ID of a specific webhook to retrieve (if omitted, returns all webhooks for the tenant). |
note
- Use the
webhookIdfilter to retrieve a single webhook’s details or omit it for a full list. - Responses may include additional metadata (e.g., last event time); check the
GetWebhooksResponsetype for full structure.
Delete Webhook
Removes a webhook from a tenant, stopping all associated notifications.
import { OpenIDEcosystem } from '@openid/core-sdk';
const openid = new OpenIDEcosystem({
apiKey: 'your-ecosystem-api-key',
});
const result = await openid.deleteWebhook({
tenantId: 'your-tenant-id',
webhookId: 'your-webhook-id',
});
Params
| Parameter | Type | Description |
|---|---|---|
| tenantId | string (Required) | The ID of the tenant owning the webhook. |
| webhookId | string (Required) | The ID of the webhook to delete. |
note
- This action is irreversible; ensure the
webhookIdis correct before deletion. - Deleting a webhook stops all event notifications to the associated URL.