Overview
The Xeni API uses API key-based authentication. Every request must include a valid access token in the Authorization header. Xeni provides separate sandbox and production environments so you can develop and test without affecting live bookings.
Getting Your API Keys
- Navigate to Settings → API Keys in your Xeni dashboard
- You'll see two key pairs:
- Each key pair consists of an API Key (public) and an API Secret (private)
Warning
Never expose your API Secret in client-side code, public repositories, or logs. Store it securely using environment variables or a secrets manager.
Authenticating Requests
Step 1: Get an Access Token
Exchange your API key and secret for a short-lived access token:
curl -X POST https://api.xeni.com/v1/auth/token \
-H "Content-Type: application/json" \
-d '{
"apikey": "xenisksandboxabc123",
"secret": "yourapisecret"
}'
Response:
{
"access_token": "eyJhbGciOiJSUzI1NiIs...",
"token_type": "Bearer",
"expires_in": 3600
}Step 2: Use the Token
Include the token in all subsequent API requests:
curl -X GET https://api.xeni.com/v1/hotels/search \
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiIs..." \
-H "Content-Type: application/json" \
-d '{"destination": "NYC", "check_in": "2026-04-01"}'
Rate Limits
| Environment | Requests/min | Requests/day |
|---|---|---|
| Sandbox | 60 | 10,000 |
| Production | 300 | 100,000 |
429 Too Many Requests with a Retry-After header indicating how many seconds to wait.
Tip
Use the X-RateLimit-Remaining header in responses to monitor your usage and implement backoff logic before hitting the limit.
Sandbox vs. Production
| Feature | Sandbox | Production |
|---|---|---|
| Real inventory | No (mock data) | Yes |
| Real payments | No | Yes |
| Webhooks | Test events only | Real events |
| Base URL | sandbox.api.xeni.com | api.xeni.com |
Postman Collection
Download our Postman collection to explore the API interactively. Import it into Postman, set your sandbox API key as an environment variable, and start making test requests immediately.
Next Steps
- Configure webhooks to receive real-time booking updates
- Explore the full API reference for all available endpoints