URL: /baas/api/getting-started/quick-start/authenticate --- title: "Authenticate" description: "Authenticate and get an access token" --- # Authenticate Authenticate with the FinHub API using OAuth 2.0 Client Credentials flow. ## Token Endpoint ``` POST /api/v2/auth/sandbox/token ``` ## Required Headers | Header | Value | |--------|-------| | `X-Tenant-ID` | Your tenant ID | | `Content-Type` | `application/json` | ## Request Body ```json { "username": "your_username", "password": "your_password", "customerId": "your_client_id", "customerSecret": "your_client_secret", "accountType": "b2b" } ``` ## Example Request ```bash curl -X POST "https://gateway.finhub.cloud/api/v2/auth/sandbox/token" \ -H "X-Tenant-ID: 1234567" \ -H "Content-Type: application/json" \ -d '{ "username": "your_username", "password": "your_password", "customerId": "your_client_id", "customerSecret": "your_client_secret", "accountType": "b2b" }' ``` ## Response ```json { "access_token": "eyJ4NXQiOiJNVFJsT1RFM1lXRmxNR1Jr...", "token_type": "Bearer", "expires_in": 10000 } ``` ## Using the Token Include in all subsequent requests: ``` Authorization: Bearer eyJ4NXQiOiJNVFJsT1RFM1lXRmxNR1Jr... ``` ## Next Steps Make your first API call