Webhooks

Create or replace your webhook

Changed on

Create your webhook, or replace its URL and types.

Creating it returns the signing secret, once. Replacing it keeps the secret, and resumes any disabled delivery from where it stopped, so nothing is skipped. To change the secret, rotate it.

put/webhook

Request

  • Base URL
    https://api.treasuryspring.com/api/v1
  • Auth
    HTTP bearer

Request body

typesWebhookDataType[] required

What to deliver.

urlstring required

HTTPS endpoint deliveries are POSTed to. Must be a public hostname, not an IP address; an international domain name must be given in its ASCII (xn--) form. Don't put credentials in it: verify each delivery's signature instead.

Example request

{
  "types": [
    "EVENT"
  ],
  "url": "https://example.com/webhooks/treasuryspring"
}

Response

The webhook, with its signing secret if it was just created

previousSecretExpiresAtstring date-time nullable

While a secret rotation is in progress, when deliveries stop also being signed with the previous secret; null otherwise.

secretstring nullable

Signing secret for verifying deliveries. Returned only when the subscription is created (201); store it securely. To change it, rotate it with POST /webhook/secret/rotate.

typesWebhookDataType[] required

What is delivered.

urlstring required

HTTPS endpoint deliveries are POSTed to.

Example response

{
  "secret": "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw",
  "types": [
    "EVENT"
  ],
  "url": "https://example.com/webhooks"
}

Changes