Authentication
The API uses Bearer tokens. Pass your key in the Authorization header on every request.
Format
http
Authorization: Bearer YOUR_API_KEYGetting a Key
- Log into your dashboard → API Keys section
- Click "Create Key", give it a label, and copy the
unh_...string (shown only once)
Examples
bash
curl https://unihra.ru/api/v1/health \
-H "Authorization: Bearer YOUR_KEY"python
import requests
resp = requests.get(
"https://unihra.ru/api/v1/health",
headers={"Authorization": "Bearer YOUR_KEY"},
)javascript
const resp = await fetch("https://unihra.ru/api/v1/health", {
headers: { Authorization: "Bearer YOUR_KEY" },
});Error Responses
| Code | Meaning |
|---|---|
401 | Key missing, invalid, or revoked |
403 | Key valid but no permission for this operation |
429 | Rate limit exceeded — retry after the indicated delay |
Security
- Never commit your key to public repositories
- Use environment variables:
UNIHRA_API_KEY=sk-xxx - Keys can be revoked and regenerated in the dashboard at any time