πŸ” 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  β”‚
   β”‚  Authorization: Bearer <token>
   β”‚ ──────────────────▢│
   β”‚                    β”‚
   β”‚  {data: [...]}     β”‚
   β”‚ ◀──────────────────│

Using Authentication

All Public API endpoints require authentication using a Bearer token.

Header
Value

Authorization

Bearer <your_access_token>

Token Lifetime: 1 hour (3600 seconds)

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

πŸ” Generate Access Token

post
/api/credentials/token

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

  1. Log in to the Adaptria Portalarrow-up-right as an Admin User

  2. Navigate to Admin β†’ Client User Management

  3. Select the client user and go to API Credentials section

  4. Click Generate New Credentials

Authentication Flow

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     POST /api/credentials/token     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Your System   β”‚ ─────────────────────────────────▢ β”‚  Adaptria API  β”‚
β”‚                 β”‚    { clientId, clientSecret }       β”‚                 β”‚
β”‚                 β”‚ ◀───────────────────────────────── β”‚                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     { accessToken, expiresIn }      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        β”‚
        β”‚  Use accessToken in Authorization header
        β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  All other API calls: Authorization: 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 Unauthorized responses and refresh tokens accordingly

Authorizations
AuthorizationstringRequired

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: Authorization: Bearer <token>

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
post
/api/credentials/token

Last updated