Login

August 3, 2026 ยท View on GitHub

Use case

Authenticates a dashboard operator and returns a JWT used by the dashboard and protected API examples.

Authentication

Public. No JWT or API key is required. Sandbox traffic may still include x-feature: decision-engine when routed through Hyperswitch.

For local development, start with:

export BASE_URL=http://localhost:8080
export AUTH_HEADER="Authorization: Bearer <jwt_token>"
# Sandbox only:
# export BASE_URL=https://sandbox.hyperswitch.io
# export FEATURE_HEADER="x-feature: decision-engine"

Request

  • Method and path: POST /auth/login
  • Parameters: none.
  • Body: JSON body with email and password.

Example

Login

curl --location "$BASE_URL/auth/login" \
  --header "Content-Type: application/json" \
  --data '{
  "email": "operator@example.com",
  "password": "StrongPass#123"
}'

Response

{
  "token": "eyJ...",
  "user_id": "user_123",
  "email": "operator@example.com",
  "merchant_id": "merchant_demo",
  "role": "admin",
  "merchants": [
    {
      "merchant_id": "merchant_demo",
      "merchant_name": "Demo Merchant",
      "role": "admin"
    }
  ]
}

Notes

  • After login, export AUTH_HEADER="Authorization: Bearer <token>" for protected examples.
  • If the token expires, call login again rather than retrying failed protected calls blindly.