Authentication
Send your API key with each request, and handle missing or invalid keys.
The Direct Travel API authenticates each request with an API key passed in the X-API-KEY header.
Use an existing API key
Stay22 no longer issues new API keys. If your account already has one, ask your account manager for it.
Use your API key
Pass the key in the X-API-KEY header (recommended):
curl -H "X-API-KEY: <API_KEY>" \
"https://api.stay22.com/v3/accommodations?address=Paris"
# get <API_KEY> at hub.stay22.comOr as the key query parameter:
curl "https://api.stay22.com/v3/accommodations?key=<API_KEY>&address=Paris"Invalid or missing key
A missing or invalid key returns 401:
{
"statusCode": 401,
"error": "Unauthorized",
"code": "INVALID_API_KEY",
"message": "Invalid API key. Get your API key at hub.stay22.com",
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}For the full list of error codes, see the API Reference — error responses are documented under each endpoint.