Skip to main content
The portal token endpoint returns a short-lived user token that the platform backend uses to call the read-only Read APIs. The endpoint can also return a browser authorization URL when an existing Clink customer has not yet authorized this platform.

Request

For a new customer or a customer with an active LoginSession, email is enough:
For a first-time authorization of an existing Clink customer, send the full redirect and PKCE fields:

Authorized

Responses use the standard { code, msg, data } envelope. The examples below show the full response.
The token claims are: Use the token as Authorization: Bearer {PORTAL_TOKEN} on /agent/platform/**.

Authorization required

This means Clink found the existing customer but this platform client has no active LoginSession for them. Show the URL to the user, complete the standard OAuth callback with PKCE, then call this endpoint again. The authorization URL carries an email prefill for the Portal login page when available. The user still completes email OTP verification; the prefill only saves retyping the address. If the user cancels or denies authorization, do not retry in a way that bypasses the browser consent. Start a new authorization request instead.

New and existing users

The portal token is access-only. The platform does not receive a portal refresh token; it obtains a new portal token with the platform client token. The platform token remains the authority for obtaining a user token and must stay on the server.

Errors

Do not include the platform token or the portal token in browser URLs, logs, or Agent-visible output.

Next

Use the portal token with Read APIs.