OAuth for Direct API Access
Use OAuth authorization to connect custom apps and call We360.ai APIs directly.
Use this path when you need a custom integration. It is the right option for direct API access.
API guides
Overview
The we360.ai API uses OAuth 2.0 Resource Owner Password Credentials.
A successful login returns:
access_tokenrefresh_token
The flow is:
Call the Login API with your Customer ID, email, and password.
Receive an
access_tokenandrefresh_token.Send the
access_tokenas a Bearer token in every API request.Call the Refresh Token API when the
access_tokenexpires.Call the Login API again if the
refresh_tokenis no longer valid.
Login API
Use this endpoint to authenticate and get the first token pair.
Endpoint
cURL example
Request parameters
client_id
Your Customer ID. Retrieve it from the profile icon in the top-right corner of the we360.ai portal.
username
The registered email address associated with your we360.ai account.
password
The password for your we360.ai account.
grant_type
Must be password.
Sample response
Response fields
access_token
JWT used to authenticate API requests. Valid for 10 hours, subject to change.
refresh_token
Used to obtain a new access_token without logging in again.
token_type
Always Bearer.
not-before-policy
Keycloak policy timestamp. Usually 0.
session_state
UUID for the active authentication session.
scope
Granted scopes such as email, profile, and offline_access.
Refresh Token API
Use this endpoint to get a new token pair when the current access_token expires.
Endpoint
cURL example
Request parameters
client_id
Your Customer ID. Use the same value used during login.
refresh_token
The refresh_token returned by a previous Login or Refresh Token response.
grant_type
Must be refresh_token.
Sample response
If the Refresh Token API returns a non-200 status, the refresh_token has expired or was invalidated. Call the Login API again to get a fresh token pair.
Use the bearer token
Send the access_token in the Authorization header of every API request:
Example
Bearer tokens are sensitive credentials. Never expose them in client-side code, URLs, logs, or version control. Always send them over HTTPS.
Token lifecycle and best practices
access_token
10 hours, may change
Call the Refresh Token API
refresh_token
Server-defined
Call the Login API again
Additional recommendations:
Store tokens securely. Use environment variables or a secrets manager.
Refresh proactively. Check expiry before each request.
Always store the newest
access_tokenandrefresh_token.Use HTTPS only.
Revoke the session on logout if your application supports it.
If your environment restricts outbound traffic, allow the required domains listed in The "Allowlist" Guide.
Last updated
Was this helpful?