Skip to content

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_KEY

Response

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_KEY

Response

Same structure as the result field in the state: "SUCCESS" event from the status stream.

Status Codes

CodeMeaning
200Success
404Analysis not found or retention period expired
403Analysis 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

CodeMeaning
200 or 201Link created
404Analysis not found
403Access 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_KEY

Response

http
HTTP/1.1 204 No Content

Full 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)