Alert API Troubleshooting
Common Issues
401 Unauthorized
Problem: API key is missing, invalid, or expired.
Solution:
- Check the Authorization header format:
Authorization: Key YOUR_API_KEY - Verify the API key hasn't expired
- Ensure the key has the required permissions
# Test if key is valid
curl -H "Authorization: Key YOUR_API_KEY" \
http://your-tobealert.com:9000/api/keys/me
400 Bad Request
Problem: Invalid request data or missing required fields.
Common causes:
- Missing required fields (alert_id, event, environment, severity, text)
- Invalid severity level
- Malformed JSON
- Field validation errors
Example error response:
{
"status": "error",
"message": "Validation failed",
"errors": [
{
"field": "severity",
"message": "Must be one of: critical, major, minor, warning, etc."
}
]
}
Solution:
- Check all required fields are present
- Verify severity is a valid level
- Validate JSON syntax
- Check field length limits
Links Not Clickable
Problem: URLs in attributes are not clickable in the UI.
Solution: Ensure URLs start with http:// or https://:
"attributes": {
"dashboard": "https://grafana.example.com/d/abc123", // ✓ Clickable
"dashboard": "grafana.example.com/d/abc123" // ✗ Not clickable
}
Tagged Values Not Showing
Problem: Tagged values not displaying with colored badges.
Solution: Use the correct format value#tag:
"attributes": {
"status": "degraded#critical", // ✓ Shows as colored badge
"components": ["db#critical", "cache#warning"] // ✓ Array with tags
}