Request authorization

Send the access token in the Authorization header:

http
Authorization: Bearer {{Access Token}}

Obtain a token using one of the grant types below.

Authorization request configured in Postman

The callback URL is the registered URL where the user returns after a successful login.

SettingLiveDeveloper version
Auth URLhttps://api.lifepeaks.dk/authorizehttps://api-dev.lifepeaks.dk/authorize
Access Token URLhttps://api.lifepeaks.dk/tokenhttps://api-dev.lifepeaks.dk/token

The state parameter is required. Generate an unpredictable value for each authorization request and verify it when the user returns to your callback URL.

Grant types

Three grant types are enabled. There is no client_credentials grant.

grant_typeAdditional fieldsUsed for
passwordusername, passwordServer-to-server integrations. See Authorization via curl.
authorization_codecode, redirect_uriBrowser flows that send the user through /authorize.
refresh_tokenrefresh_tokenExchanging a refresh token for a new access token. A new refresh token is issued every time.

client_id and client_secret are required for all three. They can be sent in the form body, or as HTTP Basic auth.

Access tokens are valid for 86400 seconds (24 hours). Refresh tokens expire after 1209600 seconds (14 days).

Endpoints

EndpointPurpose
POST /tokenExchange credentials for an access token. Also reachable as POST /oauth2/token.
POST /oauth2/revokeRevoke an access or refresh token. Takes token and an optional token_type_hint.
GET /authorizeBrowser entry point for the authorization code flow. Redirects to /login when no session exists.
GET /loginLogin form for the authorization code flow. Posting valid credentials continues the authorize request.
GET /logoutEnds the browser session.

The full request and response shapes are in the v1 API reference.

Idempotency

Every response carries an X-Request-Guid header. Sending that value back as the X-Request-Guid request header on a retry replays the recorded response instead of executing the action twice. See Data.

Company credentials

A super admin can find the client ID and client secret in the company’s API settings. Register the redirect (callback) URL there before using the authorization code flow.

Company API settings in the admin

API users

Create a user with the API user permission. Super admins can manage these accounts in Users Admin. Use separate API users for separate integrations, such as your website, POS, or affiliate platform.

Creating an API user in the admin