Support API

Quick start: API only (your backend talks to Gauge)

No widget and no WebView: your backend provisions users, grants them Integrations and mints sign-in links. Every call uses a server API key (Authorization: Bearer pulse_k_…) with support scope.

export GAUGE=https://app.gauge.chat/backend
export KEY=pulse_k_test_...        # a test key reaches the sandbox only
export APP=<your App id>

1. Provision a user and grant Integrations

curl -sS -X PUT "$GAUGE/v1/support/customers/by-ref/u_1029" \
  -H "Authorization: Bearer $KEY" -H 'content-type: application/json' \
  -d "{\"email\":\"layla@example.com\",\"projectIds\":[\"$APP\"],\"integrationKeys\":{\"$APP\":[\"customer\"]}}"

integrationKeys is authoritative for each App you name. On an App with several integrations an empty list means the default integration only.

curl -sS -X POST "$GAUGE/v1/support/sessions" \
  -H "Authorization: Bearer $KEY" -H 'content-type: application/json' \
  -d "{\"projectId\":\"$APP\",\"externalRef\":\"u_1029\",\"integration\":\"customer\"}"
# → 201 {"url":"https://…","expiresAt":"…"}
AnswerMeaning
201Redirect the browser (or WebView) to url. Single use, mint per open
403 integration_not_grantedGrant the key in step 1 first
404 unknown_integrationThe App has no integration with that key

3. Revoke

Send the user again without the key: "integrationKeys":{"<appId>":[]}. Their live chat on it ends at their next message, and tokens minted before the change stop working.

Signed tokens from your backend

If your own frontend opens the widget, mint a token instead of a link; see integration-token.md.

On this page