Skip to main content

Exchange Carrier OIDC Token for Hiya JWT

POST 

/v1/auth/token

Exchanges a carrier-issued OIDC access token for a Hiya-scoped JWT bearer token.

Overview​

This endpoint implements a federated token exchange flow:

  1. The client obtains an OIDC access token from the carrier's identity provider
  2. The client presents this token to Hiya's backend
  3. Hiya validates the token (issuer, audience, signature, and claims)
  4. Upon successful validation, Hiya mints a short-lived JWT for API authorization

Token Validation​

Hiya validates the following claims from the carrier OIDC token:

  • iss (issuer): Must match the configured carrier identity provider
  • aud (audience): Must include Hiya's registered client ID
  • exp (expiration): Token must not be expired
  • sub (subject): Used to identify the user account

Response​

On success, returns a Hiya JWT token with:

  • Short expiration time (configurable, typically 1 hour)
  • Scoped claims for least-privilege API access
  • Refresh token for obtaining new access tokens

Header Parameters​


    x-hiya-product-version string

    Product version. The standard "major.minor.patch" format is highly encouraged without any leading characters; "2.1.3" or "3.0.0" for example.

Body

required

application/json

    oidcTokenstringrequired

    OIDC ID token issued by the carrier's identity provider. This token must be valid, unexpired, and contain the required claims for user identification.

    Example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0...

Responses​

OK

Response Body

application/json

    userIdstringrequired

    Unique user ID used to identify this particular user (used for all subsequent API calls)

    Example: 550e8400-e29b-41d4-a716-446655440000

    jwtstringrequired

    JWT token which must be passed in Bearer authentication to subsequent API requests

    Example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1NTBlODQwMC1lMjliLTQxZDQtYTcxNi00NDY2NTU0NDAwMDAiLCJpYXQiOjE3MDAwMDAwMDAsImV4cCI6MTcwMDAzNjAwMH0...

    jwtExpiresAtstringrequired

    The UTC timestamp when the jwt token will expire in ISO 8601 format (including milliseconds).

    Format: string<date-time>
    Example: 2024-12-21T12:00:00.000Z

Example from Schema​

{
"userId": "550e8400-e29b-41d4-a716-446655440000",
"jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1NTBlODQwMC1lMjliLTQxZDQtYTcxNi00NDY2NTU0NDAwMDAiLCJpYXQiOjE3MDAwMDAwMDAsImV4cCI6MTcwMDAzNjAwMH0...",
"jwtExpiresAt": "2024-12-21T12:00:00.000Z"
}