Authentication
Secure your API requests with proper authentication methods, using API keys.
Overview
Wholechain requires authentication for all API requests to ensure secure access to your data. Send your API key in the X-API-KEY request header on every request.
curl -X GET "https://connect.wholechain.com/Integration/Locations" -H "X-API-KEY: <YOUR_API_KEY>"
Generate keys in your dashboard at:
Production
https://app.wholechain.com/settings/integrations
Sandbox
https://sandbox.wholechain.com/settings/integrations
Never expose API keys in client-side code or public repositories. Rotate keys regularly and use environment variables.
Base URLs
| Environment | URL |
|---|---|
| Production | https://connect.wholechain.com |
| Sandbox | https://connect-sandbox.wholechain.com |
Authentication Errors
If the X-API-KEY header is missing, the API returns HTTP 400:
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"errors": {
"X-API-KEY": ["The apiKey field is required."]
},
"traceId": "00-a5f70f30a335bf1f20afd4c79ec7c78a-d22743f3e6e0ffc0-00"
}
If the API key is invalid, the API returns HTTP 401:
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.2",
"title": "The API key is not valid.",
"status": 401,
"traceId": "00-a5f70f30a335bf1f20afd4c79ec7c78a-d22743f3e6e0ffc0-00"
}
Generating API Keys
Follow these steps to create a new API key.
Log In
Access https://app.wholechain.com and sign in with your credentials.
Navigate to Keys
Go to Settings > Account Settings > Integration Settings > Generate API Key.
Create Key
Click Generate New Key and copy the key value immediately—it won't show again. You can edit this key by providing it a label.