Skip to content

Authentication & API keys

WhatsTIG has two separate authentication mechanisms:

WhoMechanismUsed for
Your servers and integrationsProject API key (Authorization: Bearer wt_live_...)The /v1 API
People using the dashboardEmail + password session (optional TOTP 2FA), secure cookieThe dashboard only

Dashboard sessions never authenticate /v1, and API keys never authenticate the dashboard.

API keys

GET /v1/instances HTTP/1.1
Host: api.whatstig.com
Authorization: Bearer wt_live_k7d2m9q4ab_2bX9...

Format: wt_live_<keyId>_<secret>. The keyId part (e.g. shown as wt_live_k7d2m9q4ab in the dashboard) identifies the key; the secret is never stored by WhatsTIG, only an HMAC of it with a server-side pepper. The full key is shown once, when it is created or rotated.

Each key belongs to exactly one project. It can only see and change that project's instances, messages, media, webhooks and events. Resources of other projects respond 404 NOT_FOUND, exactly as if they did not exist.

Scopes

ScopeAllows
instances:readList/get instances, status, QR
instances:writeCreate, update, connect, reconnect, disconnect, logout, delete instances, create connect links
messages:readList/get messages and their status history
messages:sendSend messages
media:read / media:writeGet / upload and import media
webhooks:read / webhooks:writeRead / manage webhook endpoints, deliveries, replay, test
events:readRead the event log
usage:readRead usage and plan limits
keys:read / keys:writeManage API keys of the project (a key can only grant scopes it has)
conversations:read / conversations:writeRead / reply to and manage team inbox conversations
contacts:read / contacts:writeRead / manage contacts, tags, consent and imports
campaigns:read / campaigns:write / campaigns:launchRead / manage segments and campaigns / launch them
leads:read / leads:writeRead / capture, update, assign and convert CRM leads; notes and tasks
deals:read / deals:writeRead / manage deals and the pipeline board
companies:read / companies:writeRead / manage companies
crm:adminCRM settings, pipelines, custom fields, scoring and assignment rules, lead forms and links

A request without the needed scope fails with 403 INSUFFICIENT_SCOPE and details.required naming the scope.

Managing keys

  • Dashboard: Project → API keys (create with scopes, rotate, revoke).
  • API (needs keys:write): POST /v1/keys, GET /v1/keys, DELETE /v1/keys/{id} (revoke), POST /v1/keys/{id}/rotate.

Revocation takes effect immediately on every API server. Rotation issues a new key with the same name and scopes and revokes the old one; deploy the new key first if you need zero downtime (create a second key, switch, then revoke the first).

Rules

  • Keep keys on servers. Never ship a key to a browser, mobile app or desktop client. If your product's frontend needs to show a QR code, fetch it through your own backend, or use a hosted connect link.
  • Use one key per integration/environment so you can revoke independently.
  • Grant the minimum scopes. A notification service usually needs only messages:send and messages:read.

Errors

StatusCodeMeaning
401UNAUTHENTICATEDMissing, malformed, unknown, revoked or expired key
403INSUFFICIENT_SCOPEKey lacks the scope for this operation
403FORBIDDENThe organization or project is not active

Dashboard sessions (for completeness)

Dashboard users sign up with email and password (minimum 10 characters), must verify their email, and can enable TOTP two-factor authentication in Organization settings. Sessions last 7 days and are stored server-side; cookies are HttpOnly, SameSite=Lax and Secure in production. Cookie-authenticated state-changing requests must come from the dashboard origin (Origin check) as CSRF protection.