Authentication

Server to server only. Never put your client secret or tokens in a browser or mobile app.

Install

  1. A company admin reads your consent screen and clicks Install.
  2. We redirect their browser to your installUrl with ?code=occ_…. The code works once, for 10 minutes.
  3. Your server exchanges it at POST /api/partner/oauth/token:
FieldValue
grant_typeauthorization_code
codethe code from the redirect
client_id, client_secretin the body, or as HTTP Basic auth

The response:

{
  "access_token": "oca_p_…",        // 1 hour
  "refresh_token": "ocr_p_…",       // 90 days, single use
  "token_type": "Bearer",
  "expires_in": 3600,
  "scope": "people:read requests:write",
  "installation_id": "…",
  "company": { "id": "…", "name": "Lumen Group", "timezone": "Asia/Singapore" },
  "webhook_secret": "whsec_…",      // only if you receive webhooks
  "kann_secret": "ock_…"            // only if you host Kann tools
}

company, webhook_secret and kann_secret are returned only on this first exchange. Store them encrypted, keyed by installation_id.

Refresh

grant_type=refresh_token&refresh_token=ocr_p_…&client_id=…&client_secret=…

Each refresh token works once and returns a new one. If you use a refresh token twice, the second call fails. Keep only the newest.

When access ends

Calls return 401 when:

  • the company uninstalled your app,
  • we suspended your app,
  • the token expired (refresh it).

On 401 after a refresh fails, mark the installation inactive and stop calling.

Rotating your client secret

Build an app › New client secret replaces it at once. Deploy the new secret first, then rotate, because the old one stops working immediately.