Skip to content
Start free

Webhook Payloads

Open in ClaudeOpen in ChatGPT

Each webhook delivery is an HTTP POST request with a JSON body. DocSpring waits up to 30 seconds for your endpoint to respond, and treats any 2xx status code as a successful delivery.

Every request includes these headers:

HeaderValue
Content-Typeapplication/json
Acceptapplication/json
User-AgentDocSpring/Webhooks
X-DocSpring-Event-IdThe event ID, the same as the body’s id (see Event IDs below)
X-DocSpring-SignatureThe signature used to verify the request (see below)

Any custom Headers you configured on the webhook are added as well.

Submission events on a legacy v1/v2 webhook are sent without a signature or event ID and with a DocSpring User-Agent — see Webhook versions below.

The body’s format depends on the webhook’s version. Webhooks you create in the dashboard or with API v1 use version 3, described first. Webhooks you create with API v2 use version 4, where each event’s data is the resource exactly as API v2 returns it (see Version 4).

A version 3 body is a JSON object with four top-level keys:

{
"id": "6f1c2e8a-3b4d-4c5e-9f60-7a8b9c0d1e2f",
"event": "submission.processed",
"timestamp": "2026-06-27T03:16:07Z",
"data": {
"resource": {
"type": "Submission",
"id": "sub_0XYZ..."
},
"id": "sub_0XYZ...",
"state": "processed",
"test": false,
"template_id": "tpl_0ABC...",
"download_url": "https://downloads.docspring.com/store/...pdf?Expires=...&Signature=...&Key-Pair-Id=...&Hash-Algorithm=SHA256",
"metadata": { "customer_id": "cus_123" },
"data": {
"name": "Jane Doe",
"amount": "1234.00"
}
}
}
FieldDescription
idThe event ID. It stays the same when a delivery is retried.
eventThe event type, e.g. submission.processed.
timestampUTC ISO 8601 time the event was sent.
dataThe event payload (see below).

Every timestamp in the body — timestamp and any *_at field on the serialized resource, such as processed_at or updated_at — is a UTC ISO 8601 string with second precision, e.g. 2026-06-27T03:16:07Z. The same format is used for timestamps in API responses.

data contains:

  • resource — a small pointer to the resource that triggered the event, with its type (e.g. Submission) and id (e.g. sub_0XYZ...).
  • The rest of data is the serialized resource itself. For a submission this is the same object API v1 returns — including its id, state, download_url, metadata, and so on.

The fields in data for each resource type (data.resource.type):

data.resource.typeFields
SubmissionAPI v1’s submission object
CombinedSubmissionAPI v1’s combined submission object
SubmissionBatchAPI v1’s submission batch object, without its submissions
TemplateAPI v1’s template object, as returned when listing templates
SubmissionDataRequestid, submission_id, name, email, completed_at, declined_at, fields
Folderid, name, path, parent_folder_id
CustomFileid, url
APITokenid, name, test, revoked_at, created_at
Userid, name, email, created_at, invitation_sent_at, invitation_accepted_at
AccountIntegrationid, service, enabled, created_at, updated_at
Webhookid

See the API v1 reference for the fields of these objects. Version 4 payloads use API v2’s objects instead (below).

A version 4 body has the same four parts, named as API v2 names things:

{
"id": "6f1c2e8a-3b4d-4c5e-9f60-7a8b9c0d1e2f",
"event_type": "submission.processed",
"created_at": "2026-06-27T03:16:07Z",
"data": {
"id": "sub_1234567890abcdef01",
"state": "processed",
"test": false,
"template_id": "tpl_1234567890abcdef01",
"files": {
"pdf": {
"state": "processed",
"error_message": null,
"download_url": "https://downloads.docspring.com/store/...pdf?Expires=...&Signature=...&Key-Pair-Id=...&Hash-Algorithm=SHA256",
"permanent_url": "https://app.docspring.com/submissions/sub_1234567890abcdef01/files/pdf",
"filename": "sub_1234567890abcdef01.pdf",
"content_type": "application/pdf",
"size": 48213,
"sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
}
},
"metadata": { "customer_id": "cus_123" },
"data": { "name": "Jane Doe", "amount": "1234.00" }
}
}

The data above is shortened: it has every field of the API’s submission.

FieldDescription
idThe event ID. It stays the same when a delivery is retried.
event_typeThe event type in API v2’s names, e.g. submission.processed.
created_atWhen the event happened (UTC, ISO 8601). It stays the same when it’s retried.
dataThe resource as API v2 returns it, the same object as GET on it would give you

What data holds for each event:

Eventsdata
submission.*The submission
signature_request.*The signature request
combined_pdf.*The combined PDF
submission_batch.*The submission batch, with its submissions’ data always null
template.*The template, without its embed_edit_token
webhook.*The webhook, without its secret and headers
custom_file.*The custom file
folder.*The folder

Version 4 webhooks use API v2’s event names, and can’t subscribe to API token, user and integration events, which API v2 has no resources for. For a *.deleted event, data is the resource as it was just before it was deleted.

When Include submission data is off, a submission’s and a signature request’s data, a submission’s truncated_text, and each signature request’s ip_address and user_agent are null instead of being left out. See Include submission data.

Every v3 and v4 delivery has an event ID, sent as the body’s top-level id and in the X-DocSpring-Event-Id header. The ID stays the same when DocSpring retries a delivery, so you can use it to recognize an event you’ve already processed and ignore the repeat.

Each webhook gets its own event ID. If two of your webhooks receive the same event, their deliveries have different IDs.

Use the body’s id for deduplication. It’s covered by the signature, so it can’t be changed without breaking the signature. The header is a copy for convenience and isn’t signed.

Every webhook has a version that controls the payload format used for submission events — submission.processed, submission.failed, and the other submission.* events:

VersionFormat
v4 (API v2)id, event_type, created_at and data, with API v2’s resources and names. See Version 4.
v3 (current)The event envelope shown above (id, event, timestamp, data).
v2 (legacy){ "submission": { ... } } — the serialized submission as a JSON object.
v1 (legacy)A form-encoded body with a single submission field holding the serialized submission as a JSON string.

Webhooks you create with API v2 are v4, and webhooks you create in the dashboard or with API v1 default to v3. The v1 and v2 formats exist only so that endpoints created before the current webhook system keep receiving the exact payloads they were built for. A webhook’s version applies to every event it sends, except on v1 and v2 webhooks (see below).

Include submission data and strip fields still apply to legacy payloads; they filter the serialized submission before it is wrapped in the v1/v2 envelope. Legacy deliveries are sent with a DocSpring User-Agent and are not signed, matching the original webhook behavior.

By default the submitted form values are included (under data.data). If you only need to know that an event happened — and want to avoid sending field data to your endpoint — turn Include submission data off. DocSpring then leaves out every form value while keeping the rest of the event:

  • The submission’s data is left out (null on a version 4 webhook), and its truncated_text is null.
  • For each data request (signature request) in the payload, the values its signer entered (data), and the ip_address and user_agent they signed from, are null. Its name, email, state, timestamps and authentication details are kept.
  • For each email an email action sent, its subject and the addresses that came from the submission’s fields are null. The addresses in the email action’s settings, and each recipient’s status, are kept.

Use strip fields to remove individual fields from the payload — for example to keep sensitive values like SSNs or card numbers out of your logs.

List dot-separated paths from the root of the event’s data object. Form field values live under its data key, so a form field is removed with data.<field name>. A bare name removes a whole top-level key, such as metadata or password:

data.ssn
data.card_number
metadata.internal_note
password

The example above removes the ssn and card_number form fields, the internal_note metadata value, and the submission’s password field. Entries that don’t match anything are ignored.

Add custom Headers to every request — for example a static bearer token or a routing header your endpoint expects. Note that custom headers are a convenience, not a security mechanism: always rely on the signature to authenticate requests.