v1

latestOpenAPI 3.1.02026-07-2420077.8 KB

Create a webhook endpoint

Subscribes to one or more events, the target url of the webhook must be unique for the account.

post/webhooks

Request body

namestring

A name that identifies this subscription. This name will be sent on the notification JSON payload.

urlstring

Target URL where notification JSON payloads will be POSTed.

secretstring

A secret only know by the user and TravelPerk. This secret will be used to sign the payload and send it in the Tk-Signature header.

eventsstring[]

A list of event names to which the user is subscribing to.

Response

200

idstring
namestring
urlstring
secretstring
statusstring
eventsstring[]
successfully_sentinteger
failed_sentinteger
error_rateinteger

Example response

{
  "id": "b42820bb-24c9-48da-bded-487681e9c851",
  "name": "invoice webhook",
  "url": "https://mycompany.com/tkwebhooks",
  "secret": "some secret",
  "status": "enabled",
  "events": [
    "invoice.issued"
  ]
}