Skip to content

Authentication

The API uses Bearer tokens. Pass your key in the Authorization header on every request.

Format

http
Authorization: Bearer YOUR_API_KEY

Getting a Key

  1. Log into your dashboard → API Keys section
  2. 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

CodeMeaning
401Key missing, invalid, or revoked
403Key valid but no permission for this operation
429Rate 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