Skip to content
Get startedDashboardSupport

Webhooks

Create and manage Webhooks.

Webhooks can be used to notify your application when events occur in PostGrid. For example, you may use a letter.updated webhook to receive a notification when a letter has been processed for delivery.

Every webhook has a secret and this is used to sign the payload of the event.

You can choose what format you want the payload to be delivered in. By default, the webhook payload will be delivered as a JSON Web Token. When you receive the event, you can verify it using a JWT library available for your particular language (using the HMAC SHA256 Algorithm). There are many off-the-shelf solutions you can use.

You can alternatively choose to receive a JSON payload. In this case, you’ll also receive a PostGrid-Signature HTTP header along with the payload.

You must respond with a 200 status from your webhook. Otherwise, PostGrid will retry the webhook up to 3 times. First, after 1 hour, then 2 hours, then 4 hours. We will also keep track of every invocation and its response status. You can retrieve data about prior invocations using the webhook invocations list endpoint below.

Create Webhook
client.printMail.webhooks.create(WebhookCreateParams { enabledEvents, url, description, 3 more } body, RequestOptionsoptions?): Webhook { id, createdAt, enabled, 9 more }
POST/print-mail/v1/webhooks
List Webhooks
client.printMail.webhooks.list(WebhookListParams { limit, search, skip } query?, RequestOptionsoptions?): SkipLimit<Webhook { id, createdAt, enabled, 9 more } >
GET/print-mail/v1/webhooks
Update Webhook
client.printMail.webhooks.update(stringid, WebhookUpdateParams { description, enabled, enabledEvents, 4 more } body, RequestOptionsoptions?): Webhook { id, createdAt, enabled, 9 more }
POST/print-mail/v1/webhooks/{id}
Get Webhook
client.printMail.webhooks.retrieve(stringid, RequestOptionsoptions?): Webhook { id, createdAt, enabled, 9 more }
GET/print-mail/v1/webhooks/{id}
Delete Webhook
client.printMail.webhooks.delete(stringid, RequestOptionsoptions?): WebhookDeleteResponse { id, deleted, object }
DELETE/print-mail/v1/webhooks/{id}
List Webhook Invocations
client.printMail.webhooks.listInvocations(stringid, WebhookListInvocationsParams { limit, search, skip } query?, RequestOptionsoptions?): SkipLimit<WebhookInvocation { id, createdAt, event, 6 more } >
GET/print-mail/v1/webhooks/{id}/invocations
ModelsExpand Collapse
One of the following:
One of the following:
One of the following: