Custom HTTP Headers
Monitor authenticated APIs and endpoints behind authentication. Set custom HTTP headers like API keys and tokens on your availability monitors.
Authorization, Proxy-Authorization, Cookie, X-Forwarded-For, X-Forwarded-Host, X-Forwarded-Proto, X-Real-IP, Forwarded, True-Client-IP, and CF-Connecting-IP, plus hop-by-hop headers (Host, Connection, Upgrade, TE, Trailer, Expect, Content-Length, Transfer-Encoding). Header values must contain only printable ASCII and tab. To monitor an endpoint that needs Bearer/Basic auth, use X-Api-Key (or any other custom name) on your backend.What Are Custom HTTP Headers in Monitoring?
Custom HTTP headers let you send additional information with every monitoring request. This is essential for monitoring APIs that require a token or API key. Without custom headers, monitoring tools cannot access protected endpoints, resulting in false 401/403 alerts.
When Do You Need Custom Headers?
- Accessing endpoints behind API key authentication (
X-Api-Key,X-Auth-Token) - Monitoring internal APIs that expect a signed
X-Request-Signature - Sending a custom
User-Agentto identify monitoring traffic - Setting
Accept: application/jsonfor API response format
How to Configure Custom Headers in Upsonar
Open your monitor settings
Scroll to Custom Headers
Add a header
X-Api-Key) and value (e.g., your-api-key-here). Click Add.Save your monitor
Common Header Examples
API Key
X-Api-Key: your-api-key-here
Common for REST APIs and third-party services.
Auth Token
X-Auth-Token: eyJhbG...
Use a custom header name for token-based auth (the standard Authorization name is blocked).
Signed Request
X-Request-Signature: sha256=...
For APIs that expect HMAC-signed requests.
Custom User-Agent
User-Agent: upsonar-monitor/1.0
Identify monitoring traffic in your server logs.
Security Best Practices
- Use read-only credentials — create API keys with the minimum required permissions (read-only, monitoring scope)
- Use long-lived tokens — short-lived JWTs require manual updates when they expire. Prefer API keys or service account tokens
- Rotate regularly — update credentials periodically as part of your security practices
- Values are masked in results — upsonar masks custom header values in check results (e.g.,
Bear••••••en123) so credentials are not exposed in the UI
Viewing Headers in Check Results
After a check completes, you can see which custom headers were sent on the check detail page (click any check in the status timeline). The "Custom Request Headers" section shows:
- Header name and masked value for each custom header
- A "Custom" badge to distinguish from default headers
- A hint message if the check returned HTTP 401 or 403, suggesting credential verification
Availability by Plan
| Plan | Max Custom Headers | Price |
|---|---|---|
| Echo (Free) | Not available | Free |
| Pulse | 5 headers per monitor | From €12/month |
| Wave | 15 headers per monitor | From €39/month |
Troubleshooting
Getting 401 or 403 errors?
- Verify the header name is spelled correctly
- Check if the token or API key has expired
- Ensure the credential has permissions for the monitored endpoint
- Confirm your backend reads the custom header name you configured (e.g.
X-Api-Key)
Token expired?
Short-lived tokens (like JWTs) require manual updates when they expire. For unattended monitoring, use long-lived API keys or service account tokens that do not expire frequently.
FAQ
Custom HTTP headers are additional name-value pairs sent with every monitoring request. They allow upsonar to authenticate with protected endpoints by including credentials like API keys or session tokens in the check requests.
Edit your availability monitor, scroll to the Custom Headers section, and add your authentication header (e.g., X-Api-Key: your-token). Save the monitor and authentication headers will be included in every check. The Authorization and Cookie header names are not accepted — use a custom header name such as X-Api-Key or X-Auth-Token instead.
The Authorization header is not accepted as a custom header for security reasons (it may be interpreted by intermediate proxies). For HTTP Basic Auth, put the credentials in the monitor URL itself as https://user:pass@host/path, or have your backend accept an X-Api-Key custom header in place of Basic Auth.
Custom header values are masked by the monitoring agent before results are stored. In check results, you see masked values instead of the full credential. Use read-only API keys with minimal permissions for best security.
Custom headers are available on Pulse (up to 5 per monitor) and Wave (up to 15 per monitor) plans. The free Echo plan does not include custom headers.
Yes. Pulse plan allows up to 5 custom headers per monitor, and Wave allows up to 15. Each header has a unique name and value. Duplicate header names are rejected.