# Authentication
The GBB Rates API uses Agent API Key authentication.
GBB support will provide your API key. Send it in the `Authorization` header on every authenticated request.
```http
Authorization: ApiKey YOUR_API_KEY
but ApiKey is recommended.Validate Your API Key#
Use POST /api/v1/auth/login to check that your API key is valid and to view your agent details.This endpoint does not return a separate token. Continue using your API key for authenticated requests.Request#
Response#
{
"agent_id": "agent-id",
"agent_name": "Your Company",
"email": "agent@example.com",
"expires_at": "2026-09-01T00:00:00+00:00",
"rate_limit": 100
}
Make an Authenticated Request#
Verify Your Authentication#
{
"agent_id": "agent-id",
"company_name": "Your Company",
"api_key_name": "Default Key",
"rate_limit": 100
}
Sandbox and Live API Keys#
Use sandbox keys for testing and live keys for production bookings.| Key Type | Purpose | Effect |
|---|
| Sandbox | Test your integration | No real bookings or payments |
| Live | Production use | Real bookings and payments may apply |
Sandbox keys can only be used with sandbox agents. Live keys can only be used with live agents.If the key environment does not match the agent environment, the API returns 401 Unauthorized.Rules#
| Do | Don’t |
|---|
| Test with sandbox first | Do not use sandbox for real customers |
| Use live only after approval | Do not commit keys to code |
| Store keys in environment variables | Do not expose keys in client-side apps |
| Rotate keys regularly | Do not share keys in chat or email |
Common Errors#
401 Unauthorized#
The API key is missing, invalid, expired, inactive, or belongs to the wrong environment.{
"detail": "Unauthorized"
}
{
"detail": "Invalid API token"
}
429 Too Many Requests#
You exceeded your per-minute API rate limit.{
"detail": "Rate limit exceeded"
}
Wait and retry after the number of seconds in the Retry-After response header.Summary#
Sandbox → test integration safely
Live → create real bookings
Authorization → ApiKey YOUR_API_KEY
Login endpoint → validates your key, does not issue a new token
Modified at 2026-06-02 22:04:48