2 - Authentication
API Key
All requests to the SafeSky Public REST API must be authenticated using an API key passed as a request header.
x-api-key: <your_api_key>
Obtaining an API Key
To obtain an API key, contact sales@safesky.app.
Keep your API key secure and never expose it in client-side code or public repositories.
Usage Example
All endpoints are documented in the interactive Swagger UI.
curl 'https://public-api.safesky.app/v1/stats/overview' \
--header 'x-api-key: <your_api_key>'
Applying the API Key to Every Request
The x-api-key header must be included in every request. All endpoints described in this documentation require this header except where explicitly noted.
Example — retrieving beacons for a viewport:
curl 'https://public-api.safesky.app/v1/beacons?viewport=43.1035,-2.0821,47.9943,15.3216' \
--header 'x-api-key: <your_api_key>'
Error Responses
If authentication fails or the API key is missing, the API returns:
- 400 Bad Request — Missing or invalid API key.
Ensure the header name is exactly x-api-key (lowercase) and that the value is your full, unmodified API key.