πŸ” Authentication

Token-Based Authentication

The Public API uses JWT (JSON Web Token) authentication. Start here to obtain an access token before calling other endpoints.

Authentication Flow

Your App          Adaptria API
   β”‚                    β”‚
   β”‚  POST /api/credentials/token
   β”‚  {clientId, clientSecret}
   β”‚ ──────────────────▢│
   β”‚                    β”‚
   β”‚  {accessToken, expiresIn}
   β”‚ ◀──────────────────│
   β”‚                    β”‚
   β”‚  GET /api/public/v1/rfqs  β”‚
   β”‚  Authorisation: Bearer <token>
   β”‚ ──────────────────▢│
   β”‚                    β”‚
   β”‚  {data: [...]}     β”‚
   β”‚ ◀──────────────────│

Using Authentication

All Public API endpoints require authentication using a Bearer token.

Authorisation Header Required

Include the token in the Authorisation header (note the British English spelling with 's'):

Header
Value

Authorisation

Bearer <your_access_token>

Important: Use Authorisation (with 's'), not Authorisation (with 'z').

Token Lifetime: 1 hour (3600 seconds)

Auto-Refresh: Implement automatic token refresh in your integration to maintain uninterrupted access.

πŸ” Generate Access Token

post

Authentication Entry Point

This endpoint is your first step to accessing the Adaptria Public API. Exchange your API credentials for a time-limited access token.

Prerequisites

Before calling this endpoint, you need API credentials generated from the Adaptria Portal:

Option A: Client User Self-Service

  1. Log in to the Adaptria Portalarrow-up-right as a Client User

  2. Navigate to Settings β†’ API Credentials

  3. Click Generate New Credentials

  4. You'll receive a clientId and clientSecret

Option B: Admin Creates for Client User

Contact your Adaptria administrator to generate API credentials for your account. Administrators can create credentials through the Admin β†’ Client User Management section in the Adaptria Portal.

Authentication Flow

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     POST /api/credentials/token     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Your System   β”‚ ─────────────────────────────────▢ β”‚  Adaptria API  β”‚
β”‚                 β”‚    { clientId, clientSecret }       β”‚                 β”‚
β”‚                 β”‚ ◀───────────────────────────────── β”‚                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     { accessToken, expiresIn }      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        β”‚
        β”‚  Use accessToken in Authorisation header
        β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  All other API calls: Authorisation: Bearer <accessToken>              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Token Lifecycle

  • Validity: 1 hour (3600 seconds)

  • Renewal: Request a new token before expiration

  • Revocation: If credentials are revoked, existing tokens become invalid immediately

Security Best Practices

  • ⚠️ Never expose your clientSecret in client-side code

  • πŸ”„ Implement automatic token refresh before expiration

  • πŸ”’ Store credentials in secure environment variables

  • πŸ“ Monitor for 401 Unauthorised responses and refresh tokens accordingly

Authorizations
AuthorizationstringRequired

Authorisation Header Required

JWT access token obtained from POST /api/credentials/token

How to authenticate:

  1. Generate API credentials from the Adaptria Portal
  2. Exchange credentials for a token: POST /api/credentials/token
  3. Include the token in all requests using the Authorisation header: Authorisation: Bearer <token>

Important: Use Authorisation (British English spelling with 's'), not Authorisation (American spelling with 'z').

Token Expiration: 1 hour (3600 seconds)

Body
clientIdstring Β· min: 1Required

Your unique client identifier provided when API credentials were generated.

This ID uniquely identifies your application and is used together with the client secret to authenticate API requests.

Format: adaptria_<timestamp>_<random>

Example: adaptria_1733836800000_abc123def456
clientSecretstring Β· min: 1Required

Your confidential client secret provided when API credentials were generated.

⚠️ Security Warning: Keep this secret secure! Never expose it in client-side code, public repositories, or logs.

Best Practices:

  • Store in environment variables or secure vaults
  • Rotate periodically
  • Never commit to version control
Example: sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Responses
chevron-right
200

Token generated successfully

application/json
successboolean Β· enumRequiredPossible values:
messagestringOptional
post
/api/credentials/token

Last updated