POST
/
webhooks
Creates a webhook.
curl --request POST \
  --url https://api.sandbox.goteal.co/webhooks \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '{
  "name": "user-payroll-submitted",
  "events": [
    "user-payroll-submitted",
    "user-payroll-created"
  ],
  "url": "https://webhooks.company.com",
  "signing_secret": "very-secret",
  "encryption_key": "St/73LZ1xHkwX5TanL7V+YAVczn4acozPf3cFySKQXI=",
  "config": {
    "include_payload": true
  }
}'
{
  "webhook_id": "95a0e70b-fe02-4f47-aef9-2efff279df71",
  "name": "user-payroll-submitted",
  "events": [
    "user-payroll-submitted",
    "user-payroll-created"
  ],
  "url": "https://webhooks.company.com",
  "created_at": "2019-05-17T00:00:00.000Z"
}

Authorizations

X-API-KEY
string
header
required

Body

application/json
name
string
required

A unique name of the webhook

Example:

"user-payroll-submitted"

events
string[]
required
Example:
[
"user-payroll-submitted",
"user-payroll-created"
]
url
string<url>
required
Example:

"https://webhooks.company.com"

signing_secret
string

A secret to sign the body of the webhook as described at "https://docs.goteal.co"

Example:

"very-secret"

encryption_key
string

A randomly generated 32-byte key, encoded in Base64, used to encrypt messages. This key is necessary for encryption but is not retrievable after being set.

Example:

"St/73LZ1xHkwX5TanL7V+YAVczn4acozPf3cFySKQXI="

config
object

Configuration properties of the webhook

Response

Created

name
string
required

A unique name of the webhook

Example:

"user-payroll-submitted"

events
string[]
required
Example:
[
"user-payroll-submitted",
"user-payroll-created"
]
url
string<url>
required
Example:

"https://webhooks.company.com"

webhook_id
string
required

The id of the webhook

Example:

"95a0e70b-fe02-4f47-aef9-2efff279df71"

created_at
string<date-time>
required
Example:

"2019-05-17T00:00:00.000Z"