support
https://api.gaiadesk.net/v1 /support/sessions Scope supportThe support sessions of the caller's account and team, newest first (the console's queue).
Open sessions by default (state=open: waiting for an agent, or being helped); state=all adds ended and expired ones. customer_present says whether the customer's tab holds its connection right now, and desk_id is then the id an agent's console dials with join_code. Not for publishable keys.
Parameters
statestringquerylimitintegerqueryCode samples
cURL
curl -X GET "https://api.gaiadesk.net/v1/support/sessions" \
-H "Authorization: Bearer $GAIADESK_API_KEY"TypeScript
Python
Go
PHP
Ruby
Java
Responses
Example
{
"sessions": [
{
"id": "string",
"state": "waiting",
"mode": "view",
"customer": {},
"customer_present": true,
"customer_verified": true,
"join_code": "string",
"join_url": "string",
"desk_id": "string",
"origin": "string",
"owner": "string",
"created_at": 0,
"expires_at": 0,
"joined_at": 0,
"joined_by": "string",
"ended_at": 0,
"end_reason": "string"
}
]
}Schema
sessionsApiSupportSession[]requiredShow child parameters
idstringrequiredstatestringrequiredwaiting (no agent has joined yet), joined, ended (stopped by the customer, or their tab went away), expired.modestringrequiredview: 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).customerobjectrequired_, - 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_presentbooleanrequiredcustomer_verifiedbooleanrequiredfalse when a publishable key (the page itself) created the session: its customer is what the page said.join_codestringrequiredjoin_urlstringrequireddesk_idstringoriginstringownerstringrequiredcreated_atintegerrequiredexpires_atintegerrequiredjoined_atintegerjoined_bystringended_atintegerend_reasonstringstopped (the customer pressed Stop), disconnected (their tab went away), expired.X-Request-Idstringreq_…), also in every error body. Quote it to support.usage).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 & objectrequiredShow child parameters
deskstringkindstringrequiredmessagestringrequiredreasonstringoffline, unknown_desk, not_online, network, not_signed_in, timeout, local, …request_idstringrequiredstatusintegerGaiaDesk-Held) — the HTTP status this failure would have had, had its 200 not been sent already.e2eobjectmessage here is a placeholder).Show child parameters
vintegerrequiredeventsApiE2eFrame[]requiredShow child parameters
seqintegerrequirednoncestringrequiredciphertextstringrequiredrefused, unauthenticated).Same as 400 · GET /support/sessions
refused).Same as 400 · GET /support/sessions
refused, rate_limited).Same as 400 · GET /support/sessions
Retry-AfterintegerRateLimit-LimitintegerRateLimit-RemainingintegerRateLimit-Resetintegerhttps://api.gaiadesk.net/v1 /support/sessions Scope supportCreate a support session for the web embed SDK; returns its join code, join URL and embed token.
The company's backend (an API key with support), a signed-in person, or the embed itself with a PUBLISHABLE key creates a session. The answer's embed_token (gdemb_…, shown once) is what the customer's page hands GaiaDeskEmbed.start({ embedToken }); the page then shares its tab and waits. The company's support team (the owner's account and team) sees it in the console (GET /support/sessions) and joins with join_code.
A publishable key may call this operation and nothing else, only from one of the page origins registered on it (Origin), and its answer is readable by that origin alone. Its session is pinned to that origin, lives at most an hour, and its customer is marked unverified (customer_verified: false): the page, not the company, said who it is. A publishable key holds at most 25 open sessions and creates at most 10 a minute.
Parameters
Idempotency-KeystringheaderIdempotent-Replayed: true); the same key with a different request is refused (usage, idempotency_key_reused).Request body
application/json
modestringview: 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).customerobject_, - 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).expires_inintegeroriginstringhttps://app.example.com; http:// only for localhost). When given, the embed's connection must come from it. Not with a publishable key, whose session is pinned to the page that created it.{
"mode": "view",
"customer": {},
"expires_in": 0,
"origin": "string"
}Code samples
cURL
curl -X POST "https://api.gaiadesk.net/v1/support/sessions" \
-H "Authorization: Bearer $GAIADESK_API_KEY" \
-H "Idempotency-Key: <value>" \
-H "Content-Type: application/json" \
-d '{"mode":"view","customer":{},"expires_in":0,"origin":"string"}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
embed_token for the page; it is never shown again.Example
{
"id": "string",
"state": "waiting",
"mode": "view",
"customer": {},
"customer_present": true,
"customer_verified": true,
"join_code": "string",
"join_url": "string",
"desk_id": "string",
"origin": "string",
"owner": "string",
"created_at": 0,
"expires_at": 0,
"joined_at": 0,
"joined_by": "string",
"ended_at": 0,
"end_reason": "string",
"embed_token": "string"
}Schema
idstringrequiredstatestringrequiredwaiting (no agent has joined yet), joined, ended (stopped by the customer, or their tab went away), expired.modestringrequiredview: 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).customerobjectrequired_, - 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_presentbooleanrequiredcustomer_verifiedbooleanrequiredfalse when a publishable key (the page itself) created the session: its customer is what the page said.join_codestringrequiredjoin_urlstringrequireddesk_idstringoriginstringownerstringrequiredcreated_atintegerrequiredexpires_atintegerrequiredjoined_atintegerjoined_bystringended_atintegerend_reasonstringstopped (the customer pressed Stop), disconnected (their tab went away), expired.embed_tokenstringrequiredGaiaDeskEmbed.start({ embedToken })). Shown once; good only for this session, until it ends.X-Request-Idstringreq_…), also in every error body. Quote it to support.Idempotent-Replayedstringtrue when this answer is a stored one, replayed for a repeated Idempotency-Key.refused, unauthenticated).Same as 400 · GET /support/sessions
refused).Same as 400 · GET /support/sessions
refused, rate_limited).Same as 400 · GET /support/sessions
Retry-AfterintegerRateLimit-LimitintegerRateLimit-RemainingintegerRateLimit-Resetintegerhttps://api.gaiadesk.net/v1 /support/sessions/{session_id} Scope supportA support session's state.
A session owned by the caller's account or a team mate's; any other id answers 404 unknown_support_session. Not for publishable keys.
Parameters
session_idstringpathrequiredCode samples
cURL
curl -X GET "https://api.gaiadesk.net/v1/support/sessions/{session_id}" \
-H "Authorization: Bearer $GAIADESK_API_KEY"TypeScript
Python
Go
PHP
Ruby
Java
Responses
Example
{
"id": "string",
"state": "waiting",
"mode": "view",
"customer": {},
"customer_present": true,
"customer_verified": true,
"join_code": "string",
"join_url": "string",
"desk_id": "string",
"origin": "string",
"owner": "string",
"created_at": 0,
"expires_at": 0,
"joined_at": 0,
"joined_by": "string",
"ended_at": 0,
"end_reason": "string"
}Schema
idstringrequiredstatestringrequiredwaiting (no agent has joined yet), joined, ended (stopped by the customer, or their tab went away), expired.modestringrequiredview: 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).customerobjectrequired_, - 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_presentbooleanrequiredcustomer_verifiedbooleanrequiredfalse when a publishable key (the page itself) created the session: its customer is what the page said.join_codestringrequiredjoin_urlstringrequireddesk_idstringoriginstringownerstringrequiredcreated_atintegerrequiredexpires_atintegerrequiredjoined_atintegerjoined_bystringended_atintegerend_reasonstringstopped (the customer pressed Stop), disconnected (their tab went away), expired.X-Request-Idstringreq_…), also in every error body. Quote it to support.refused, unauthenticated).Same as 400 · GET /support/sessions
refused).Same as 400 · GET /support/sessions
unreachable, unknown_desk).Same as 400 · GET /support/sessions
refused, rate_limited).Same as 400 · GET /support/sessions
Retry-AfterintegerRateLimit-LimitintegerRateLimit-RemainingintegerRateLimit-Resetinteger