webhooks
GET
https://api.gaiadesk.net/v1 /webhooks Scope webhooksThe account's webhook subscriptions (never their secrets).
Code samples
cURL
curl -X GET "https://api.gaiadesk.net/v1/webhooks" \
-H "Authorization: Bearer $GAIADESK_API_KEY"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 The subscriptions.
Example
{
"webhooks": [
{
"id": "string",
"url": "string",
"events": [
"desk.online"
],
"description": "string",
"created_at": 0
}
]
}Schema
webhooksApiWebhook[]requiredShow child parameters
idstringrequiredurlstringrequiredeventsApiWebhookEventType[]requireddescriptionstringrequiredcreated_atintegerrequiredHeaders
X-Request-IdstringThis request's id (
req_…), also in every error body. Quote it to support.401 No credential, or one that does not verify (
refused, unauthenticated).Example
{
"error": {
"desk": "string",
"kind": "string",
"message": "string",
"reason": "string",
"request_id": "string",
"status": 0
},
"e2e": {
"v": 0,
"events": [
{
"seq": 0,
"nonce": "string",
"ciphertext": "string"
}
]
}
}Schema
errorError & objectrequiredThe CLI's error object plus this request's id.
Show child parameters
deskstringThe desk it concerned, when there was one.
kindstringrequiredThe six kinds a program branches on. Stable: a new kind would be a breaking change, so match with a wildcard arm anyway.
messagestringrequiredreasonstringThe finer cause:
offline, unknown_desk, not_online, network, not_signed_in, timeout, local, …request_idstringrequiredstatusintegerOnly in a held body (
GaiaDesk-Held) — the HTTP status this failure would have had, had its 200 not been sent already.e2eobjectAn end-to-end encrypted operation's events; the last opens to the desk's real error (its
message here is a placeholder).Show child parameters
vintegerrequiredeventsApiE2eFrame[]requiredShow child parameters
seqintegerrequirednoncestringrequiredciphertextstringrequired429 Over this key's rate limit (
refused, rate_limited).Same as 401 · GET /webhooks
Headers
Retry-AfterintegerSeconds to wait before trying again.
RateLimit-LimitintegerRequests allowed per window for this key.
RateLimit-RemainingintegerRequests left in the current window.
RateLimit-ResetintegerSeconds until the window resets.
POST
https://api.gaiadesk.net/v1 /webhooks Scope webhooksSubscribe an HTTPS endpoint to events. The signing secret is returned once.
Parameters
Idempotency-KeystringheaderUp to 255 printable ASCII characters. A retry with the same key and the same request within 24 hours gets the first answer again (
Idempotent-Replayed: true); the same key with a different request is refused (usage, idempotency_key_reused).Request body
application/json
urlstringrequiredAn
https:// URL on the public internet (no private, loopback or link-local address).eventsApiWebhookEventType[]requireddescriptionstring{
"url": "string",
"events": [
"desk.online"
],
"description": "string"
}Code samples
cURL
curl -X POST "https://api.gaiadesk.net/v1/webhooks" \
-H "Authorization: Bearer $GAIADESK_API_KEY" \
-H "Idempotency-Key: <value>" \
-H "Content-Type: application/json" \
-d '{"url":"string","events":["desk.online"],"description":"string"}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
201 Subscribed. Keep
secret; it is never shown again.Example
{
"id": "string",
"url": "string",
"events": [
"desk.online"
],
"description": "string",
"created_at": 0,
"secret": "string"
}Schema
idstringrequiredurlstringrequiredeventsApiWebhookEventType[]requireddescriptionstringrequiredcreated_atintegerrequiredsecretstringrequiredThe signing secret (
whsec_…). Shown once.Headers
X-Request-IdstringThis request's id (
req_…), also in every error body. Quote it to support.Idempotent-Replayedstringtrue when this answer is a stored one, replayed for a repeated Idempotency-Key.401 No credential, or one that does not verify (
refused, unauthenticated).Same as 401 · GET /webhooks
429 Over this key's rate limit (
refused, rate_limited).Same as 401 · GET /webhooks
Headers
Retry-AfterintegerSeconds to wait before trying again.
RateLimit-LimitintegerRequests allowed per window for this key.
RateLimit-RemainingintegerRequests left in the current window.
RateLimit-ResetintegerSeconds until the window resets.
DELETE
https://api.gaiadesk.net/v1 /webhooks/{webhook_id} Scope webhooksUnsubscribe. Deliveries still queued for it are dropped.
Parameters
webhook_idstringpathrequiredCode samples
cURL
curl -X DELETE "https://api.gaiadesk.net/v1/webhooks/{webhook_id}" \
-H "Authorization: Bearer $GAIADESK_API_KEY"TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 Deleted.
Example
{
"deleted": "string"
}Schema
deletedstringrequiredHeaders
X-Request-IdstringThis request's id (
req_…), also in every error body. Quote it to support.401 No credential, or one that does not verify (
refused, unauthenticated).Same as 401 · GET /webhooks
404 No such desk or resource visible to the caller (
unreachable, unknown_desk).Same as 401 · GET /webhooks
429 Over this key's rate limit (
refused, rate_limited).Same as 401 · GET /webhooks
Headers
Retry-AfterintegerSeconds to wait before trying again.
RateLimit-LimitintegerRequests allowed per window for this key.
RateLimit-RemainingintegerRequests left in the current window.
RateLimit-ResetintegerSeconds until the window resets.
Updated