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>
WEBHOOKsupport.session.created

A support session was created (by any credential, test keys included).

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

support.session.created, .customer_connected, .joined, .ended, .rated, .attachment_added (with data.attachment), .consent (with data.consent) and .waiting (with data.alert, the waiting alert). Every one carries the session's consent receipt, null until the customer answered: .created always fires before they are asked. id is stable across retries. livemode is false for a test session's events (they are delivered all the same). Never carries the join code, the desk or the embed token. The session carries the agents' notes, outcome and the customer's csat whenever they are known (a rating usually arrives after .ended: that is .rated).

idstringrequired
typestringrequired
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
createdintegerrequired
Unix seconds.
livemodebooleanrequired
dataobjectrequired
Show child parameters
support_sessionobjectrequired
The fields a support session carries everywhere (the API and its webhooks). Times are Unix seconds.
Show child parameters
idstringrequired
objectstringrequired
support_session
livemodebooleanrequired
false for a session a test key created.
statestringrequired
waiting (no agent has joined yet), joined (an agent joined; still open), ended (see end_reason), expired (reached expires_at).
waiting | joined | ended | expired
modestringrequired
view: the agent sees the shared tab. cobrowse: the agent may also point, highlight, click, scroll and type INSIDE the page (applied by the embed to its own DOM, never as OS input; the customer sees it and can stop it).
view | cobrowse
customerobjectrequired
Who the customer is, as the company knows them. At most 16 fields; names are 1 to 40 letters, digits, _, - or .; values are strings of at most 200 plain characters, numbers or booleans; at most 2 KB in all. Shown to the company's own agents and webhooks only, and never written to the audit trail (only the field names are).
customer_verifiedbooleanrequired
false when a publishable key (the page itself) created the session: its customer is what the page said.
external_idstringrequired
As given at creation, else null.
metadataobjectrequired
Your own key-value pairs, echoed back and in webhooks, never shown to the customer. At most 20 keys of 1 to 40 letters, digits, _, - or .; each value a string of at most 500 characters without control characters.
originstringrequired
The page origin (or native app origin, app://…) the embed must run on, if pinned.
ownerstringrequired
The account that created it; its own and its team's agents see it.
created_atintegerrequired
Unix seconds.
expires_atintegerrequired
Unix seconds. An open session is ended (expired) then.
joined_atintegerrequired
Unix seconds of the first agent's join, else null.
joined_bystringrequired
The email of the last agent who joined.
ended_atintegerrequired
Unix seconds, else null.
end_reasonstringrequired
Why it ended: stopped (the customer pressed Stop), customer_cancelled (the customer, or their app, stopped while still waiting: no agent had joined), disconnected (their tab or app went away), expired (reached expires_at), ended_by_api (POST /support/sessions/{id}/end), customer_declined (the customer declined the consent step while waiting), consent_timeout (nobody answered the consent step in time). null while open.
stopped | customer_cancelled | disconnected | expired | ended_by_api | customer_declined | consent_timeout
duration_secondsintegerrequired
Seconds from created_at to ended_at, once ended; else null.
clientobjectrequired
What the customer's app or embed says about itself, shown on the agent's waiting card. Each field 1 to 64 printable ASCII characters; self-reported, never trusted for anything. null when not given.
admin_urlstringrequired
Your admin page for this customer, as given at creation (https:// only), else null.
connected_atintegerrequired
Unix seconds the customer's tab or app first connected (its wait starts then), else null.
notesstringrequired
The agents' private notes (PATCH /support/sessions/{id}); never the customer's to see.
outcomestringrequired
The agents' outcome tag: resolved, follow_up or bug; null until set.
resolved | follow_up | bug
csatobjectrequired
The customer's rating (POST /support/sessions/{id}/csat), once given; else null.
consentConsentReceiptrequired
The customer's consent receipt (POST /support/sessions/{id}/consent), once recorded; else null.
agentobject
support.session.joined only: the agent who joined.
Show child parameters
emailstringrequired
attachmentobject
support.session.attachment_added only: the file (never its bytes).
Show child parameters
objectstringrequired
support_attachment
idstringrequired
session_idstringrequired
filenamestringrequired
content_typestringrequired
What the customer declared (a plain type/subtype), else application/octet-stream. A label only.
sizeintegerrequired
Bytes.
created_atintegerrequired
Unix seconds.
consentobject
support.session.consent only: the receipt just recorded.
Show child parameters
idstringrequired
decisionstringrequired
accepted | declined | timeout
atstringrequired
When the customer answered (ISO 8601, the customer's clock).
surfacestringrequired
native_dialog (the library's dialog) or embedded (the web component, or the app's own UI).
native_dialog | embedded
localestringrequired
wording_versionstringrequired
wording_sha256stringrequired
choicesobjectrequired
os_userstring
The login name (never a full name or a path), else null.
osstringrequired
app_namestring
app_versionstring
sdkstringrequired
The library that made it (libgaiadesk_embed/0.4.0, the web bridge's gaiadesk-consent/0.1.0).
alertobject
support.session.waiting only: the waiting alert, exactly what Slack, Discord, email and push said.
Show child parameters
objectstringrequired
support_waiting_alert
session_idstringrequired
join_urlstringrequired
The console link that joins the customer (the session's join_url).
customerobjectrequired
Who is waiting.
waiting_secondsintegerrequired
Seconds since the customer connected.
summarystringrequired
The sentence every channel shows: "<name> (<external_id>) has been waiting <1 min 5 s> for support." (the parenthesis only when external_id is known).
{
  "id": "string",
  "type": "support.session.created",
  "created": 0,
  "livemode": true,
  "data": {
    "support_session": {
      "id": "string",
      "object": "support_session",
      "livemode": true,
      "state": "waiting",
      "mode": "view",
      "customer": {},
      "customer_verified": true,
      "external_id": "string",
      "metadata": {},
      "origin": "string",
      "owner": "string",
      "created_at": 0,
      "expires_at": 0,
      "joined_at": 0,
      "joined_by": "string",
      "ended_at": 0,
      "end_reason": "stopped",
      "duration_seconds": 0,
      "client": {
        "os": "string",
        "os_version": "string",
        "app_version": "string",
        "sdk": "string",
        "sdk_version": "string"
      },
      "admin_url": "string",
      "connected_at": 0,
      "notes": "string",
      "outcome": "resolved",
      "csat": {
        "rating": 0,
        "comment": "string",
        "rated_at": 0
      },
      "consent": {
        "id": "string",
        "decision": "accepted",
        "at": "2024-01-01T00:00:00Z",
        "surface": "native_dialog",
        "locale": "string",
        "wording_version": "string",
        "wording_sha256": "string",
        "choices": {
          "guided": true,
          "share_logs": true,
          "capture": "window"
        },
        "os_user": "string",
        "os": "string",
        "app_name": "string",
        "app_version": "string",
        "sdk": "string"
      }
    },
    "agent": {
      "email": "string"
    },
    "attachment": {
      "object": "support_attachment",
      "id": "string",
      "session_id": "string",
      "filename": "string",
      "content_type": "string",
      "size": 0,
      "created_at": 0
    },
    "consent": {
      "id": "string",
      "decision": "accepted",
      "at": "2024-01-01T00:00:00Z",
      "surface": "native_dialog",
      "locale": "string",
      "wording_version": "string",
      "wording_sha256": "string",
      "choices": {
        "guided": true,
        "share_logs": true,
        "capture": "window"
      },
      "os_user": "string",
      "os": "string",
      "app_name": "string",
      "app_version": "string",
      "sdk": "string"
    },
    "alert": {
      "object": "support_waiting_alert",
      "session_id": "string",
      "join_url": "string",
      "customer": {
        "name": "string",
        "external_id": "string"
      },
      "waiting_seconds": 0,
      "summary": "string"
    }
  }
}

Responses

200 Any 2xx acknowledges the delivery.
WEBHOOKsupport.session.customer_connected

The customer's tab or app consented and opened its connection (now waiting for an agent).

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

support.session.created, .customer_connected, .joined, .ended, .rated, .attachment_added (with data.attachment), .consent (with data.consent) and .waiting (with data.alert, the waiting alert). Every one carries the session's consent receipt, null until the customer answered: .created always fires before they are asked. id is stable across retries. livemode is false for a test session's events (they are delivered all the same). Never carries the join code, the desk or the embed token. The session carries the agents' notes, outcome and the customer's csat whenever they are known (a rating usually arrives after .ended: that is .rated).

idstringrequired
typestringrequired
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
createdintegerrequired
Unix seconds.
livemodebooleanrequired
dataobjectrequired
Show child parameters
support_sessionobjectrequired
The fields a support session carries everywhere (the API and its webhooks). Times are Unix seconds.
Show child parameters
idstringrequired
objectstringrequired
support_session
livemodebooleanrequired
false for a session a test key created.
statestringrequired
waiting (no agent has joined yet), joined (an agent joined; still open), ended (see end_reason), expired (reached expires_at).
waiting | joined | ended | expired
modestringrequired
view: the agent sees the shared tab. cobrowse: the agent may also point, highlight, click, scroll and type INSIDE the page (applied by the embed to its own DOM, never as OS input; the customer sees it and can stop it).
view | cobrowse
customerobjectrequired
Who the customer is, as the company knows them. At most 16 fields; names are 1 to 40 letters, digits, _, - or .; values are strings of at most 200 plain characters, numbers or booleans; at most 2 KB in all. Shown to the company's own agents and webhooks only, and never written to the audit trail (only the field names are).
customer_verifiedbooleanrequired
false when a publishable key (the page itself) created the session: its customer is what the page said.
external_idstringrequired
As given at creation, else null.
metadataobjectrequired
Your own key-value pairs, echoed back and in webhooks, never shown to the customer. At most 20 keys of 1 to 40 letters, digits, _, - or .; each value a string of at most 500 characters without control characters.
originstringrequired
The page origin (or native app origin, app://…) the embed must run on, if pinned.
ownerstringrequired
The account that created it; its own and its team's agents see it.
created_atintegerrequired
Unix seconds.
expires_atintegerrequired
Unix seconds. An open session is ended (expired) then.
joined_atintegerrequired
Unix seconds of the first agent's join, else null.
joined_bystringrequired
The email of the last agent who joined.
ended_atintegerrequired
Unix seconds, else null.
end_reasonstringrequired
Why it ended: stopped (the customer pressed Stop), customer_cancelled (the customer, or their app, stopped while still waiting: no agent had joined), disconnected (their tab or app went away), expired (reached expires_at), ended_by_api (POST /support/sessions/{id}/end), customer_declined (the customer declined the consent step while waiting), consent_timeout (nobody answered the consent step in time). null while open.
stopped | customer_cancelled | disconnected | expired | ended_by_api | customer_declined | consent_timeout
duration_secondsintegerrequired
Seconds from created_at to ended_at, once ended; else null.
clientobjectrequired
What the customer's app or embed says about itself, shown on the agent's waiting card. Each field 1 to 64 printable ASCII characters; self-reported, never trusted for anything. null when not given.
admin_urlstringrequired
Your admin page for this customer, as given at creation (https:// only), else null.
connected_atintegerrequired
Unix seconds the customer's tab or app first connected (its wait starts then), else null.
notesstringrequired
The agents' private notes (PATCH /support/sessions/{id}); never the customer's to see.
outcomestringrequired
The agents' outcome tag: resolved, follow_up or bug; null until set.
resolved | follow_up | bug
csatobjectrequired
The customer's rating (POST /support/sessions/{id}/csat), once given; else null.
consentConsentReceiptrequired
The customer's consent receipt (POST /support/sessions/{id}/consent), once recorded; else null.
agentobject
support.session.joined only: the agent who joined.
Show child parameters
emailstringrequired
attachmentobject
support.session.attachment_added only: the file (never its bytes).
Show child parameters
objectstringrequired
support_attachment
idstringrequired
session_idstringrequired
filenamestringrequired
content_typestringrequired
What the customer declared (a plain type/subtype), else application/octet-stream. A label only.
sizeintegerrequired
Bytes.
created_atintegerrequired
Unix seconds.
consentobject
support.session.consent only: the receipt just recorded.
Show child parameters
idstringrequired
decisionstringrequired
accepted | declined | timeout
atstringrequired
When the customer answered (ISO 8601, the customer's clock).
surfacestringrequired
native_dialog (the library's dialog) or embedded (the web component, or the app's own UI).
native_dialog | embedded
localestringrequired
wording_versionstringrequired
wording_sha256stringrequired
choicesobjectrequired
os_userstring
The login name (never a full name or a path), else null.
osstringrequired
app_namestring
app_versionstring
sdkstringrequired
The library that made it (libgaiadesk_embed/0.4.0, the web bridge's gaiadesk-consent/0.1.0).
alertobject
support.session.waiting only: the waiting alert, exactly what Slack, Discord, email and push said.
Show child parameters
objectstringrequired
support_waiting_alert
session_idstringrequired
join_urlstringrequired
The console link that joins the customer (the session's join_url).
customerobjectrequired
Who is waiting.
waiting_secondsintegerrequired
Seconds since the customer connected.
summarystringrequired
The sentence every channel shows: "<name> (<external_id>) has been waiting <1 min 5 s> for support." (the parenthesis only when external_id is known).
{
  "id": "string",
  "type": "support.session.created",
  "created": 0,
  "livemode": true,
  "data": {
    "support_session": {
      "id": "string",
      "object": "support_session",
      "livemode": true,
      "state": "waiting",
      "mode": "view",
      "customer": {},
      "customer_verified": true,
      "external_id": "string",
      "metadata": {},
      "origin": "string",
      "owner": "string",
      "created_at": 0,
      "expires_at": 0,
      "joined_at": 0,
      "joined_by": "string",
      "ended_at": 0,
      "end_reason": "stopped",
      "duration_seconds": 0,
      "client": {
        "os": "string",
        "os_version": "string",
        "app_version": "string",
        "sdk": "string",
        "sdk_version": "string"
      },
      "admin_url": "string",
      "connected_at": 0,
      "notes": "string",
      "outcome": "resolved",
      "csat": {
        "rating": 0,
        "comment": "string",
        "rated_at": 0
      },
      "consent": {
        "id": "string",
        "decision": "accepted",
        "at": "2024-01-01T00:00:00Z",
        "surface": "native_dialog",
        "locale": "string",
        "wording_version": "string",
        "wording_sha256": "string",
        "choices": {
          "guided": true,
          "share_logs": true,
          "capture": "window"
        },
        "os_user": "string",
        "os": "string",
        "app_name": "string",
        "app_version": "string",
        "sdk": "string"
      }
    },
    "agent": {
      "email": "string"
    },
    "attachment": {
      "object": "support_attachment",
      "id": "string",
      "session_id": "string",
      "filename": "string",
      "content_type": "string",
      "size": 0,
      "created_at": 0
    },
    "consent": {
      "id": "string",
      "decision": "accepted",
      "at": "2024-01-01T00:00:00Z",
      "surface": "native_dialog",
      "locale": "string",
      "wording_version": "string",
      "wording_sha256": "string",
      "choices": {
        "guided": true,
        "share_logs": true,
        "capture": "window"
      },
      "os_user": "string",
      "os": "string",
      "app_name": "string",
      "app_version": "string",
      "sdk": "string"
    },
    "alert": {
      "object": "support_waiting_alert",
      "session_id": "string",
      "join_url": "string",
      "customer": {
        "name": "string",
        "external_id": "string"
      },
      "waiting_seconds": 0,
      "summary": "string"
    }
  }
}

Responses

200 Any 2xx acknowledges the delivery.

Updated