webhook-events

Embed
Preview of the card
<a href="https://gaiadesk.net/docs/ref-webhook-events"><img src="https://gaiadesk.net/docs/_api/public/orgs/89a5df38-be2c-4963-8823-21d4bd40a2ab/spaces/57b99ea0-d45a-4986-8aa6-6b0683c9fe1d/pages/9aa8864d-dc3d-41ea-a0ab-717e15df6a4b/social-card.svg?v=3e7ae33eec8b" alt="webhook-events" width="600" height="315"></a>
WEBHOOKdesk.online

A desk came online (its signaling socket registered).

Parameters

GaiaDesk-Signaturestringheaderrequired
t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<raw body>" keyed with the webhook secret>. Reject a delivery whose t is more than five minutes off, and de-duplicate by the event id.

Payload

application/json

One delivery. id is stable across retries; de-duplicate by it.

idstringrequired
typestringrequired
desk.online | desk.offline | desk.woke | job.finished | desk.health | support.session.created | support.session.customer_connected | support.session.joined | support.session.ended | support.session.rated | support.session.attachment_added | support.session.consent | support.session.waiting | support.request.created | support.request.accepted | support.request.declined | support.request.expired
createdintegerrequired
dataobjectrequired
Show child parameters
deskobjectrequired
Show child parameters
desk_idstringrequired
ownerstringrequired
reasonstringrequired
reason_textstringrequired
versionstring
woke_after_msinteger
desk.woke: how long after the ring it came online.
{
  "id": "string",
  "type": "desk.online",
  "created": 0,
  "data": {
    "desk": {
      "desk_id": "string",
      "owner": "string",
      "reason": "string",
      "reason_text": "string",
      "version": "string",
      "woke_after_ms": 0
    }
  }
}

Responses

200 Any 2xx acknowledges the delivery; anything else is retried with backoff for 24 hours.
WEBHOOKdesk.offline

A desk went offline, with the reason (the reach log's).

Parameters

GaiaDesk-Signaturestringheaderrequired
t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<raw body>" keyed with the webhook secret>. Reject a delivery whose t is more than five minutes off, and de-duplicate by the event id.

Payload

application/json

One delivery. id is stable across retries; de-duplicate by it.

idstringrequired
typestringrequired
desk.online | desk.offline | desk.woke | job.finished | desk.health | support.session.created | support.session.customer_connected | support.session.joined | support.session.ended | support.session.rated | support.session.attachment_added | support.session.consent | support.session.waiting | support.request.created | support.request.accepted | support.request.declined | support.request.expired
createdintegerrequired
dataobjectrequired
Show child parameters
deskobjectrequired
Show child parameters
desk_idstringrequired
ownerstringrequired
reasonstringrequired
reason_textstringrequired
versionstring
woke_after_msinteger
desk.woke: how long after the ring it came online.
{
  "id": "string",
  "type": "desk.online",
  "created": 0,
  "data": {
    "desk": {
      "desk_id": "string",
      "owner": "string",
      "reason": "string",
      "reason_text": "string",
      "version": "string",
      "woke_after_ms": 0
    }
  }
}

Responses

200 Any 2xx acknowledges the delivery.
WEBHOOKdesk.woke

A desk rung through the API came online within three minutes.

Parameters

GaiaDesk-Signaturestringheaderrequired
t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<raw body>" keyed with the webhook secret>. Reject a delivery whose t is more than five minutes off, and de-duplicate by the event id.

Payload

application/json

One delivery. id is stable across retries; de-duplicate by it.

idstringrequired
typestringrequired
desk.online | desk.offline | desk.woke | job.finished | desk.health | support.session.created | support.session.customer_connected | support.session.joined | support.session.ended | support.session.rated | support.session.attachment_added | support.session.consent | support.session.waiting | support.request.created | support.request.accepted | support.request.declined | support.request.expired
createdintegerrequired
dataobjectrequired
Show child parameters
deskobjectrequired
Show child parameters
desk_idstringrequired
ownerstringrequired
reasonstringrequired
reason_textstringrequired
versionstring
woke_after_msinteger
desk.woke: how long after the ring it came online.
{
  "id": "string",
  "type": "desk.online",
  "created": 0,
  "data": {
    "desk": {
      "desk_id": "string",
      "owner": "string",
      "reason": "string",
      "reason_text": "string",
      "version": "string",
      "woke_after_ms": 0
    }
  }
}

Responses

200 Any 2xx acknowledges the delivery.
WEBHOOKjob.finished

A background job started through the API ended (exited, killed, or lost).

Parameters

GaiaDesk-Signaturestringheaderrequired
t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<raw body>" keyed with the webhook secret>. Reject a delivery whose t is more than five minutes off, and de-duplicate by the event id.

Payload

application/json

job.finished: a background job started through the API ended. id is stable across retries.

idstringrequired
typerequired
createdintegerrequired
dataobjectrequired
Show child parameters
deskobjectrequired
Show child parameters
desk_idstringrequired
ownerstringrequired
jobobjectrequired
A background job on a desk.
Show child parameters
bystring
Who started it: the token's name, or owner for a person.
commandstringrequired
ended_at_msinteger
enforcementstring[]
How the desk enforces them, one line each, in its own words — and what it could not do here (e.g. "cgroups v2 not available: …").
exit_codeinteger
limitsJobLimits
The caps and keep-awake it runs under, as the desk applied them (keep_awake resolved against the desk's default). None from a desk before job limits, and for a job started with none.
log_bytesinteger
Bytes of output kept (current log plus its one rotated predecessor).
= 0
max_runninginteger
The desk's limit on jobs running at once; a job past it waits in state queued. Absent from a desk before queueing.
namestringrequired
pidinteger
queue_positioninteger
1-based place in the queue while state is queued.
reasonstring
Why it ended as it did, as a machine reads it, when the desk knows: blocked_by_os_policy — Windows Smart App Control or WDAC refused to start a program it ran (its state then says so in words); machine_rebooted — lost because the desk's machine restarted while it ran (ended_at_ms is the boot); dropped_on_reboot — lost while queued: a restart came before its turn and its start was not kept (it had secret files).
started_at_msintegerrequired
statestringrequired
queued (waiting for a free slot), running, exited, killed, or lost (its process is gone and how it ended was never recorded; reason says when a machine restart did it).
{
  "id": "string",
  "type": {},
  "created": 0,
  "data": {
    "desk": {
      "desk_id": "string",
      "owner": "string"
    },
    "job": {
      "by": "",
      "command": "string",
      "ended_at_ms": 0,
      "enforcement": [
        "string"
      ],
      "exit_code": 0,
      "limits": {
        "cpu_percent": 0,
        "keep_awake": true,
        "max_runtime_secs": 0,
        "mem_mb": 0,
        "priority": "string"
      },
      "log_bytes": 0,
      "max_running": 0,
      "name": "string",
      "pid": 0,
      "queue_position": 0,
      "reason": "string",
      "started_at_ms": 0,
      "state": "string"
    }
  }
}

Responses

200 Any 2xx acknowledges the delivery.
WEBHOOKdesk.health

A desk's report crossed one of its health thresholds (disk free, swap, load, critical memory pressure). Once per desk and condition per 6 hours.

Parameters

GaiaDesk-Signaturestringheaderrequired
t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<raw body>" keyed with the webhook secret>. Reject a delivery whose t is more than five minutes off, and de-duplicate by the event id.

Payload

application/json

desk.health: a desk's report crossed a threshold (GET/PUT /api/desks/{id}/health, gaiadesk-cli health set; defaults disk under 10% free, swap over 75% used, 5-minute load over 2 per CPU; macOS critical memory pressure always counts). One event per condition, at most once per desk and condition per 6 hours. id is stable across retries.

idstringrequired
typerequired
createdintegerrequired
dataobjectrequired
Show child parameters
deskobjectrequired
Show child parameters
desk_idstringrequired
ownerstringrequired
warningobjectrequired
Show child parameters
kindstringrequired
disk_low | swap_high | load_high | memory_pressure
textstringrequired
reportobjectrequired
The desk's figures; any may be absent (the OS would not say; no load average on Windows).
Show child parameters
disk_free_pctnumber
disk_mountstring
swap_used_mbinteger
swap_total_mbinteger
load_per_cpunumber
mem_pressurestring
normal | warn | critical
{
  "id": "string",
  "type": {},
  "created": 0,
  "data": {
    "desk": {
      "desk_id": "string",
      "owner": "string"
    },
    "warning": {
      "kind": "disk_low",
      "text": "string"
    },
    "report": {
      "disk_free_pct": 0,
      "disk_mount": "string",
      "swap_used_mb": 0,
      "swap_total_mb": 0,
      "load_per_cpu": 0,
      "mem_pressure": "normal"
    }
  }
}

Responses

200 Any 2xx acknowledges the delivery.

Updated