Authentication
The TrueApp Public Developer API uses Bearer JWT Tokens for authentication and authorization. You generate access tokens by exchanging your clientId and clientSecret, which are issued when installing an App Instance in your organization.
- Access Token Lifespan: 1 hour
- Refresh Token Lifespan: Rotating (used to obtain a fresh access token)
Header Requirements
All API endpoints (except /public/v1/auth/*) require the Authorization header:
Authorization: Bearer <ACCESS_TOKEN>
Authentication Endpoints
A. Generate Access Token
Exchanges client credentials for an access token and a refresh token.
Request Body
Content-Type: application/json
{
"clientId": "tru_client_a1b2c3d4e5f6",
"clientSecret": "tru_secret_9f8e7d6c5b4a3f2e1d"
}cURL Request
curl -X POST https://api.internal.gettru.app/public/v1/auth/token \
-H "Content-Type: application/json" \
-d '{
"clientId": "tru_client_a1b2c3d4e5f6",
"clientSecret": "tru_secret_9f8e7d6c5b4a3f2e1d"
}'
Response (200 OK)
200 OK
{
"success": true,
"data": {
"accessToken": "eyJhbGciOiJIUzI1Ni...",
"refreshToken": "tru_ref_x1y2z3...",
"expiresIn": 3600,
"tokenType": "Bearer"
}
}B. Refresh Access Token
Exchanges a rotating refresh token for a fresh access token.
Request Body
Content-Type: application/json
{
"refreshToken": "tru_ref_x1y2z3..."
}cURL Request
curl -X POST https://api.internal.gettru.app/public/v1/auth/refresh \
-H "Content-Type: application/json" \
-d '{
"refreshToken": "tru_ref_x1y2z3..."
}'
Response (200 OK)
200 OK
{
"success": true,
"data": {
"accessToken": "eyJhbGciOiJIUzI1Ni...",
"refreshToken": "tru_ref_new_a1b2...",
"expiresIn": 3600,
"tokenType": "Bearer"
}
}C. Revoke Refresh Token
Revokes a refresh token immediately to prevent future token generations.
Request Body
Content-Type: application/json
{
"refreshToken": "tru_ref_x1y2z3..."
}cURL Request
curl -X POST https://api.internal.gettru.app/public/v1/auth/revoke \
-H "Content-Type: application/json" \
-d '{
"refreshToken": "tru_ref_x1y2z3..."
}'
Response (200 OK)
200 OK
{
"success": true,
"message": "Token revoked successfully."
}