List webhooks

Currently, only one webhook is supported per one Planado instance.

$ curl -H "X-Planado-API-Key:XXX" https://api.planadoapp.com/v2/webhooks | jq
{
  "webhooks": [
    {
      "uuid": "5491b43c-d3a1-4bf4-ab43-cb2f3673d18c",
      "url": "https://example.com/planado-webhook-handler",
      "event_types": [
        "client_updated"
      ],
      "secret": "verysecret"
    }
  ]
}
Table 1. Fields of webhooks elements
Field Type JSON Type Can be null Description

uuid

UUID

String

No

Unique identifier

url

String

String

No

Webhook URL

event_types

[String]

Array

No

List of events to be delivered

secret

String

String

Yes

Optional secret that will be passed in X-Planado-Secret header

Requests

All webhook requests are tracked. Failed requests will be retried.

$ curl -H "X-Planado-API-Key:XXX" https://api.planadoapp.com/v2/webhooks/5491b43c-d3a1-4bf4-ab43-cb2f3673d18c/requests | jq
{
  "requests": [
    {
      "uuid": "b29766e7-b4b8-4b43-a8e5-d8186d81e00a",
      "event_type": "client_updated",
      "entity_type": "client",
      "entity_uuid": "b0a8e6e5-4846-4698-b38d-184517d09fe6",
      "entity_version": 2,
      "attempt_no": 2,
      "status": "sent",
      "http_request_body": "<long JSON body>",
      "http_response_code": null,
      "http_response_headers": null,
      "http_response_body": null,
      "send_at": "2020-04-26T01:15:36+00:00",
      "sent_at": "2020-04-26T01:15:40+00:00",
      "request_time_ms": 4,
      "error_type": "connection failure",
      "error_description": "Failed to open TCP connection to :80 (Connection refused - connect(2) for nil port 80)"
    },
    ...
  ]
}
Table 2. Fields of requests elements
Field Type JSON type Can be null Description

uuid

UUID

String

No

Unique identifier

event_type

String

String

No

Event type

entity_type

String

String

No

Can be 'job', 'client', or 'site'

entity_uuid

UUID

String

No

Entity identifier

entity_version

Integer

Number

No

Entity version

attempt_no

Integer

Number

No

Attempt #

status

String

String

No

'scheduled' or 'sent'

http_request_body

String

String

No

String-encoded JSON body

http_response_code

Integer

Number

Yes

Response status code

http_response_headers

Map

Object

Yes

Response headers

http_response_body

String

String

Yes

Response body

send_at

Timestamp

String

No

Scheduled request time

sent_at

Timestamp

String

Yes

Actual request time

request_time_ms

Integer

Number

Yes

Elapsed request time in milliseconds

error_type

String

String

No

If request fails with a non-HTTP error this field is added

error_description

String

String

Yes

If request fails with a non-HTTP error this field contains error description

Filters

To list failed requests that were rescheduled use scheduled filter:

$ curl -H "X-Planado-API-Key:XXX" https://api.planadoapp.com/v2/webhooks/5491b43c-d3a1-4bf4-ab43-cb2f3673d18c/requests?filter=scheduled | jq
{
  "requests": [
    ...
  ]
}