LogoDOCS
OverviewAuthenticationRate LimitsErrors
Logo
Sign in →

The Webhook object

A Webhook object represents an endpoint on your server that receives notifications when envelope events occur. It defines the URL event payloads are delivered to, the event types it is subscribed to, and whether deliveries are currently enabled. Each webhook has its own signing secret, used to verify that incoming payloads are authentic and were not modified in transit.

Attributes
idstring

Unique identifier for the webhook.

urlstring

The URL PDFGate sends event payloads to.

eventTypesarray of enums

The event types this webhook is subscribed to.

Possible values:
envelope.sentenvelope.completedenvelope.expiredenvelope.voidedenvelope.deletedenvelope.recipient.signedenvelope.document.completed
statusenum
Possible values:
activedisabled
descriptionstring

A description you set for identifying the webhook.

secretstring

The signing secret used to verify incoming webhook payloads. Only included in the response when the webhook is first created.

createdAttimestamp

The date and time the webhook was created.

updatedAttimestamp

The date and time the webhook was last updated.

1{2  "id": "69f5b65d131aa112dbjja",3  "url": "https://example.com/webhooks/pdfgate",4  "eventTypes": ["envelope.sent", "envelope.completed"],5  "status": "active",6  "description": "Production envelope events",7  "secret": "whsec_...",8  "createdAt": "2026-05-31T08:20:00.000Z",9  "updatedAt": "2026-05-31T09:15:00.000Z"10}

Create Webhook

A webhook endpoint must have a url and a list of enabled eventTypes.

You can also set up webhook endpoints in the Dashboard from Settings > Webhooks.

To get started with receiving and verifying events, follow the webhooks guide.

The webhook signing secret is returned in the create response and can also be found in the Dashboard. Store it securely and use it to verify incoming webhook signatures.

Request Body
urlstringrequired

The URL of the webhook endpoint.

descriptionstring

Optional description for identifying the webhook.

eventTypesarray of stringsrequired

List of event types to subscribe to. For more details on each event type and its payload, check the Webhook Events page.

Acceptable values:
envelope.sentenvelope.completedenvelope.expiredenvelope.voidedenvelope.deletedenvelope.recipient.signedenvelope.document.completed
POST/webhook
CURL
NODE.JS
PYTHON
GO
PHP
JAVA
C#
RUBY
1curl \2  -H "Content-Type: application/json" \3  -H "Authorization: Bearer YOUR_API_KEY" \4  --request POST \5  --data '{6    "url": "https://example.com/webhooks/pdfgate",7    "description": "Production envelope events",8    "eventTypes": ["envelope.sent", "envelope.completed"]9  }' \10  https://api.pdfgate.com/webhook
JSON response - Webhook object
1{2  "id": "69f5b65d131aa112dbjja",3  "url": "https://example.com/webhooks/pdfgate",4  "eventTypes": ["envelope.sent", "envelope.completed"],5  "description": "Envelope events",6  "status": "active",7  "secret": "whsec_...",8  "createdAt": "2026-05-31T08:20:00.000Z"9}

Get Webhook

Retrieve a webhook by ID.

Path parameters
idstringrequired

The webhook ID.

GET/webhook/{id}
CURL
NODE.JS
PYTHON
GO
PHP
JAVA
C#
RUBY
1curl \2  -H "Authorization: Bearer YOUR_API_KEY" \3  --request GET \4  https://api.pdfgate.com/webhook/{webhookId}
JSON response - Webhook object
1{2  "id": "69f5b65d131aa112dbjja",3  "url": "https://example.com/webhooks/pdfgate",4  "eventTypes": ["envelope.sent", "envelope.completed"],5  "description": "Production envelope events",6  "status": "active",7  "createdAt": "2026-05-31T08:20:00.000Z",8  "updatedAt": "2026-05-31T09:15:00.000Z"9}

Delete Webhook

Delete a webhook endpoint by ID. Deleting a webhook stops future event deliveries for that endpoint.

Path parameters
idstringrequired

The webhook ID.

DELETE/webhook/{id}
CURL
NODE.JS
PYTHON
GO
PHP
JAVA
C#
RUBY
1curl \2  -H "Authorization: Bearer YOUR_API_KEY" \3  --request DELETE \4  https://api.pdfgate.com/webhook/{webhookId}
No Content response
1204 No Content

Webhook Events

Webhook events describe the changes that PDFGate can send to your configured webhook endpoints.

Event types
envelope.sent

Occurs when PDFGate sends signing request emails to recipients so they can start signing the envelope documents.

envelope.completed

Occurs when all required documents in an envelope are signed.

envelope.expired

Occurs when an envelope expires because not all documents in the envelope were signed before its expiration date.

envelope.voided

Occurs when the sender voids (cancels) an envelope before all documents are signed.

envelope.deleted

Occurs when the sender permanently deletes an envelope. The signed documents and audit logs produced by the envelope are removed from storage and the envelope is no longer accessible.

envelope.recipient.signed

Occurs each time a recipient signs a document inside an envelope. Fires once per recipient, unlike envelope.document.completed which fires once when all recipients of the document have signed.

envelope.document.completed

Occurs when a single document inside an envelope is signed by all recipients.

Sample payload - envelope.sent / envelope.completed / envelope.expired / envelope.voided
1{2  "eventId": "69f5b65d131aa112dbjja",3  "event": "envelope.completed",4  "timestamp": "2024-02-14T09:12:03.000Z",5  "resource": {6    "kind": "envelope",7    "id": "69f5b65d131aa112dbssa"8  },9  "data": {10    "envelope": {11      "id": "69f5b65d131aa112dbssa",12      "status": "completed",13      "documents": [14        {15          "sourceDocumentId": "69f5b65d131aa112dbzzd",16          "signedDocumentId": "ddsds9sdhds9s9dsa",17          "auditLogDocumentId": "6sd8ds5d131aa112dda",18          "name": "Sample Agreement.pdf",19          "status": "completed",20          "recipients": [21            {22              "email": "[email protected]",23              "name": "Sample Recipient",24              "embedded": false,25              "status": "signed",26              "previewLink": "https://document.pdfgate.com/preview/dfbdfbdbfjbfbdfbsdsfdsfdsfsdssd"27            }28          ]29        }30      ],31      "createdAt": "2024-02-13T15:56:12.607Z",32      "completedAt": "2024-02-14T09:12:03.000Z"33    }34  }35}
Sample payload - envelope.document.completed
1{2  "eventId": "69f5b65d131aa112dbjja",3  "event": "envelope.document.completed",4  "timestamp": "2024-02-14T09:12:03.000Z",5  "resource": {6    "kind": "envelope",7    "id": "69f5b65d131aa112dbssa"8  },9  "data": {10    "envelopeId": "69f5b65d131aa112dbssa",11    "sourceDocumentId": "69f5b65d131aa112dbzzd",12    "signedDocumentId": "ddsds9sdhds9s9dsa",13    "auditLogDocumentId": "6sd8ds5d131aa112dda",14    "documentStatus": "completed"15  }16}
Sample payload - envelope.recipient.signed
1{2  "eventId": "69f5b65d131aa112dbjja",3  "event": "envelope.recipient.signed",4  "timestamp": "2024-02-14T09:11:58.000Z",5  "resource": {6    "kind": "envelope",7    "id": "69f5b65d131aa112dbssa"8  },9  "data": {10    "sourceDocumentId": "69f5b65d131aa112dbzzd",11    "recipientId": "69d1a2b3c4d5e6f701234abc",12    "signedAt": "2024-02-14T09:11:58.000Z"13  }14}
Sample payload - envelope.deleted
1{2  "eventId": "69f5b65d131aa112dbjja",3  "event": "envelope.deleted",4  "timestamp": "2024-02-20T10:31:12.000Z",5  "resource": {6    "kind": "envelope",7    "id": "69f5b65d131aa112dbssa"8  },9  "data": {10    "envelopeId": "69f5b65d131aa112dbssa",11    "previousStatus": "voided",12    "deletedAt": "2024-02-20T10:31:12.000Z"13  }14}