Skip to content
undertext developers
Skip to Content
undertext developers
REST API

Webhook endpoints

Choose where Undertext sends events, and get the secret to check they came from Undertext.

A webhook endpoint is a URL on your server where Undertext sends events: a comment, a mention, a suggestion accepted, a document an agent created, a seal. You turn them into notifications, emails and updates in your own lists. You can manage endpoints here or in the console. See Send notifications for a worked example and Webhook events for every event and its payload.

Each platform has its own endpoints, and hears only its own events.

The webhook endpoint object

AttributeTypeDescription
idstringThe endpoint's id, starting we_.
urlstringWhere Undertext posts events.
eventsarrayThe event types it receives, or ["*"] for all of them, including types added later.
created_attimestampWhen it was created.
secretstringThe signing secret, starting whsec_. Returned only when you create the endpoint or roll its secret.
{
  "id": "we_5Kd2Hs8N",
  "url": "https://acme.com/undertext/events",
  "events": ["thread.created", "thread.replied", "mention.created", "seal.created"],
  "created_at": "2026-10-30T18:20:00Z"
}

Create a webhook endpoint

POST /v1/webhook-endpoints

ParameterTypeDescription
urlstring, requiredAn https URL. For your machine, use a tunnel.
eventsarray, requiredEvent types, such as ["mention.created", "seal.created"], or ["*"] for all.
curl https://api.undertext.sh/v1/webhook-endpoints \
  -H "Authorization: Bearer $UNDERTEXT_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://acme.com/undertext/events",
    "events": ["thread.created", "thread.replied", "mention.created", "seal.created"]
  }'

Returns the endpoint with its secret, with 201.

{
  "id": "we_5Kd2Hs8N",
  "url": "https://acme.com/undertext/events",
  "events": ["thread.created", "thread.replied", "mention.created", "seal.created"],
  "created_at": "2026-10-30T18:20:00Z",
  "secret": "whsec_R4n8Vq2Lk7Tz1Mx9Pw3Hc6Bs"
}
ErrorWhen
400 invalid_parameter on urlNot a URL, or not https.
400 invalid_parameter on eventsAn event type doesn't exist.

List webhook endpoints

GET /v1/webhook-endpoints

Your endpoints, newest first. Secrets aren't included.

ParameterTypeDescription
limitinteger1 to 100. Default 50.
afterstringThe next cursor from the previous page.
curl https://api.undertext.sh/v1/webhook-endpoints \
  -H "Authorization: Bearer $UNDERTEXT_SECRET_KEY"
{
  "data": [
    {
      "id": "we_5Kd2Hs8N",
      "url": "https://acme.com/undertext/events",
      "events": ["thread.created", "thread.replied", "mention.created", "seal.created"],
      "created_at": "2026-10-30T18:20:00Z"
    }
  ],
  "next": null
}

Roll a signing secret

POST /v1/webhook-endpoints/{endpoint_id}/roll-secret

Issues a new signing secret. For the next 24 hours Undertext signs each event with both the old and the new secret, so you can deploy the new one without dropping events. See Verifying signatures.

ParameterTypeDescription
endpoint_idstring, path, requiredThe endpoint's id.
curl https://api.undertext.sh/v1/webhook-endpoints/we_5Kd2Hs8N/roll-secret \
  -X POST \
  -H "Authorization: Bearer $UNDERTEXT_SECRET_KEY"

Returns the endpoint with its new secret.

Delete a webhook endpoint

DELETE /v1/webhook-endpoints/{endpoint_id}

Stops sending events to the endpoint. Events already on their way, including retries, are dropped.

ParameterTypeDescription
endpoint_idstring, path, requiredThe endpoint's id.
curl https://api.undertext.sh/v1/webhook-endpoints/we_5Kd2Hs8N \
  -X DELETE \
  -H "Authorization: Bearer $UNDERTEXT_SECRET_KEY"
{
  "id": "we_5Kd2Hs8N",
  "deleted": true
}

Delivery

Each event is a POST with a JSON body and an Undertext-Signature header. Check the signature before you trust the body: undertext.webhooks.verify(rawBody, header, secret) does it in Node. Answer with any 2xx within 10 seconds; anything else, or no answer, is retried with backoff for 3 days. Events can arrive more than once or out of order, so skip ids you've already handled. The webhook events reference has the signature format and every event's payload.

On this page