Skip to content
DocsMenu

Create a webhook endpoint

View as Markdown

Open this page inChatGPTClaudeCursor

In the Esign Comply API, POST /v1/webhooks adds a webhook endpoint in the calling key's environment and returns its signing secret once. Call it once for each URL that receives events such as record.completed, and store the secret on your server.

POST /v1/webhooks · API version 2026-11-21

Authentication

Send a secret key in the Authorization header: Bearer $ESIGNCOMPLY_API_KEY. The key needs full_access permission. Test keys and live keys both work, and each reads and writes the objects of its own environment. Call it from your server: a secret key never goes to a browser. Keys and permissions are described under Authentication.

Request example

cURL

curl https://esigncomply.com/v1/webhooks \
  -H "Authorization: Bearer $ESIGNCOMPLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "http://localhost:4000/webhooks/esigncomply",
    "events": [
      "*"
    ],
    "description": "Local development"
  }'

Node SDK

import { EsignComply } from "esigncomply";

const esc = new EsignComply(process.env.ESIGNCOMPLY_API_KEY);

const { data, error } = await esc.webhooks.create(
  {
    url: "http://localhost:4000/webhooks/esigncomply",
    events: ["*"],
    description: "Local development",
  },
);

This request ran against the API on November 26, 2026, and the response below is what came back. IDs are example values, and long values are shortened with ....

What it does

Adds an endpoint in the calling key's environment: a test key creates a test endpoint, a live key a live endpoint. The signing secret is in the response once. This response is never kept for idempotent replay. For event types, the delivery format and signature verification, read webhooks.

Parameters

Body fields

Field Type Required Description
url string Yes Must use HTTPS. In test mode http://localhost and http://127.0.0.1 are also accepted. A live endpoint must be reachable from the public internet.
events string[] No Event types to receive. Defaults to ["*"] (all events). An unknown type is refused so that typos do not go unnoticed.
description string No Up to 200 characters.

Endpoints per environment: Free 1, Starter 3, Unlimited 10, Enterprise not capped. Each endpoint is pinned to the API version in force when it was created. A new event type reaches an endpoint only if it subscribes to that type or to all events.

Store secret as ESIGNCOMPLY_WEBHOOK_SECRET on your server.

Headers: Idempotency-Key (optional, up to 255 characters) and Esign-Comply-Version (optional, a dated API version). See API conventions.

Response

201 Created with a WebhookEndpoint object.

{
  "object": "webhook_endpoint",
  "id": "wh_G33e",
  "livemode": false,
  "url": "http://localhost:4000/webhooks/esigncomply",
  "description": "Local development",
  "events": [
    "*"
  ],
  "status": "enabled",
  "api_version": "2026-11-21",
  "failing_since": null,
  "created_at": "2026-11-26T00:15:29.657Z",
  "secret": "whsec_..."
}

Response fields

Field Type Description
object string
id string
livemode boolean
url string
description string
events array of string
status string
api_version string
failing_since datetime
created_at datetime
secret string whsec_... Present only in the creation response.
deleted boolean

Errors

Code HTTP When
invalid_request 400 400: the URL is not valid or not HTTPS, a live URL points at a private address, or events names an unknown type.
plan_feature_unavailable 403 403: the plan's endpoint limit is reached.

Like every call made with a secret key, it can also return missing_api_key, invalid_api_key, domain_not_verified, insufficient_permission, idempotency_conflict, region_mismatch, rate_limit_exceeded and internal_error.

Every error has the same body: error.type, error.code, error.message, error.doc_url and error.request_id. See Errors.

Questions about POST /v1/webhooks

Which credential does POST /v1/webhooks need?

A secret key with full_access permission. Send it as a Bearer token in the Authorization header, from your server only. A session client token is refused with insufficient_permission.

Does POST /v1/webhooks work with a test key?

Yes. It works with test keys and live keys. A test key reads and writes test objects only, and a live key works once the domain is verified.

Does POST /v1/webhooks count as a signature event?

No. A signature event is counted when a live record is written, by completing a session or by submitting a deferred acceptance. This call writes no record.

Is POST /v1/webhooks idempotent?

No. The response shows a secret once, so it is not kept for a replay. A repeat with the same Idempotency-Key runs again and creates another object.

What is the rate limit for POST /v1/webhooks?

The limit is counted for each key and depends on the plan: 2 requests per second on Free, 10 on Starter, 50 on Unlimited and 100 on Enterprise. Past the limit the API answers 429 rate_limit_exceeded with a Retry-After header.

Does the Node SDK have a method for POST /v1/webhooks?

Yes: esc.webhooks.create() in the esigncomply package. It resolves to { data, error } and does not throw.

Last updated · API version 2026-11-21