Analyses & Sharing
Endpoints for accessing saved analyses and managing public share links.
Authentication
All endpoints require a Bearer token. Only analyses created by the same API key are accessible.
GET /api/v1/analyses
Returns a list of all analyses for the current API key.
Request
http
GET /api/v1/analyses
Authorization: Bearer YOUR_KEYResponse
json
[
{
"task_id": "550e8400-e29b-41d4-a716-446655440000",
"own_page": "https://example.com/product",
"created_at": "2026-05-06T12:00:00Z",
"triplet_analysis": false,
"share_url": null
},
{
"task_id": "660e8400-e29b-41d4-a716-446655440001",
"own_page": "https://example.com/about",
"created_at": "2026-05-05T09:30:00Z",
"triplet_analysis": true,
"share_url": "https://unihra.ru/s/abc123xyz"
}
]Retention
Analysis metadata is stored for 90 days from the task creation time.
GET /api/v1/analyses/
Fetches the result of a specific analysis. If not cached, it is retrieved from the analysis service.
Request
http
GET /api/v1/analyses/550e8400-e29b-41d4-a716-446655440000
Authorization: Bearer YOUR_KEYResponse
Same structure as the result field in the state: "SUCCESS" event from the status stream.
Status Codes
| Code | Meaning |
|---|---|
200 | Success |
404 | Analysis not found or retention period expired |
403 | Analysis belongs to a different key |
POST /api/v1/analyses/{task_id}/share
Creates a public share link for the analysis. The link is accessible without authorization.
Request
http
POST /api/v1/analyses/550e8400-e29b-41d4-a716-446655440000/share
Authorization: Bearer YOUR_KEY(no request body required)
Response
json
{
"share_url": "https://unihra.ru/s/abc123xyz456",
"task_id": "550e8400-e29b-41d4-a716-446655440000"
}Status Codes
| Code | Meaning |
|---|---|
200 or 201 | Link created |
404 | Analysis not found |
403 | Access denied |
DELETE /api/v1/analyses/{task_id}/share
Revokes the public share link. The link stops working immediately.
Request
http
DELETE /api/v1/analyses/550e8400-e29b-41d4-a716-446655440000/share
Authorization: Bearer YOUR_KEYResponse
http
HTTP/1.1 204 No ContentFull Example
python
import requests
BASE = "https://unihra.ru/api/v1"
HEADERS = {"Authorization": "Bearer YOUR_KEY"}
# List analyses
analyses = requests.get(f"{BASE}/analyses", headers=HEADERS).json()
task_id = analyses[0]["task_id"]
# Fetch result
result = requests.get(f"{BASE}/analyses/{task_id}", headers=HEADERS).json()
# Create public share link
share = requests.post(f"{BASE}/analyses/{task_id}/share", headers=HEADERS).json()
print(share["share_url"])
# Revoke
requests.delete(f"{BASE}/analyses/{task_id}/share", headers=HEADERS)