Authentication
All server-to-server REST endpoints authenticate with an API key via the X-API-Key header.
The header
Section titled “The header”X-API-Key: sk_live_agent_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxTwo keys, two purposes
Section titled “Two keys, two purposes”| Key | Usage | Exposable? |
|---|---|---|
sk_live_agent_… | Server-side REST API (this doc) | No — backend only |
pk_live_… | Browser widget (client embed) | Yes — frontend |
The public key (pk_live_) is rejected on server-to-server REST routes. You’d get a 403 AUTH_API_KEY_FORBIDDEN.
Getting an API key
Section titled “Getting an API key”API keys are created from Settings → API Keys in the admin dashboard. You can create multiple keys (one per environment, per integration, etc.) and revoke them individually.
The full key is shown once at creation — copy it immediately.
Test your key
Section titled “Test your key”A read-only, side-effect-free call that returns the app tied to your key:
curl https://supportdesk.innovartx.com/api/v1/auth/whoami \ -H "X-API-Key: $SUPPORTDESK_API_KEY"If all good, you get a 200 OK with:
{ "success": true, "data": { "appId": "cl…", "slug": "your-app", "name": "Your App", "keyType": "agent" }}Possible errors
Section titled “Possible errors”| HTTP code | Business code | Cause |
|---|---|---|
401 | AUTH_API_KEY_MISSING | X-API-Key header missing |
401 | AUTH_API_KEY_INVALID | Key is malformed or matches no app |
401 | AUTH_API_KEY_EXPIRED | Key has passed its expiration date |
403 | AUTH_API_KEY_FORBIDDEN | You used a pk_live_ instead of a sk_live_agent_ |
See Errors for full error response format.