# Databek Talent API guide

Talent (talent.databek.com and every portal host) runs internships and academies: programs and applications,
proctored assessments with code questions, reviews and interviews, the academy (courses, homework, attendance),
contests, practice problems and a talent pool. Its integration API lets another system invite people to an
assessment and read their results with one API key.

## At a glance

| Topic | Rule |
|---|---|
| Base URL | `https://<portal host>/api/v1` (for example `https://talent.databek.com/api/v1`). The portal comes from the `Host` header, never from the path or the body |
| Format | JSON in and out; timestamps UTC ISO 8601; ids are UUIDs (programs, contests and problems also have a `slug`) |
| Auth | Integration: `Authorization: Bearer dbk_…` (portal API key). People: httpOnly cookies + CSRF header. No CORS: a page on another site cannot call the API from the browser |
| Errors | `{"code", "message", "field"?}` plus `errors` on validation and `retry_after` on most rate limits |
| Lists | `{items, next_cursor}` with `?cursor=&limit=` (default 50, max 200), or numbered pages `?page=&page_size=` (then `total`); a few short lists (`GET /integration/sets`, `GET /integration-keys`, `GET /me/applications`) answer a plain array |
| Retries | Code runs and submits (assessment sessions, homework, contests, practice) take `Idempotency-Key` (8–64 characters of `A-Z a-z 0-9 - _`): a retry with the same key within 12 hours gets the first result |
| Request id | `X-Request-ID` in and out |

## Choose your path

- **Server-to-server integration** (an HR system, an LMS, a CRM): use the integration API with a portal API key.
  It is small and stable: list assessment sets, invite people by e-mail, read status and scores. Start with Flow 1.
- **A client acting as a person** (candidate, mentor, admin): cookie sign-in (Flow 2), with the permission each
  operation names. It works for pages served from the portal host itself and for clients that keep a cookie jar (a
  server, a native app, curl); there is no CORS, so a web app on another site cannot use it from the browser.

## Flow 1: invite people to an assessment from your system

1. A portal admin creates a key once, signed in to the portal (permission `portal.settings`):
   `POST /api/v1/integration-keys` with `{"name": "Our HR system"}`. The answer holds `secret` (`dbk_…`) once; store
   it as a secret. List keys with `GET /api/v1/integration-keys` (never the secrets) and revoke with
   `POST /api/v1/integration-keys/{key_id}/revoke`. A key works only on its own portal's host.
2. An admin prepares an assessment set in the portal (an assessment with a public link `https://<host>/s/<code>`).
3. Your system lists the sets and picks one that is `open` (or `draft`, opening later):

```bash
curl https://talent.databek.com/api/v1/integration/sets -H "Authorization: Bearer dbk_xxxxxxxx"
```

4. Invite up to 200 people per call. Each new address gets a personal link (`https://<host>/s/<code>?invite=<token>`)
   by e-mail; an address that already took the set through its public link is bound to the invite at once, without
   an e-mail:

```bash
curl -X POST https://talent.databek.com/api/v1/integration/sets/<set_id>/invites \
  -H "Authorization: Bearer dbk_xxxxxxxx" -H "Content-Type: application/json" \
  -d '{"recipients": [{"email": "aziza@example.com", "full_name": "Aziza Karimova", "external_id": "crm-1042"}]}'
```

```json
{"created": 1, "existing": 0, "resent": 0,
 "items": [{"id": "<invite id>", "email": "aziza@example.com", "full_name": "Aziza Karimova",
            "external_id": "crm-1042", "status": "invited", "outcome": "created", "score": null, "…": "…"}]}
```

   (Shortened: each item also carries `set_id`, the times `invited_at`, `email_sent_at`, `opened_at`, `started_at`,
   `submitted_at`, `resend_count`, the score fields and `review_url`.) An address invited before comes back as
   `existing` with no new e-mail. With `"resend": true` it is sent again (a new link replaces the old one) only when
   the person has not started yet, the invite was resent fewer than 3 times and the last e-mail is at least an hour
   old; otherwise it stays `existing`. Keep the invite `id` and your `external_id`.
5. Read results by polling (there are no outbound webhooks): `GET /api/v1/integration/sets/{set_id}/invites` (50 a
   page by default, at most 200; follow `next_cursor`; `total` is always filled; filter with `status`, `email`,
   `external_id`) or `GET /api/v1/integration/invites/{invite_id}`. Status moves
   `invited → opened → started → submitted → scored`. `expired` means not started while the set is closed or
   archived; it goes back to `invited` or `opened` if an admin reopens the set. While the set is open an invite that
   was never started stays `invited` or `opened`, even when a prepared attempt's start window lapsed. `voided` is not
   used today. When a person's account is deleted, their invites are deleted with it: they leave the list and
   `GET /api/v1/integration/invites/{invite_id}` answers 404 `integration.invite_not_found`.
   Once `scored`: `score` (0–100), `max_score`, per-section `sections`, `integrity_score` (proctoring) and `review_url`
   for a human reviewer. Poll every few minutes, not faster.

Limits: 240 calls a minute per key; 20 wrong keys in 15 minutes from one address are refused for a while (429
`rate_limited` with `retry_after`); 300 invitation e-mails per portal in any 24 hours. The e-mail cap is checked for
the whole call: 429 `integration.invite_limit` with `limit` and `remaining` (no `retry_after`) and nothing is sent.
Errors: 401 `integration.unauthorized` (missing, wrong or revoked key, or another portal's host), 404
`sets.not_found`, `integration.invite_not_found` or `portal.not_found`, 409 `integration.set_closed` (closed or
archived set), `integration.set_not_ready` (no active assessment), `integration.busy` (another invite call for the
same set is running: retry later), `integration.too_many_keys` (over 10 live keys), 422 `validation.invalid` (more
than 200 recipients, a bad e-mail). Send no cookies with the key: a write that carries an auth cookie without
`X-CSRF-Token` answers 403 `auth.csrf_failed`.

## Flow 2: sign in as a person (cookies)

1. Get the CSRF cookie: any GET under `/api/`, for example `GET /api/v1/portal`, sets `csrf_token` (readable). Sign-up,
   sign-in, the e-mailed code and the password reset always send it back as `X-CSRF-Token` (403 `auth.csrf_failed`
   otherwise). Every sign-in (password, e-mailed code, password reset, Google) sets a new `csrf_token`: read the
   cookie again after it, or the next write answers 403 `auth.csrf_failed`.
2. `POST /api/v1/auth/signup` `{"full_name", "email", "password", "locale"?}` → 202
   `{"status": "verification_required", "challenge_id", "resend_after", "expires_in"}`; a code is e-mailed.
3. `POST /api/v1/auth/verify-email` `{"challenge_id", "code"}` verifies the address and signs the client in.
   `POST /api/v1/auth/resend-code` sends a new code (60 s cooldown, at most 5).
4. Later sign-ins: `POST /api/v1/auth/signin` `{"email", "password"}` → `{"status": "signed_in"}` with cookies, or
   `verification_required` for an unfinished sign-up. Google (in a browser on the portal host): send the browser to
   `GET /api/v1/auth/google/login?next=/` (it returns through `/api/v1/auth/google/callback`).
5. The cookies: `access_token` (httpOnly JWT, 15 min), `refresh_token` (httpOnly, path `/api/v1/auth`) and
   `csrf_token`. On 401 `auth.required` call `POST /api/v1/auth/refresh` once and retry.
6. Every POST, PUT, PATCH and DELETE that carries an auth cookie sends `X-CSRF-Token` equal to the `csrf_token`
   cookie's current value.

```bash
curl -c jar -b jar https://talent.databek.com/api/v1/portal
curl -c jar -b jar -X POST https://talent.databek.com/api/v1/auth/signin \
  -H "X-CSRF-Token: <csrf_token from jar>" -H "Content-Type: application/json" \
  -d '{"email": "aziza@example.com", "password": "…"}'
# the sign-in set a new csrf_token: read it from the jar again
curl -c jar -b jar -X PATCH https://talent.databek.com/api/v1/me \
  -H "X-CSRF-Token: <new csrf_token from jar>" -H "Content-Type: application/json" -d '{"locale": "en"}'
```

Password reset: `POST /api/v1/auth/forgot-password` (always 202) and `POST /api/v1/auth/reset-password` with the
link's token. Devices: `GET /api/v1/auth/sessions`, `DELETE /api/v1/auth/sessions/{id}`,
`POST /api/v1/auth/sessions/revoke-others`; `POST /api/v1/auth/logout`. 5 wrong passwords for an address in 15
minutes answer 429 `auth.locked`.

## Flow 3: a candidate applies and takes the assessment

1. `GET /api/v1/programs` (published, open first) → `GET /api/v1/programs/{slug}` → `GET /api/v1/programs/{slug}/form`:
   every field of its form (`fields`: profile fields with `is_system: true`, the program's own questions with
   `is_system: false`), the profile steps it needs (`system_steps`), and the skills (`required_skill_codes`) and link
   types (`required_link_types`) it requires.
2. Fill the profile first: `PATCH /api/v1/me/profile` (the system fields the form names; programs are for people
   aged 40 or younger, so `birth_date` counts), `PUT /api/v1/me/skills` and `PUT /api/v1/me/links`.
3. `POST /api/v1/programs/{slug}/applications` `{"answers": {...}, "wizard_step": 2}` creates the draft on the first
   call and autosaves afterwards; `answers` holds only the keys of fields with `is_system: false` (a profile key or
   any other key answers 422 `applications.invalid_answers`, `errors` `[{field, code: "unknown_field"}]`).
   `POST /api/v1/applications/{id}/submit` `{"consents": {"personal_data": true}}` submits it. Missing profile
   fields, skills or links answer 422 `applications.incomplete` with `errors` `[{field, code, step}]`; a person over
   40 gets 422 `applications.age_limit`, a closed program 409 `applications.closed`. Drafts created and submits
   together are limited to 5 an hour per person. `GET /api/v1/me/applications` lists the candidate's applications.
4. A program with an assessment invites the applicant inside the submit call: the status becomes
   `assessment_invited` and the personal link `https://<host>/assessment/<token>` is e-mailed. A program in manual
   mode waits for staff to invite (`POST /api/v1/applications/{id}/assessment-invite`, staff only). The candidate's
   client gets a link itself with `POST /api/v1/applications/{id}/assessment-link` → `{"url", "valid_until"}` (a new
   token, so the e-mailed link stops working; 404 `sessions.invite_not_found` while there is no invite). The token
   is the link's last segment: `GET /api/v1/assessment/invites/{token}` (rules, duration, required consents) and
   `POST /api/v1/assessment/invites/{token}/start`
   `{"consents": {"assessment_recording": true, "webcam": true, "screen": true}}` (webcam and screen only when the
   assessment requires them; `device_check` is optional). It starts the server timer and is idempotent. Without the
   consents it answers 422 `sessions.consent_required`; a phone gets 422 `sessions.mobile_not_allowed` unless the
   assessment allows phones.
5. In the session: `GET /api/v1/sessions/{id}` (questions and saved answers), `GET /api/v1/sessions/{id}/time`
   (server clock, sync every 30 s), autosave with `PUT …/questions/{sq_id}/answer` (`rev` makes stale saves no-ops),
   run code with `POST …/questions/{sq_id}/run` (visible tests; 20 a minute and the question's own run limit) and
   judge with `POST …/questions/{sq_id}/submit` (all tests, 10 a minute). Send an `Idempotency-Key` on run and submit.
6. `POST /api/v1/sessions/{id}/sections/{section_id}/finish` closes a timed section; `POST /api/v1/sessions/{id}/finish`
   submits the whole assessment and queues scoring and the integrity report. Proctoring telemetry goes to
   `POST /api/v1/sessions/{id}/telemetry` with the session's telemetry token (sent by `navigator.sendBeacon`, no CSRF);
   a webcam or screen frame (JPEG) takes three calls: `POST /api/v1/sessions/{session_id}/media/presign`
   `{"kind": "webcam" | "screen", "size_bytes"}` → `file_id`, `upload_url` and `headers`; PUT the bytes to
   `upload_url` with those headers; then `POST /api/v1/sessions/{session_id}/media` `{"file_id", "at"?}` checks the
   file and records the capture. A frame without the last call is not recorded.

## Flow 4: a person takes a set from its link

People invited in Flow 1, and anyone with a set's public link, take it through the set-link endpoints, signed in as
in Flow 2:

1. `GET /api/v1/set-links/{code}?invite=<token>`: the set's page (title, form, duration, sections, dates, `status`,
   and `me`: `none`, `started`, `submitted` or `scored`). The `invite` token marks the invite opened.
2. `POST /api/v1/set-links/{code}/start` `{"answers": {...}, "personal_data_consent": true, "invite_token": "<token>",
   "consents"?: {"assessment_recording": true}}` (the same consents as Flow 3, step 4) creates the application and
   the session and answers `{"application_id", "session_id", "session_url", "started"}`. With the consents the timer
   starts at once: `started: true` and `session_id` is the session. Without them `started` is false, `session_id` is
   null and `session_url` is the rules page `https://<host>/assessment/<token>`: take its last segment and call
   `POST /api/v1/assessment/invites/{token}/start` with the consents (Flow 3, step 4); its answer's `id` is the
   session id. 409 `sets.closed` or `sets.already_started` (with the existing `session_id`).
3. With the session id the session runs as in Flow 3, steps 5–6. `GET /api/v1/set-links/{code}/result` shows the caller's result as the
   set's policy allows (`visible: false` with a `reason` otherwise).

## Files

Uploads go straight to storage: `POST /api/v1/files/presign-upload`
`{"purpose": "cv", "filename": "cv.pdf", "mime_type": "application/pdf", "size_bytes": 182044}` → `file_id`,
`upload_url`, `method` (`PUT`), `headers`, `expires_in`; upload the bytes to `upload_url` with those headers; then
`POST /api/v1/files/{file_id}/complete`. Use the `file_id` where an endpoint asks for one. `GET /api/v1/files/{id}/url`
returns a short-lived signed URL. 30 presigns a minute per person.

| Purpose | Who | Largest | Types |
|---|---|---|---|
| `cv` | anyone signed in | 10 MB | PDF |
| `avatar` | anyone signed in | 2 MB | images |
| `pitch` | anyone signed in | 60 MB | audio, video |
| `homework` | anyone signed in | 25 MB | PDF, images, zip, text |
| `logo` | `portal.settings` or `programs.manage` | 2 MB | images |
| `material` | `academy.manage` | 100 MB | PDF, images, zip, text |
| `import` | `questions.manage` | 20 MB | zip, text |

A purpose the caller may not use answers 403 `files.purpose_forbidden` (`webcam` and `screen` always: they go through
the session's media upload); a larger file 422 `files.too_large`, another type 422 `files.type_not_allowed`.

## Endpoint groups

Every group below works with cookie sign-in; each operation names its permission and the roles that hold it
(admin, mentor, intern, guest), or says it is public.

- **programs, application_forms, applications**: published programs, their forms, candidates' drafts and submits;
  staff manage programs under `/programs/manage`.
- **review, decisions**: the staff review table (`/applications` with filters, saved views, counts, compare, export,
  notes, AI summary) and accept/reject/waitlist decisions, one or in bulk.
- **assessments, sets, set_links, sessions, grading, proctoring**: assessments with sections and pools, public sets
  (`/s/<code>`), the candidate's session, manual and AI grading, integrity reports, replay, frames and plagiarism.
- **questions, question_tools**: the question bank (Python, SQL, MCQ, prompt, open, pitch), import and export,
  validation against the Runner, AI drafting helpers (`/question-tools/ai-*`, polled through `ai-jobs/{job_id}`).
- **interviews**: slots, scorecards, invites, booking by token (`/interviews/book/{token}`), feedback.
- **academy, mentoring, activity**: cohorts, courses, modules, lessons, homework and grading; classes and attendance;
  activity leaderboards.
- **contests, contests-admin, practice**: timed contests (register, run, submit, standings with a live stream,
  clarifications) and the practice problem set with a leaderboard.
- **talent, public-profiles**: the talent pool (search, shortlists, invites, export) and public profiles (`/users/{handle}`).
- **me, privacy, notifications**: the signed-in person (profile, skills, links, Telegram link), data export and
  deletion requests, in-app notifications.
- **members, portals, settings, catalogs, email, ai_usage, audit, dashboard**: the portal (`GET /api/v1/portal`) and
  its administration (members and roles, portal settings and AI provider, skills and link types, the portal's e-mail
  queue, AI spending, audit log).
- **integration**: Flow 1.

## Errors

```json
{"code": "validation.invalid", "message": "Field required", "field": "email",
 "errors": [{"field": "body.email", "message": "Field required"}]}
```

`code` is a stable key; `message` is an English fallback for display. Common codes:

| Status | Codes | Meaning |
|---|---|---|
| 401 | `auth.required`, `integration.unauthorized`, `auth.invalid_credentials` | Not signed in or the session ended (refresh once); bad key; wrong password |
| 403 | `auth.forbidden`, `auth.csrf_failed`, `files.purpose_forbidden` | The role lacks the permission; CSRF header missing or wrong |
| 404 | `portal.not_found`, `sets.not_found`, `applications.not_found`, `sessions.not_found`, `files.not_found`, … | No active portal for this host; otherwise each kind of object answers its own code (also for objects you may not see) |
| 409 | `request.in_progress`, `sessions.not_started`, `applications.closed`, `integration.set_closed`, `integration.set_not_ready`, `integration.busy` | Wait for the running request, start the session first, pick another program or set, retry later |
| 422 | `validation.invalid`, `applications.incomplete`, `sessions.consent_required`, `files.too_large` | See `field` and `errors` |
| 429 | `rate_limited`, `auth.locked` | Wait `retry_after` seconds |
| 429 | `integration.invite_limit` | 300 e-mails per portal in 24 hours: see `limit` and `remaining` |

## Webhooks

Talent sends no outbound webhooks: poll the integration endpoints.

<!-- endpoint-index:start (generated from openapi.json) -->

## Endpoint index

Every operation of `openapi.json` (327), grouped by tag: method and path, who may call it, query parameters, body fields (`*` = required) and the top-level fields of the answer. Schemas, types and examples are in `openapi.json`.

### academy

- `GET /api/v1/academy/dashboard` Dashboard · Permission `academy.learn`: intern · answers 200: `cohort`, `next_class`, `upcoming_classes`, `due_homeworks`, `progress_percent`, `lessons_done`, `lessons_total`, `activity`, `trend`, `mentor`, `courses`
- `GET /api/v1/academy/courses` My Courses · Permission `academy.learn`: intern · query: `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `GET /api/v1/academy/modules/{module_id}` Module Detail · Permission `academy.learn`: intern · answers 200: `id`, `course_id`, `course_title`, `position`, `title`, `description_md`, `unlocks_at`, `locked`, `lessons`, `homeworks`, `lessons_total`, `lessons_done`, `prev_module_id`, `next_module_id`
- `POST /api/v1/academy/lessons/{lesson_id}/complete` Complete Lesson · Permission `academy.learn`: intern · answers 200: `lesson_id`, `completed_at`, `module_id`, `lessons_total`, `lessons_done`
- `DELETE /api/v1/academy/lessons/{lesson_id}/complete` Uncomplete Lesson · Permission `academy.learn`: intern · answers 200: `lesson_id`, `completed_at`, `module_id`, `lessons_total`, `lessons_done`
- `GET /api/v1/academy/homeworks/{homework_id}` Homework Detail · Permission `academy.learn`: intern · answers 200: `id`, `module_id`, `module_title`, `course_id`, `course_title`, `title`, `description_md`, `due_at`, `max_score`, `submission_type`, `allow_late`, `late_penalty_percent`, `rubric`, `questions` and 4 more
- `POST /api/v1/academy/homeworks/{homework_id}/submissions` Submit Homework · Permission `academy.learn`: intern · headers: `Idempotency-Key` · body (JSON): `text_md`, `url`, `file_id`, `code` · answers 201: `id`, `attempt`, `status`, `text_md`, `url`, `file`, `auto_score`, `score`, `effective_score`, `rubric_scores`, `feedback_md`, `is_late`, `submitted_at`, `graded_at` and 2 more
- `POST /api/v1/academy/homeworks/{homework_id}/run` Run Homework Code · Permission `academy.learn`: intern · headers: `Idempotency-Key` · body (JSON): `question_id*`, `code*` · answers 200: `verdict`, `message`, `tests_passed`, `tests_total`, `tests`
- `GET /api/v1/academy/attendance` My Attendance · Permission `academy.learn`: intern · answers 200: `cohort`, `summary`, `items`, `upcoming`
- `GET /api/v1/academy/prep/courses` Prep Courses · Permission `academy.prep`: admin, mentor, intern, guest · query: `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`, `access`
- `GET /api/v1/academy/prep/modules/{module_id}` Prep Module · Permission `academy.prep`: admin, mentor, intern, guest · answers 200: `id`, `course_id`, `course_title`, `position`, `title`, `description_md`, `unlocks_at`, `locked`, `lessons`, `homeworks`, `lessons_total`, `lessons_done`, `prev_module_id`, `next_module_id`
- `POST /api/v1/academy/prep/lessons/{lesson_id}/complete` Complete Prep Lesson · Permission `academy.prep`: admin, mentor, intern, guest · answers 200: `lesson_id`, `completed_at`, `module_id`, `lessons_total`, `lessons_done`
- `DELETE /api/v1/academy/prep/lessons/{lesson_id}/complete` Uncomplete Prep Lesson · Permission `academy.prep`: admin, mentor, intern, guest · answers 200: `lesson_id`, `completed_at`, `module_id`, `lessons_total`, `lessons_done`
- `GET /api/v1/academy/prep/homeworks/{homework_id}` Prep Homework · Permission `academy.prep`: admin, mentor, intern, guest · answers 200: `id`, `module_id`, `module_title`, `course_id`, `course_slug`, `course_title`, `title`, `description_md`, `max_score`, `submission_type`, `rubric`, `submittable`
- `GET /api/v1/cohorts` List Cohorts · Permission `academy.manage`: admin · query: `status`, `program_id`, `q`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/cohorts` Create Cohort · Permission `academy.manage`: admin · body (JSON): `name*`, `program_id`, `starts_at`, `ends_at`, `status` · answers 201: `id`, `name`, `program_id`, `program_title`, `is_program_cohort`, `starts_at`, `ends_at`, `status`, `members_count`, `active_members_count`, `mentors_count`, `classes_count`, `next_class_at`, `created_at` and 1 more
- `GET /api/v1/cohorts/mine` My Cohorts · Permission `interns.view`: admin, mentor · query: `q`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `GET /api/v1/cohorts/{cohort_id}` Get Cohort · Permission `academy.manage`: admin · answers 200: `id`, `name`, `program_id`, `program_title`, `is_program_cohort`, `starts_at`, `ends_at`, `status`, `members_count`, `active_members_count`, `mentors_count`, `classes_count`, `next_class_at`, `created_at` and 1 more
- `DELETE /api/v1/cohorts/{cohort_id}` Delete Cohort · Permission `academy.manage`: admin · answers 200: `ok`
- `PATCH /api/v1/cohorts/{cohort_id}` Update Cohort · Permission `academy.manage`: admin · body (JSON): `name`, `program_id`, `starts_at`, `ends_at`, `status` · answers 200: `id`, `name`, `program_id`, `program_title`, `is_program_cohort`, `starts_at`, `ends_at`, `status`, `members_count`, `active_members_count`, `mentors_count`, `classes_count`, `next_class_at`, `created_at` and 1 more
- `POST /api/v1/cohorts/{cohort_id}/members` Add Member · Permission `academy.manage`: admin · body (JSON): `user_id*`, `mentor_id` · answers 201: `user`, `mentor`, `status`, `joined_at`, `activity_total`, `activity_rank`
- `PUT /api/v1/cohorts/{cohort_id}/members/{user_id}` Update Member · Permission `academy.manage`: admin · body (JSON): `mentor_id`, `status` · answers 200: `user`, `mentor`, `status`, `joined_at`, `activity_total`, `activity_rank`
- `DELETE /api/v1/cohorts/{cohort_id}/members/{user_id}` Remove Member · Permission `academy.manage`: admin · answers 200: `ok`
- `GET /api/v1/courses` List Courses · Permission `academy.manage`: admin · query: `program_id`, `q`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/courses` Create Course · Permission `academy.manage`: admin · body (JSON): `title*`, `slug`, `program_id`, `description_md`, `audience` · answers 201: `id`, `slug`, `title`, `description_md`, `program_id`, `program_title`, `audience`, `modules_count`, `lessons_count`, `homeworks_count`, `created_at`, `updated_at`, `modules`
- `GET /api/v1/courses/{course_id}` Get Course · Permission `academy.manage`: admin · answers 200: `id`, `slug`, `title`, `description_md`, `program_id`, `program_title`, `audience`, `modules_count`, `lessons_count`, `homeworks_count`, `created_at`, `updated_at`, `modules`
- `DELETE /api/v1/courses/{course_id}` Delete Course · Permission `academy.manage`: admin · answers 200: `ok`
- `PATCH /api/v1/courses/{course_id}` Update Course · Permission `academy.manage`: admin · body (JSON): `title`, `slug`, `program_id`, `description_md`, `audience` · answers 200: `id`, `slug`, `title`, `description_md`, `program_id`, `program_title`, `audience`, `modules_count`, `lessons_count`, `homeworks_count`, `created_at`, `updated_at`, `modules`
- `POST /api/v1/courses/{course_id}/modules` Create Module · Permission `academy.manage`: admin · body (JSON): `title*`, `description_md`, `unlocks_at` · answers 201: `id`, `slug`, `title`, `description_md`, `program_id`, `program_title`, `audience`, `modules_count`, `lessons_count`, `homeworks_count`, `created_at`, `updated_at`, `modules`
- `PUT /api/v1/courses/{course_id}/modules/order` Reorder Modules · Permission `academy.manage`: admin · body (JSON): `ids*` · answers 200: `id`, `slug`, `title`, `description_md`, `program_id`, `program_title`, `audience`, `modules_count`, `lessons_count`, `homeworks_count`, `created_at`, `updated_at`, `modules`
- `DELETE /api/v1/modules/{module_id}` Delete Module · Permission `academy.manage`: admin · answers 200: `id`, `slug`, `title`, `description_md`, `program_id`, `program_title`, `audience`, `modules_count`, `lessons_count`, `homeworks_count`, `created_at`, `updated_at`, `modules`
- `PATCH /api/v1/modules/{module_id}` Update Module · Permission `academy.manage`: admin · body (JSON): `title`, `description_md`, `unlocks_at` · answers 200: `id`, `slug`, `title`, `description_md`, `program_id`, `program_title`, `audience`, `modules_count`, `lessons_count`, `homeworks_count`, `created_at`, `updated_at`, `modules`
- `POST /api/v1/modules/{module_id}/lessons` Create Lesson · Permission `academy.manage`: admin · body (JSON): `type*`, `title*`, `content_md`, `url`, `provider`, `file_id`, `question_ids`, `estimated_minutes`, `is_required` · answers 201: `id`, `slug`, `title`, `description_md`, `program_id`, `program_title`, `audience`, `modules_count`, `lessons_count`, `homeworks_count`, `created_at`, `updated_at`, `modules`
- `PUT /api/v1/modules/{module_id}/lessons/order` Reorder Lessons · Permission `academy.manage`: admin · body (JSON): `ids*` · answers 200: `id`, `slug`, `title`, `description_md`, `program_id`, `program_title`, `audience`, `modules_count`, `lessons_count`, `homeworks_count`, `created_at`, `updated_at`, `modules`
- `DELETE /api/v1/lessons/{lesson_id}` Archive Lesson · Permission `academy.manage`: admin · answers 200: `id`, `slug`, `title`, `description_md`, `program_id`, `program_title`, `audience`, `modules_count`, `lessons_count`, `homeworks_count`, `created_at`, `updated_at`, `modules`
- `PATCH /api/v1/lessons/{lesson_id}` Update Lesson · Permission `academy.manage`: admin · body (JSON): `type`, `title`, `content_md`, `url`, `provider`, `file_id`, `question_ids`, `estimated_minutes`, `is_required`, `module_id` · answers 200: `id`, `slug`, `title`, `description_md`, `program_id`, `program_title`, `audience`, `modules_count`, `lessons_count`, `homeworks_count`, `created_at`, `updated_at`, `modules`
- `POST /api/v1/modules/{module_id}/homeworks` Create Homework · Permission `academy.manage`: admin · body (JSON): `title*`, `description_md`, `due_at`, `max_score`, `submission_type`, `question_ids`, `rubric`, `allow_late`, `late_penalty_percent` · answers 201: `id`, `slug`, `title`, `description_md`, `program_id`, `program_title`, `audience`, `modules_count`, `lessons_count`, `homeworks_count`, `created_at`, `updated_at`, `modules`
- `PUT /api/v1/modules/{module_id}/homeworks/order` Reorder Homeworks · Permission `academy.manage`: admin · body (JSON): `ids*` · answers 200: `id`, `slug`, `title`, `description_md`, `program_id`, `program_title`, `audience`, `modules_count`, `lessons_count`, `homeworks_count`, `created_at`, `updated_at`, `modules`
- `GET /api/v1/homeworks/{homework_id}` Get Homework · Permission `academy.manage`: admin · answers 200: `id`, `module_id`, `position`, `title`, `description_md`, `due_at`, `max_score`, `submission_type`, `question_ids`, `questions`, `rubric`, `allow_late`, `late_penalty_percent`, `submissions_count` and 1 more
- `DELETE /api/v1/homeworks/{homework_id}` Delete Homework · Permission `academy.manage`: admin · answers 200: `id`, `slug`, `title`, `description_md`, `program_id`, `program_title`, `audience`, `modules_count`, `lessons_count`, `homeworks_count`, `created_at`, `updated_at`, `modules`
- `PATCH /api/v1/homeworks/{homework_id}` Update Homework · Permission `academy.manage`: admin · body (JSON): `title`, `description_md`, `due_at`, `max_score`, `submission_type`, `question_ids`, `rubric`, `allow_late`, `late_penalty_percent`, `module_id` · answers 200: `id`, `slug`, `title`, `description_md`, `program_id`, `program_title`, `audience`, `modules_count`, `lessons_count`, `homeworks_count`, `created_at`, `updated_at`, `modules`
- `GET /api/v1/homework-submissions` Grading Queue · Permission `homework.grade`: admin, mentor · query: `status`, `cohort_id`, `homework_id`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `GET /api/v1/homework-submissions/{submission_id}` Get Submission · Permission `homework.grade`: admin, mentor · answers 200: `submission_id`, `homework`, `intern`, `cohort`, `current`, `previous`
- `POST /api/v1/homework-submissions/{submission_id}/grade` Grade Submission · Permission `homework.grade`: admin, mentor · body (JSON): `action`, `score`, `rubric_scores`, `feedback_md` · answers 200: `submission_id`, `homework`, `intern`, `cohort`, `current`, `previous`

### activity

- `POST /api/v1/activity/recompute` Recompute · Permission `academy.manage`: admin · body (JSON): `cohort_id` · answers 200: `date`, `cohorts`, `members`
- `GET /api/v1/activity/cohorts/{cohort_id}/leaderboard` Leaderboard · Any signed-in member of the portal (guest or higher) · answers 200: `cohort`, `date`, `entries`
- `GET /api/v1/activity/weights/{program_id}` Get Weights · Permission `academy.manage`: admin · answers 200: `program_id`, `attendance`, `homework`, `on_time`, `practice`, `lessons`, `mentor`, `contest`, `practice_target`, `is_default`
- `PUT /api/v1/activity/weights/{program_id}` Put Weights · Permission `academy.manage`: admin · body (JSON): `attendance`, `homework`, `on_time`, `practice`, `lessons`, `mentor`, `contest`, `practice_target` · answers 200: `program_id`, `attendance`, `homework`, `on_time`, `practice`, `lessons`, `mentor`, `contest`, `practice_target`, `is_default`

### review

- `GET /api/v1/applications` List Applications · Permission `applications.read_assigned`: admin, mentor · query: `program_id`, `status`, `min_total`, `max_total`, `integrity`, `integrity_below`, `tag`, `q`, `reviewer`, `section_min`, `min_profile_signal`, `scoring`, `recommendation`, `ids`, `kind`, `set_id`, `set_state`, `sort`, `order`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `GET /api/v1/applications/counts` Counts · Permission `applications.read_assigned`: admin, mentor · answers 200: `programs`, `sets`
- `GET /api/v1/applications/views` List Views · Permission `applications.read_assigned`: admin, mentor · query: `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/applications/views` Create View · Permission `applications.read_assigned`: admin, mentor · body (JSON): `name*`, `config` · answers 201: `id`, `name`, `config`, `created_at`, `updated_at`
- `DELETE /api/v1/applications/views/{view_id}` Delete View · Permission `applications.read_assigned`: admin, mentor · answers 200: `ok`
- `PATCH /api/v1/applications/views/{view_id}` Update View · Permission `applications.read_assigned`: admin, mentor · body (JSON): `name`, `config` · answers 200: `id`, `name`, `config`, `created_at`, `updated_at`
- `GET /api/v1/applications/reviewers` Reviewers · Permission `applications.decide`: admin · query: `q`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `GET /api/v1/applications/compare` Compare · Permission `applications.read_assigned`: admin, mentor · query: `ids` · answers 200: `items`, `section_types`
- `GET /api/v1/applications/export` Export · Permission `exports.run`: admin · query: `format`, `columns`, `lang`, `program_id`, `status`, `min_total`, `max_total`, `integrity`, `integrity_below`, `tag`, `q`, `reviewer`, `section_min`, `min_profile_signal`, `scoring`, `recommendation`, `ids`, `kind`, `set_id`, `set_state`, `sort`, `order` · answers 200: text/csv or application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
- `POST /api/v1/applications/bulk` Bulk · Permission `applications.decide`: admin · body (JSON): `action*`, `application_ids*`, `status`, `note`, `send_email`, `tag`, `user_id` · answers 200: `results`, `succeeded`, `failed`
- `GET /api/v1/applications/{application_id}` Application Detail · Permission `applications.read_assigned`: admin, mentor · answers 200: `id`, `status`, `program`, `submitted_at`, `created_at`, `updated_at`, `total_score`, `rank`, `ranked_total`, `profile_signal`, `integrity`, `decision_note`, `decided_at`, `decided_by` and 17 more
- `GET /api/v1/applications/{application_id}/notes` List Notes · Permission `applications.read_assigned`: admin, mentor · query: `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/applications/{application_id}/notes` Create Note · Permission `applications.read_assigned`: admin, mentor · body (JSON): `body_md*`, `is_pinned` · answers 201: `id`, `application_id`, `author`, `body_md`, `is_pinned`, `mentions`, `can_edit`, `can_delete`, `created_at`, `updated_at`
- `DELETE /api/v1/applications/{application_id}/notes/{note_id}` Delete Note · Permission `applications.read_assigned`: admin, mentor · answers 200: `ok`
- `PATCH /api/v1/applications/{application_id}/notes/{note_id}` Update Note · Permission `applications.read_assigned`: admin, mentor · body (JSON): `body_md`, `is_pinned` · answers 200: `id`, `application_id`, `author`, `body_md`, `is_pinned`, `mentions`, `can_edit`, `can_delete`, `created_at`, `updated_at`
- `POST /api/v1/applications/{application_id}/summary` Regenerate Summary · Permission `applications.read_assigned`: admin, mentor · answers 202: `queued`

### contests-admin

- `GET /api/v1/contest-questions` Question Options · Permission `contests.manage`: admin · query: `q`, `type`, `difficulty`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `GET /api/v1/contests/manage` List Contests · Permission `contests.manage`: admin · query: `status`, `q`, `slug`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/contests/manage` Create Contest · Permission `contests.manage`: admin · body (JSON): `title*`, `slug`, `description_md`, `rules_md`, `visibility`, `format`, `starts_at*`, `ends_at*`, `freeze_minutes`, `registration_opens_at`, `registration_closes_at`, `proctoring`, `is_rated`, `allow_virtual` and 2 more · answers 201: `id`, `slug`, `title`, `format`, `visibility`, `status`, `phase`, `starts_at`, `ends_at`, `freeze_minutes`, `is_rated`, `participants_count`, `problems_count`, `description_md` and 12 more
- `GET /api/v1/contests/manage/{contest_id}` Get Contest · Permission `contests.manage`: admin · answers 200: `id`, `slug`, `title`, `format`, `visibility`, `status`, `phase`, `starts_at`, `ends_at`, `freeze_minutes`, `is_rated`, `participants_count`, `problems_count`, `description_md` and 12 more
- `DELETE /api/v1/contests/manage/{contest_id}` Delete Contest · Permission `contests.manage`: admin · answers 200: `ok`
- `PATCH /api/v1/contests/manage/{contest_id}` Update Contest · Permission `contests.manage`: admin · body (JSON): `title`, `slug`, `description_md`, `rules_md`, `visibility`, `format`, `starts_at`, `ends_at`, `freeze_minutes`, `registration_opens_at`, `registration_closes_at`, `proctoring`, `is_rated`, `allow_virtual` and 2 more · answers 200: `id`, `slug`, `title`, `format`, `visibility`, `status`, `phase`, `starts_at`, `ends_at`, `freeze_minutes`, `is_rated`, `participants_count`, `problems_count`, `description_md` and 12 more
- `PUT /api/v1/contests/manage/{contest_id}/problems` Put Problems · Permission `contests.manage`: admin · body (JSON): array of `question_id*`, `label`, `points` · answers 200: `id`, `slug`, `title`, `format`, `visibility`, `status`, `phase`, `starts_at`, `ends_at`, `freeze_minutes`, `is_rated`, `participants_count`, `problems_count`, `description_md` and 12 more
- `POST /api/v1/contests/manage/{contest_id}/publish` Publish · Permission `contests.manage`: admin · answers 200: `id`, `slug`, `title`, `format`, `visibility`, `status`, `phase`, `starts_at`, `ends_at`, `freeze_minutes`, `is_rated`, `participants_count`, `problems_count`, `description_md` and 12 more
- `POST /api/v1/contests/manage/{contest_id}/unpublish` Unpublish · Permission `contests.manage`: admin · answers 200: `id`, `slug`, `title`, `format`, `visibility`, `status`, `phase`, `starts_at`, `ends_at`, `freeze_minutes`, `is_rated`, `participants_count`, `problems_count`, `description_md` and 12 more
- `POST /api/v1/contests/manage/{contest_id}/finalize` Finalize · Permission `contests.manage`: admin · answers 200: `id`, `slug`, `title`, `format`, `visibility`, `status`, `phase`, `starts_at`, `ends_at`, `freeze_minutes`, `is_rated`, `participants_count`, `problems_count`, `description_md` and 12 more
- `POST /api/v1/contests/manage/{contest_id}/publish-results` Publish Results · Permission `contests.manage`: admin · answers 200: `status`, `ratings_applied`, `notified`, `changes`
- `GET /api/v1/contests/manage/{contest_id}/participants` Participants · Permission `contests.manage`: admin · query: `q`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/contests/manage/{contest_id}/participants` Add Participants · Permission `contests.manage`: admin · body (JSON): `emails*` · answers 200: `added`, `already`, `not_found`
- `POST /api/v1/contests/manage/{contest_id}/participants/{user_id}/disqualify` Disqualify · Permission `contests.manage`: admin · body (JSON): `reason*` · answers 200: `user`, `registered_at`, `is_virtual`, `virtual_started_at`, `disqualified`, `dq_reason`, `rank`, `score`, `solved`, `penalty`, `submissions`
- `POST /api/v1/contests/manage/{contest_id}/participants/{user_id}/reinstate` Reinstate · Permission `contests.manage`: admin · answers 200: `user`, `registered_at`, `is_virtual`, `virtual_started_at`, `disqualified`, `dq_reason`, `rank`, `score`, `solved`, `penalty`, `submissions`
- `GET /api/v1/contests/manage/{contest_id}/submissions` Submissions · Permission `contests.manage`: admin · query: `user_id`, `label`, `verdict`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/contests/manage/{contest_id}/rejudge` Rejudge · Permission `contests.manage`: admin · body (JSON): `submission_id`, `label` · answers 202: `id`, `scope`, `label`, `submission_id`, `status`, `total`, `judged`, `changed`, `failed`, `error`, `changes`, `created`, `requested_by_name`, `created_at` and 2 more
- `GET /api/v1/contests/manage/{contest_id}/rejudges` Rejudges · Permission `contests.manage`: admin · query: `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `GET /api/v1/contests/manage/{contest_id}/clarifications` Clarifications · Permission `contests.manage`: admin · query: `status`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/contests/manage/{contest_id}/clarifications` Announce · Permission `contests.manage`: admin · body (JSON): `problem_label`, `text*` · answers 201: `id`, `problem_label`, `question`, `answer`, `is_public`, `is_announcement`, `is_mine`, `created_at`, `updated_at`, `asker`, `asker_email`, `answered_by_name`
- `PATCH /api/v1/contests/manage/{contest_id}/clarifications/{clarification_id}` Answer · Permission `contests.manage`: admin · body (JSON): `answer*`, `is_public` · answers 200: `id`, `problem_label`, `question`, `answer`, `is_public`, `is_announcement`, `is_mine`, `created_at`, `updated_at`, `asker`, `asker_email`, `answered_by_name`
- `GET /api/v1/contests/manage/{contest_id}/plagiarism` Plagiarism · Permission `contests.manage`: admin · query: `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/contests/manage/{contest_id}/plagiarism/run` Run Plagiarism · Permission `contests.manage`: admin · answers 202: `queued`
- `POST /api/v1/contests/manage/{contest_id}/to-talent-pool` To Talent Pool · Permission `contests.manage`: admin · body (JSON): `top_n`, `tags`, `note` · answers 200: `added`, `updated`, `user_ids`
- `GET /api/v1/contests/manage/{contest_id}/export` Export Standings · Permission `exports.run`: admin · answers 200: text/csv

### ai_usage

- `GET /api/v1/ai-usage` Ai Usage · Permission `portal.settings`: admin · query: `period`, `from`, `to` · answers 200: `period`, `date_from`, `date_to`, `timezone`, `currency`, `prices_checked_on`, `totals`, `daily`, `by_model`, `by_kind`, `current`
- `GET /api/v1/ai-usage/calls` Ai Calls · Permission `portal.settings`: admin · query: `period`, `from`, `to`, `kind`, `status`, `model`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `GET /api/v1/ai-usage/budget` Ai Budget Status · Permission `portal.settings`: admin · answers 200: `month`, `date_from`, `date_to`, `today`, `timezone`, `currency`, `limit_usd`, `spent_usd`, `remaining_usd`, `percent`, `projected_usd`, `state`, `unpriced_calls`, `thresholds`
- `GET /api/v1/ai-usage/retry-failed` Ai Retry Preview · Permission `portal.settings`: admin · query: `period`, `from`, `to` · answers 200: `date_from`, `date_to`, `total`, `by_kind`, `limit`, `capped`
- `POST /api/v1/ai-usage/retry-failed` Ai Retry Failed · Permission `portal.settings`: admin · body (JSON): `period`, `from`, `to` · answers 200: `date_from`, `date_to`, `queued`, `skipped`, `by_kind`, `skipped_by_reason`, `remaining`, `limit`

### application_forms

- `GET /api/v1/programs/{slug}/form` Program Form · Public: anonymous callers allowed; a signed-in caller is recognised by the access cookie · answers 200: `fields`, `system_steps`, `required_link_types`, `required_skill_codes`
- `GET /api/v1/programs/manage/{program_id}/form-fields` Admin Form Fields · Permission `programs.manage`: admin · answers 200: array of `id`, `key`, `label_uz`, `label_en`, `help_uz`, `help_en`, `type`, `options`, `required`, `position`, `is_system`
- `PUT /api/v1/programs/manage/{program_id}/form-fields` Admin Put Form Fields · Permission `programs.manage`: admin · body (JSON): array of `key*`, `label_uz*`, `label_en*`, `help_uz`, `help_en`, `type*`, `options`, `required` · answers 200: array of `id`, `key`, `label_uz`, `label_en`, `help_uz`, `help_en`, `type`, `options`, `required`, `position`, `is_system`

### applications

- `GET /api/v1/programs/{slug}/application` My Application For Program · Permission `applications.own`: admin, mentor, intern, guest · answers 200: `id`, `program_id`, `status`, `answers`, `wizard_step`, `submitted_at`, `created_at`, `updated_at`
- `POST /api/v1/programs/{slug}/applications` Save Application Draft · Permission `applications.own`: admin, mentor, intern, guest · body (JSON): `answers`, `wizard_step`, `source` · answers 200: `id`, `program_id`, `status`, `answers`, `wizard_step`, `submitted_at`, `created_at`, `updated_at`
- `POST /api/v1/applications/{application_id}/submit` Submit Application · Permission `applications.own`: admin, mentor, intern, guest · body (JSON): `consents*` · answers 200: `id`, `program_id`, `status`, `answers`, `wizard_step`, `submitted_at`, `created_at`, `updated_at`
- `POST /api/v1/applications/{application_id}/withdraw` Withdraw Application · Permission `applications.own`: admin, mentor, intern, guest · answers 200: `id`, `program_id`, `status`, `answers`, `wizard_step`, `submitted_at`, `created_at`, `updated_at`
- `GET /api/v1/me/applications` My Applications · Permission `applications.own`: admin, mentor, intern, guest · answers 200: array of `id`, `status`, `program`, `submitted_at`, `created_at`, `history`, `next_step`, `can_withdraw`, `assessment`, `interview`

### assessments

- `GET /api/v1/assessments` List Assessments · Permission `assessments.manage`: admin · query: `status`, `q`, `include_archived`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/assessments` Create Assessment · Permission `assessments.manage`: admin · body (JSON): `title*`, `instructions_md`, `duration_minutes`, `window_hours`, `settings`, `status` · answers 201: `id`, `title`, `status`, `duration_minutes`, `window_hours`, `sections_count`, `total_questions`, `sessions_count`, `created_at`, `updated_at`, `instructions_md`, `settings`, `sections`, `program_ids`
- `GET /api/v1/assessments/{assessment_id}` Get Assessment · Permission `assessments.manage`: admin · answers 200: `id`, `title`, `status`, `duration_minutes`, `window_hours`, `sections_count`, `total_questions`, `sessions_count`, `created_at`, `updated_at`, `instructions_md`, `settings`, `sections`, `program_ids`
- `DELETE /api/v1/assessments/{assessment_id}` Archive Assessment · Permission `assessments.manage`: admin · answers 200: `ok`
- `PATCH /api/v1/assessments/{assessment_id}` Update Assessment · Permission `assessments.manage`: admin · body (JSON): `title`, `instructions_md`, `duration_minutes`, `window_hours`, `settings`, `status` · answers 200: `id`, `title`, `status`, `duration_minutes`, `window_hours`, `sections_count`, `total_questions`, `sessions_count`, `created_at`, `updated_at`, `instructions_md`, `settings`, `sections`, `program_ids`
- `PUT /api/v1/assessments/{assessment_id}/sections` Replace Sections · Permission `assessments.manage`: admin · body (JSON): array of `id`, `type*`, `title`, `pick_count`, `difficulty_mix`, `tag_filter`, `weight`, `time_limit_minutes`, `is_optional`, `pool_question_ids` · answers 200: array of `id`, `position`, `type`, `title`, `pick_count`, `difficulty_mix`, `tag_filter`, `weight`, `time_limit_minutes`, `is_optional`, `pool_question_ids`
- `GET /api/v1/assessments/{assessment_id}/pool-stats` Pool Stats · Permission `assessments.manage`: admin · answers 200: `ok`, `sections`, `questions_total`, `languages`, `common_languages`, `mixed_languages`
- `POST /api/v1/assessments/{assessment_id}/preview-session` Preview Session · Permission `assessments.manage`: admin · answers 201: `session_id`, `deadline_at`, `warnings`
- `POST /api/v1/applications/{application_id}/assessment-invite` Invite To Assessment · Permission `applications.decide`: admin · answers 200: `invite_id`, `application_id`, `assessment_id`, `valid_from`, `valid_until`, `sent_at`, `resend_count`, `application_status`

### mentoring

- `GET /api/v1/classes` List Classes · Permission `attendance.write`: admin, mentor · query: `cohort_id`, `when`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/classes` Create Class · Permission `attendance.write`: admin, mentor · body (JSON): `cohort_id*`, `title*`, `starts_at*`, `ends_at`, `meeting_url`, `location`, `host_id` · answers 201: `id`, `cohort`, `title`, `starts_at`, `ends_at`, `meeting_url`, `location`, `host`, `reminder_sent`, `attendance_taken`, `counts`, `roster`
- `GET /api/v1/classes/{class_id}` Get Class · Permission `attendance.write`: admin, mentor · answers 200: `id`, `cohort`, `title`, `starts_at`, `ends_at`, `meeting_url`, `location`, `host`, `reminder_sent`, `attendance_taken`, `counts`, `roster`
- `DELETE /api/v1/classes/{class_id}` Delete Class · Permission `attendance.write`: admin, mentor · answers 200: `ok`
- `PATCH /api/v1/classes/{class_id}` Update Class · Permission `attendance.write`: admin, mentor · body (JSON): `title`, `starts_at`, `ends_at`, `meeting_url`, `location`, `host_id` · answers 200: `id`, `cohort`, `title`, `starts_at`, `ends_at`, `meeting_url`, `location`, `host`, `reminder_sent`, `attendance_taken`, `counts`, `roster`
- `PUT /api/v1/classes/{class_id}/attendance` Save Attendance · Permission `attendance.write`: admin, mentor · body (JSON): `records`, `all_present` · answers 200: `id`, `cohort`, `title`, `starts_at`, `ends_at`, `meeting_url`, `location`, `host`, `reminder_sent`, `attendance_taken`, `counts`, `roster`
- `GET /api/v1/cohort-members` List Members · Permission `interns.view`: admin, mentor · query: `cohort_id`, `q`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `DELETE /api/v1/cohort-members/notes/{note_id}` Delete Note · Permission `mentor_notes.rw`: admin, mentor · answers 200: `ok`
- `GET /api/v1/cohort-members/{user_id}` Member Detail · Permission `interns.view`: admin, mentor · query: `cohort_id` · answers 200: `user`, `cohort`, `mentor`, `status`, `joined_at`, `activity`, `live_components`, `history`, `attendance_summary`, `attendance`, `homework_stats`, `homeworks`, `notes`, `ratings` and 2 more
- `POST /api/v1/cohort-members/{user_id}/notes` Add Note · Permission `mentor_notes.rw`: admin, mentor · body (JSON): `body_md*`, `cohort_id` · answers 201: `id`, `body_md`, `author`, `created_at`, `can_delete`
- `PUT /api/v1/cohort-members/{user_id}/rating` Rate Week · Permission `mentor_notes.rw`: admin, mentor · body (JSON): `week_start*`, `rating*`, `comment`, `cohort_id` · answers 200: `id`, `week_start`, `rating`, `comment`, `mentor`, `updated_at`

### audit

- `GET /api/v1/audit` List Audit Log · Permission `audit.read`: admin · query: `q`, `action`, `entity_type`, `entity_id`, `actor_id`, `from`, `to`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `GET /api/v1/audit/facets` Audit Facets · Permission `audit.read`: admin · answers 200: `actions`, `entity_types`
- `GET /api/v1/audit/attempts` List Attempts · Permission `audit.read`: admin · query: `user`, `problem`, `user_id`, `question_id`, `context`, `kind`, `verdict`, `language`, `from`, `to`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`

### auth

- `GET /api/v1/auth/google/login` Google Login · Public: anonymous callers allowed; a signed-in caller is recognised by the access cookie · query: `next`
- `GET /api/v1/auth/google/callback` Google Callback · Public: anonymous callers allowed; a signed-in caller is recognised by the access cookie
- `POST /api/v1/auth/refresh` Refresh · The refresh cookie, and the CSRF cookie and header (it is an auth cookie): rotates the refresh token and sets a new access cookie · answers 200: `ok`
- `POST /api/v1/auth/logout` Logout · Anonymous callers allowed (only the cookies are cleared); with the refresh cookie its session ends, and then the CSRF cookie and header are required · answers 200: `ok`
- `POST /api/v1/auth/signup` Sign Up · Public: anonymous callers allowed; a signed-in caller is recognised by the access cookie. The CSRF cookie and header are required even without auth cookies · body (JSON): `full_name*`, `email*`, `password*`, `locale`, `next` · answers 202: `status`, `challenge_id`, `resend_after`, `expires_in`
- `POST /api/v1/auth/signin` Sign In · Public: anonymous callers allowed; a signed-in caller is recognised by the access cookie. The CSRF cookie and header are required even without auth cookies · body (JSON): `email*`, `password*`, `next` · answers 200: `status`, `challenge_id`, `resend_after`, `expires_in`
- `POST /api/v1/auth/verify-email` Verify Email · Public: anonymous callers allowed; a signed-in caller is recognised by the access cookie. The CSRF cookie and header are required even without auth cookies · body (JSON): `challenge_id*`, `code*`, `next` · answers 200: `status`, `challenge_id`, `resend_after`, `expires_in`
- `POST /api/v1/auth/resend-code` Resend Code · Public: anonymous callers allowed; a signed-in caller is recognised by the access cookie. The CSRF cookie and header are required even without auth cookies · body (JSON): `challenge_id*`, `next` · answers 200: `status`, `challenge_id`, `resend_after`, `expires_in`
- `POST /api/v1/auth/forgot-password` Forgot Password · Public: anonymous callers allowed; a signed-in caller is recognised by the access cookie. The CSRF cookie and header are required even without auth cookies · body (JSON): `email*`, `next` · answers 202: `ok`
- `POST /api/v1/auth/reset-password` Reset Password · Public: anonymous callers allowed; a signed-in caller is recognised by the access cookie. The CSRF cookie and header are required even without auth cookies · body (JSON): `token*`, `password*`, `next` · answers 200: `status`, `challenge_id`, `resend_after`, `expires_in`
- `GET /api/v1/auth/sessions` List Sessions · Any signed-in member of the portal (guest or higher) · query: `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `DELETE /api/v1/auth/sessions/{session_id}` End Session · Any signed-in member of the portal (guest or higher) · answers 200: `ok`
- `POST /api/v1/auth/sessions/revoke-others` End Other Sessions · Any signed-in member of the portal (guest or higher) · answers 200: `revoked`

### catalogs

- `GET /api/v1/skills` List Skills · Public: anonymous callers allowed; a signed-in caller is recognised by the access cookie · query: `include_inactive` · answers 200: array of `id`, `code`, `name`, `category`, `is_active`
- `POST /api/v1/skills` Create Skill · Permission `portal.settings`: admin · body (JSON): `code*`, `name*`, `category*`, `is_active` · answers 201: `id`, `code`, `name`, `category`, `is_active`
- `GET /api/v1/profile-link-types` List Link Types · Public: anonymous callers allowed; a signed-in caller is recognised by the access cookie · query: `include_inactive` · answers 200: array of `id`, `code`, `name`, `url_regex`, `icon`, `category`, `enrich_provider`, `sort_order`, `is_active`
- `POST /api/v1/profile-link-types` Create Link Type · Permission `portal.settings`: admin · body (JSON): `code*`, `name*`, `url_regex*`, `icon`, `category*`, `enrich_provider`, `sort_order`, `is_active` · answers 201: `id`, `code`, `name`, `url_regex`, `icon`, `category`, `enrich_provider`, `sort_order`, `is_active`
- `PATCH /api/v1/skills/{skill_id}` Update Skill · Permission `portal.settings`: admin · body (JSON): `code*`, `name*`, `category*`, `is_active` · answers 200: `id`, `code`, `name`, `category`, `is_active`
- `PATCH /api/v1/profile-link-types/{link_type_id}` Update Link Type · Permission `portal.settings`: admin · body (JSON): `code*`, `name*`, `url_regex*`, `icon`, `category*`, `enrich_provider`, `sort_order`, `is_active` · answers 200: `id`, `code`, `name`, `url_regex`, `icon`, `category`, `enrich_provider`, `sort_order`, `is_active`

### contests

- `GET /api/v1/contests` List Contests · Public: anonymous callers allowed; a signed-in caller is recognised by the access cookie · query: `when`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `GET /api/v1/contests/{slug}` Get Contest · Public: anonymous callers allowed; a signed-in caller is recognised by the access cookie · answers 200: `slug`, `title`, `description_md`, `rules_md`, `prizes_md`, `sponsor_text`, `format`, `visibility`, `proctoring`, `phase`, `starts_at`, `ends_at`, `duration_minutes`, `freeze_minutes` and 13 more
- `POST /api/v1/contests/{slug}/register` Register · Permission `contests.participate`: admin, mentor, intern, guest · answers 200: `slug`, `title`, `description_md`, `rules_md`, `prizes_md`, `sponsor_text`, `format`, `visibility`, `proctoring`, `phase`, `starts_at`, `ends_at`, `duration_minutes`, `freeze_minutes` and 13 more
- `DELETE /api/v1/contests/{slug}/register` Unregister · Permission `contests.participate`: admin, mentor, intern, guest · answers 200: `slug`, `title`, `description_md`, `rules_md`, `prizes_md`, `sponsor_text`, `format`, `visibility`, `proctoring`, `phase`, `starts_at`, `ends_at`, `duration_minutes`, `freeze_minutes` and 13 more
- `POST /api/v1/contests/{slug}/virtual` Start Virtual · Permission `contests.participate`: admin, mentor, intern, guest · answers 200: `slug`, `title`, `description_md`, `rules_md`, `prizes_md`, `sponsor_text`, `format`, `visibility`, `proctoring`, `phase`, `starts_at`, `ends_at`, `duration_minutes`, `freeze_minutes` and 13 more
- `GET /api/v1/contests/{slug}/problems` Arena · Public: anonymous callers allowed; a signed-in caller is recognised by the access cookie · answers 200: `slug`, `title`, `format`, `phase`, `mode`, `proctoring`, `starts_at`, `ends_at`, `window_ends_at`, `freeze_minutes`, `freeze_starts_at`, `server_now`, `can_submit`, `problems`
- `POST /api/v1/contests/{slug}/problems/{label}/run` Run Code · Permission `contests.participate`: admin, mentor, intern, guest · headers: `Idempotency-Key` · body (JSON): `code*` · answers 200: `submission_id`, `verdict`, `tests_passed`, `tests_total`, `compile_error`, `message`, `error`, `tests`
- `POST /api/v1/contests/{slug}/problems/{label}/submit` Submit Code · Permission `contests.participate`: admin, mentor, intern, guest · headers: `Idempotency-Key` · body (JSON): `code*` · answers 200: `submission_id`, `verdict`, `tests_passed`, `tests_total`, `score`, `max_score`, `compile_error`, `message`, `error`, `visible`, `hidden`, `created_at`, `label`, `mode` and 1 more
- `GET /api/v1/contests/{slug}/submissions` My Submissions · Permission `contests.participate`: admin, mentor, intern, guest · query: `label`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `GET /api/v1/contests/{slug}/standings` Standings · Public: anonymous callers allowed; a signed-in caller is recognised by the access cookie · query: `live`, `virtual`, `sort`, `order`, `page`, `page_size` · answers 200: `slug`, `title`, `format`, `phase`, `frozen`, `live`, `freeze_starts_at`, `ends_at`, `problems`, `rows`, `total`, `me`, `updated_at`, `server_now` and 1 more
- `GET /api/v1/contests/{slug}/standings/stream` Standings Stream · Public: anonymous callers allowed; a signed-in caller is recognised by the access cookie · query: `live`, `virtual`, `sort`, `order`, `page`, `page_size` · answers 200: text/event-stream
- `GET /api/v1/contests/{slug}/clarifications` Clarifications · Permission `contests.participate`: admin, mentor, intern, guest · query: `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/contests/{slug}/clarifications` Ask · Permission `contests.participate`: admin, mentor, intern, guest · body (JSON): `problem_label`, `question*` · answers 201: `id`, `problem_label`, `question`, `answer`, `is_public`, `is_announcement`, `is_mine`, `created_at`, `updated_at`

### dashboard

- `GET /api/v1/dashboard` Dashboard · Permission `dashboard.view`: admin · query: `program_id`, `days` · answers 200: `days`, `program_id`, `programs`, `totals`, `funnels`, `score_histogram`, `integrity`, `daily`, `ai_usage`, `recent`, `top_skills`

### decisions

- `POST /api/v1/applications/decisions` Bulk Decision · Permission `applications.decide`: admin · body (JSON): `decision*`, `note`, `send_email`, `application_ids*` · answers 200: `results`, `succeeded`, `failed`
- `POST /api/v1/applications/{application_id}/decision` Decide · Permission `applications.decide`: admin · body (JSON): `decision*`, `note`, `send_email` · answers 200: `application_id`, `ok`, `decision`, `status`, `code`, `warnings`, `cohort_id`, `role`

### email

- `GET /api/v1/email/queue` Email Queue · Permission `portal.settings`: admin · answers 200: `pending`, `held_quota`, `held_provider`, `failed`, `failed_recent`, `templates`
- `GET /api/v1/email/queue/messages` Email Queue Messages · Permission `portal.settings`: admin · query: `status`, `template_code`, `q`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `GET /api/v1/email/queue/counts` Email Queue Counts · Permission `portal.settings`: admin · query: `q` · answers 200: `sent`, `failed`, `pending`
- `GET /api/v1/email/history` Email History · Permission `portal.settings`: admin · query: `days`, `template_code` · answers 200: `days`, `date_from`, `date_to`, `timezone`, `template_code`, `totals`, `daily`, `templates`, `reasons`
- `POST /api/v1/email/queue/resend-failed` Resend Failed Emails · Permission `portal.settings`: admin · answers 200: `requeued`, `skipped`
- `POST /api/v1/email/queue/{message_id}/resend` Resend Email · Permission `portal.settings`: admin · answers 200: `id`, `template_code`, `to_address`, `status`, `priority`, `attempts`, `last_error`, `held_reason`, `next_attempt_at`, `created_at`, `sent_at`, `held_at`, `failed_at`, `reason` and 2 more

### files

- `POST /api/v1/files/presign-upload` Presign Upload · Any signed-in member of the portal (guest or higher) · body (JSON): `purpose*`, `filename*`, `mime_type*`, `size_bytes*` · answers 201: `file_id`, `upload_url`, `method`, `headers`, `expires_in`
- `POST /api/v1/files/{file_id}/complete` Complete Upload · Any signed-in member of the portal (guest or higher) · answers 200: `id`, `purpose`, `original_name`, `mime_type`, `size_bytes`, `completed_at`, `created_at`
- `GET /api/v1/files/{file_id}/url` File Url · Any signed-in member of the portal (guest or higher) · answers 200: `url`, `expires_in`, `mime_type`

### grading

- `GET /api/v1/grading` Grading Queue · Permission `scores.override`: admin, mentor · query: `state`, `program_id`, `type`, `q`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `GET /api/v1/grading/{session_question_id}` Grading Detail · Permission `scores.override`: admin, mentor · answers 200: `item`, `question`, `can_retry_ai`
- `POST /api/v1/grading/{session_question_id}/retry-ai` Retry Ai · Permission `scores.override`: admin, mentor · answers 202: `queued`
- `POST /api/v1/scores/override` Override Score · Permission `scores.override`: admin, mentor · body (JSON): `session_question_id*`, `score*`, `reason*` · answers 200: `session_question_id`, `old_score`, `score`, `session_id`, `auto_score`, `final_score`, `scoring_status`, `application_id`, `total_score`, `rank`

### integration

- `GET /api/v1/integration/sets` List Sets · The portal's integration API key · answers 200: array of `id`, `code`, `title`, `url`, `status`, `opens_at`, `closes_at`, `assessment`, `invited`, `started`, `submitted`
- `GET /api/v1/integration/sets/{set_id}/invites` List Invites · The portal's integration API key · query: `status`, `email`, `external_id`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/integration/sets/{set_id}/invites` Invite · The portal's integration API key · body (JSON): `recipients*`, `resend` · answers 200: `created`, `existing`, `resent`, `items`
- `GET /api/v1/integration/invites/{invite_id}` Get Invite · The portal's integration API key · answers 200: `id`, `set_id`, `email`, `external_id`, `full_name`, `status`, `invited_at`, `email_sent_at`, `resend_count`, `opened_at`, `started_at`, `submitted_at`, `score`, `max_score` and 7 more
- `GET /api/v1/integration-keys` List Keys · Permission `portal.settings`: admin · answers 200: array of `id`, `name`, `prefix`, `created_at`, `created_by_name`, `last_used_at`, `revoked_at`
- `POST /api/v1/integration-keys` Create Key · Permission `portal.settings`: admin · body (JSON): `name*` · answers 201: `id`, `name`, `prefix`, `created_at`, `created_by_name`, `last_used_at`, `revoked_at`, `secret`
- `POST /api/v1/integration-keys/{key_id}/revoke` Revoke Key · Permission `portal.settings`: admin · answers 200: `id`, `name`, `prefix`, `created_at`, `created_by_name`, `last_used_at`, `revoked_at`

### interviews

- `GET /api/v1/interview-slots` List Slots · Permission `interviews.manage`: admin · query: `from`, `to`, `interviewer_id`, `program_id`, `status`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/interview-slots` Create Slots · Permission `interviews.manage`: admin · body: JSON · answers 201: `created`, `skipped`
- `DELETE /api/v1/interview-slots/{slot_id}` Delete Slot · Permission `interviews.manage`: admin · answers 200: `ok`
- `PATCH /api/v1/interview-slots/{slot_id}` Update Slot · Permission `interviews.manage`: admin · body (JSON): `starts_at`, `ends_at`, `program_id`, `interviewer_id`, `meeting_url`, `location` · answers 200: `id`, `program`, `interviewer`, `starts_at`, `ends_at`, `meeting_url`, `location`, `status`, `interview`, `created_at`
- `POST /api/v1/interview-slots/{slot_id}/cancel` Cancel Slot · Permission `interviews.manage`: admin · answers 200: `slot`, `rebook_invite_sent`
- `GET /api/v1/interview-scorecards` List Scorecards · Permission `interviews.manage`: admin · query: `q`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/interview-scorecards` Create Scorecard · Permission `interviews.manage`: admin · body (JSON): `title*`, `criteria*`, `is_default` · answers 201: `id`, `title`, `criteria`, `is_default`, `interviews_count`, `created_at`, `updated_at`
- `DELETE /api/v1/interview-scorecards/{scorecard_id}` Delete Scorecard · Permission `interviews.manage`: admin · answers 200: `ok`
- `PATCH /api/v1/interview-scorecards/{scorecard_id}` Update Scorecard · Permission `interviews.manage`: admin · body (JSON): `title`, `criteria`, `is_default` · answers 200: `id`, `title`, `criteria`, `is_default`, `interviews_count`, `created_at`, `updated_at`
- `GET /api/v1/interviews/options` Interview Options · Permission `interviews.manage`: admin · answers 200: `programs`, `interviewers`, `timezone`
- `GET /api/v1/interviews/candidates` Invite Candidates · Permission `interviews.manage`: admin · query: `program_id`, `status`, `q`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/interviews/invite` Invite · Permission `interviews.manage`: admin · body (JSON): `application_ids*`, `scorecard_id` · answers 200: `results`, `invited`
- `GET /api/v1/interviews` List Interviews · Permission `interviews.feedback`: admin, mentor · query: `date`, `tz`, `mine`, `status`, `program_id`, `q`, `upcoming`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `GET /api/v1/interviews/book/{token}` Booking Page · Any signed-in member of the portal (guest or higher) · answers 200: `interview_id`, `status`, `program`, `booked_slot`, `can_book`, `can_reschedule`, `reschedule_count`, `max_reschedules`, `reschedule_deadline`, `reschedule_block_reason`, `days`, `timezone`
- `POST /api/v1/interviews/book/{token}` Book Slot · Any signed-in member of the portal (guest or higher) · body (JSON): `slot_id*` · answers 200: `interview_id`, `status`, `program`, `booked_slot`, `can_book`, `can_reschedule`, `reschedule_count`, `max_reschedules`, `reschedule_deadline`, `reschedule_block_reason`, `days`, `timezone`
- `GET /api/v1/interviews/{interview_id}/brief` Interview Brief · Permission `interviews.feedback`: admin, mentor · answers 200: `interview`, `profile`, `skills`, `scores`, `summary`, `flags`, `suggested`, `answers`, `scorecard`, `my_feedback`, `feedback`
- `POST /api/v1/interviews/{interview_id}/no-show` Mark No Show · Permission `interviews.feedback`: admin, mentor · answers 200: `id`, `status`, `application_id`, `application_status`, `program`, `candidate`, `slot`, `scorecard_id`, `invited_at`, `booked_at`, `reschedule_count`, `total_score`, `integrity_score`, `feedback_count` and 4 more
- `POST /api/v1/interviews/{interview_id}/cancel` Cancel Interview · Permission `interviews.manage`: admin · answers 200: `id`, `status`, `application_id`, `application_status`, `program`, `candidate`, `slot`, `scorecard_id`, `invited_at`, `booked_at`, `reschedule_count`, `total_score`, `integrity_score`, `feedback_count` and 4 more
- `POST /api/v1/applications/{application_id}/interview-link` Fresh Booking Link · Permission `applications.own`: admin, mentor, intern, guest · answers 200: `url`
- `POST /api/v1/interviews/{interview_id}/feedback` Submit Feedback · Permission `interviews.feedback`: admin, mentor · body (JSON): `scores*`, `recommendation*`, `notes_md` · answers 200: `id`, `interview_id`, `author`, `scores`, `overall`, `recommendation`, `notes_md`, `submitted_at`

### me

- `GET /api/v1/me` Get Me · Any signed-in member of the portal (guest or higher) · answers 200: `id`, `email`, `full_name`, `avatar_url`, `locale`, `timezone`, `handle`, `public_profile`, `role`, `permissions`, `profile_completed`, `telegram_linked`, `has_set_attempts`, `portal`
- `PATCH /api/v1/me` Update Me · Any signed-in member of the portal (guest or higher) · body (JSON): `full_name`, `locale`, `timezone`, `handle`, `public_profile` · answers 200: `id`, `email`, `full_name`, `avatar_url`, `locale`, `timezone`, `handle`, `public_profile`, `role`, `permissions`, `profile_completed`, `telegram_linked`, `has_set_attempts`, `portal`
- `GET /api/v1/me/profile` Get Profile · Any signed-in member of the portal (guest or higher) · answers 200: `user_id`, `email`, `full_name`, `avatar_url`, `phone`, `birth_date`, `gender`, `city`, `country`, `education_level`, `university`, `graduation_year`, `current_position`, `company` and 8 more
- `PATCH /api/v1/me/profile` Update Profile · Any signed-in member of the portal (guest or higher) · body (JSON): `full_name`, `phone`, `birth_date`, `gender`, `city`, `country`, `education_level`, `university`, `graduation_year`, `current_position`, `company`, `english_level`, `english_certificate`, `about_md` and 2 more · answers 200: `user_id`, `email`, `full_name`, `avatar_url`, `phone`, `birth_date`, `gender`, `city`, `country`, `education_level`, `university`, `graduation_year`, `current_position`, `company` and 8 more
- `PUT /api/v1/me/skills` Put Skills · Any signed-in member of the portal (guest or higher) · body (JSON): array of `skill_id*`, `level*`, `years` · answers 200: array of `skill_id`, `code`, `name`, `category`, `level`, `years`
- `PUT /api/v1/me/links` Put Links · Any signed-in member of the portal (guest or higher) · body (JSON): array of `link_type_id*`, `url*` · answers 200: array of `id`, `link_type_id`, `code`, `name`, `icon`, `url`, `handle`, `enriched`, `enriched_at`, `enrich_error`
- `POST /api/v1/me/telegram/link` Telegram Link · Any signed-in member of the portal (guest or higher) · answers 200: `deep_link`, `linked`
- `DELETE /api/v1/me/telegram` Telegram Unlink · Any signed-in member of the portal (guest or higher) · answers 200: `ok`

### members

- `GET /api/v1/members` List Members · Permission `members.manage`: admin · query: `role`, `q`, `sort`, `order`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/members` Invite Member · Permission `members.manage`: admin · body (JSON): `email*`, `role*`, `full_name` · answers 201: `user_id`, `email`, `full_name`, `avatar_url`, `role`, `last_login_at`, `created_at`
- `DELETE /api/v1/members/{user_id}` Remove Member · Permission `members.manage`: admin · answers 200: `ok`
- `PATCH /api/v1/members/{user_id}` Change Role · Permission `members.manage`: admin · body (JSON): `role*` · answers 200: `user_id`, `email`, `full_name`, `avatar_url`, `role`, `last_login_at`, `created_at`

### notifications

- `GET /api/v1/notifications` List Notifications · Any signed-in member of the portal (guest or higher) · query: `unread`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `GET /api/v1/notifications/unread-count` Unread Count · Any signed-in member of the portal (guest or higher) · answers 200: `count`
- `POST /api/v1/notifications/{notification_id}/read` Mark Read · Any signed-in member of the portal (guest or higher) · answers 200: `ok`
- `POST /api/v1/notifications/read-all` Mark All Read · Any signed-in member of the portal (guest or higher) · answers 200: `ok`

### portals

- `GET /api/v1/portal` Current Portal · Public: anonymous callers allowed; a signed-in caller is recognised by the access cookie · answers 200: `id`, `slug`, `host`, `name`, `tagline`, `tagline_en`, `logo_url`, `primary_color`, `default_locale`, `contact_email`, `features`, `ai_provider`
- `GET /api/v1/portal/settings` Admin Portal · Permission `portal.settings`: admin · answers 200: `id`, `slug`, `host`, `name`, `tagline`, `tagline_en`, `logo_file_id`, `primary_color`, `default_locale`, `contact_email`, `is_active`, `settings`, `created_at`
- `PATCH /api/v1/portal/settings` Update Portal · Permission `portal.settings`: admin · body (JSON): `name`, `tagline`, `tagline_en`, `logo_file_id`, `primary_color`, `default_locale`, `contact_email`, `settings` · answers 200: `id`, `slug`, `host`, `name`, `tagline`, `tagline_en`, `logo_file_id`, `primary_color`, `default_locale`, `contact_email`, `is_active`, `settings`, `created_at`

### practice

- `GET /api/v1/practice/problems` List Problems · Public: anonymous callers allowed; a signed-in caller is recognised by the access cookie · query: `type`, `difficulty`, `tag`, `q`, `status`, `solved`, `locale`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `GET /api/v1/practice/tags` List Tags · Public: anonymous callers allowed; a signed-in caller is recognised by the access cookie · answers 200: array of `tag`, `count`
- `GET /api/v1/practice/problems/{slug}` Get Problem · Public: anonymous callers allowed; a signed-in caller is recognised by the access cookie · answers 200: `slug`, `points`, `tags`, `topic`, `stats`, `my_status`, `last_code`, `question`
- `POST /api/v1/practice/problems/{slug}/run` Run Code · Permission `practice.solve`: admin, mentor, intern, guest · headers: `Idempotency-Key` · body (JSON): `code*` · answers 200: `submission_id`, `verdict`, `tests_passed`, `tests_total`, `compile_error`, `message`, `error`, `tests`
- `POST /api/v1/practice/problems/{slug}/submit` Submit Code · Permission `practice.solve`: admin, mentor, intern, guest · headers: `Idempotency-Key` · body (JSON): `code*` · answers 200: `submission_id`, `verdict`, `tests_passed`, `tests_total`, `score`, `max_score`, `compile_error`, `message`, `error`, `visible`, `hidden`, `created_at`, `solved`, `first_solve` and 1 more
- `GET /api/v1/practice/problems/{slug}/submissions` My Submissions · Permission `practice.solve`: admin, mentor, intern, guest · query: `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `GET /api/v1/practice/me` My Stats · Permission `practice.solve`: admin, mentor, intern, guest · answers 200: `solved`, `attempted`, `total_problems`, `by_difficulty`, `by_type`, `streak`, `last_solved_at`, `activity`
- `GET /api/v1/practice/leaderboard` Leaderboard · Public: anonymous callers allowed; a signed-in caller is recognised by the access cookie · query: `period`, `cursor`, `limit`, `page`, `page_size` · answers 200: `period`, `since`, `items`, `next_cursor`, `total`, `me`, `rows`

### privacy

- `GET /api/v1/me/privacy` My Privacy · Any signed-in member of the portal (guest or higher) · answers 200: `exports`, `deletion_request`, `export_ttl_hours`, `exports_per_day`
- `POST /api/v1/me/privacy/exports` Request Export · Any signed-in member of the portal (guest or higher) · answers 202: `id`, `status`, `size_bytes`, `created_at`, `completed_at`, `expires_at`, `downloaded_at`
- `GET /api/v1/me/privacy/exports/{export_id}/download` Download Export · Any signed-in member of the portal (guest or higher) · answers 200: `url`, `expires_in`
- `POST /api/v1/me/privacy/deletion-request` Request Deletion · Any signed-in member of the portal (guest or higher) · body (JSON): `confirm_email*`, `reason` · answers 201: `id`, `status`, `source`, `reason`, `decision_note`, `created_at`, `decided_at`
- `DELETE /api/v1/me/privacy/deletion-request` Cancel Deletion · Any signed-in member of the portal (guest or higher) · answers 200: `ok`
- `GET /api/v1/privacy/deletion-requests` List Deletion Requests · Permission `privacy.manage`: admin · query: `status`, `q`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/privacy/deletion-requests/{request_id}/approve` Approve Deletion Request · Permission `privacy.manage`: admin · answers 200: `id`, `status`, `source`, `reason`, `decision_note`, `user`, `requested_by_name`, `decided_by_name`, `created_at`, `decided_at`, `completed_at`, `attempts`, `last_error`, `summary`
- `POST /api/v1/privacy/deletion-requests/{request_id}/reject` Reject Deletion Request · Permission `privacy.manage`: admin · body (JSON): `reason*` · answers 200: `id`, `status`, `source`, `reason`, `decision_note`, `user`, `requested_by_name`, `decided_by_name`, `created_at`, `decided_at`, `completed_at`, `attempts`, `last_error`, `summary`
- `POST /api/v1/privacy/users/{user_id}/delete` Delete User Data · Permission `privacy.manage`: admin · body (JSON): `reason*` · answers 202: `id`, `status`, `source`, `reason`, `decision_note`, `user`, `requested_by_name`, `decided_by_name`, `created_at`, `decided_at`, `completed_at`, `attempts`, `last_error`, `summary`

### proctoring

- `GET /api/v1/sessions/{session_id}/replay` Session Replay · Permission `applications.read_assigned`: admin, mentor · query: `question` · answers 200: `session_id`, `assessment_id`, `assessment_title`, `status`, `is_preview`, `candidate`, `started_at`, `deadline_at`, `submitted_at`, `duration_ms`, `questions`, `question_id`, `events`, `snapshots` and 4 more
- `GET /api/v1/sessions/{session_id}/integrity` Session Integrity · Permission `applications.read_assigned`: admin, mentor · answers 200: `session_id`, `assessment_id`, `session_status`, `computed`, `score`, `level`, `adjusted_score`, `computed_at`, `weights_version`, `coverage`, `flags`, `signals`, `note`, `reviewed_by` and 4 more
- `POST /api/v1/sessions/{session_id}/integrity/review` Review Integrity · Permission `applications.decide`: admin · body (JSON): `flags`, `note` · answers 200: `session_id`, `assessment_id`, `session_status`, `computed`, `score`, `level`, `adjusted_score`, `computed_at`, `weights_version`, `coverage`, `flags`, `signals`, `note`, `reviewed_by` and 4 more
- `POST /api/v1/sessions/{session_id}/integrity/recompute` Recompute Integrity · Permission `applications.decide`: admin · answers 200: `session_id`, `assessment_id`, `session_status`, `computed`, `score`, `level`, `adjusted_score`, `computed_at`, `weights_version`, `coverage`, `flags`, `signals`, `note`, `reviewed_by` and 4 more
- `GET /api/v1/portal/settings/integrity` Get Integrity Weights · Permission `portal.settings`: admin · answers 200: `weights`, `defaults`, `is_default`, `updated_at`
- `PUT /api/v1/portal/settings/integrity` Put Integrity Weights · Permission `portal.settings`: admin · body (JSON): `paste_attempt*`, `large_insert*`, `time_away*`, `fullscreen_exit*`, `multi_monitor*`, `devtools_suspected*`, `typing_speed_outlier*`, `plagiarism*`, `ip_change*`, `screen_share_issue*`, `camera_virtual*`, `camera_frozen*`, `camera_dark*`, `camera_stopped*` · answers 200: `weights`, `defaults`, `is_default`, `updated_at`
- `GET /api/v1/assessments/{assessment_id}/plagiarism` List Plagiarism · Permission `assessments.manage`: admin · query: `question_id`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `threshold`, `store_threshold`, `sessions_total`, `sessions_pending`, `running`, `last_run_at`
- `GET /api/v1/assessments/{assessment_id}/plagiarism/{match_id}` Plagiarism Pair · Permission `assessments.manage`: admin · answers 200: `id`, `question`, `similarity`, `flagged`, `a`, `b`, `computed_at`, `language`, `code_a`, `code_b`
- `POST /api/v1/assessments/{assessment_id}/plagiarism/run` Run Plagiarism · Permission `assessments.manage`: admin · answers 202: `queued`, `assessment_id`
- `GET /api/v1/sessions/{session_id}/frames` Session Frames · Permission `applications.read_assigned`: admin, mentor · query: `kind`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`, `page`, `page_size`, `url_ttl_sec`, `expires_at`
- `GET /api/v1/sessions/{session_id}/frames/timeline` Session Frames Timeline · Permission `applications.read_assigned`: admin, mentor · answers 200: `session_id`, `assessment_id`, `status`, `is_preview`, `started_at`, `submitted_at`, `duration_ms`, `interval_sec`, `purged`, `frames`, `frames_total`, `index_truncated`, `highlights`, `highlights_truncated` and 4 more
- `GET /api/v1/sessions/{session_id}/telemetry` Telemetry State · Permission `applications.own`: admin, mentor, intern, guest · answers 200: `session_id`, `status`, `accepting`, `last_seq`, `t_ms`, `server_now`, `webcam`, `screen`, `snapshot_interval_sec`
- `POST /api/v1/sessions/{session_id}/telemetry` Ingest Telemetry · Permission `applications.own`: admin, mentor, intern, guest · headers: `x-telemetry-token` · body (JSON): `token`, `sent_at`, `events`, `snapshots` · answers 200: `accepted`, `duplicates`, `dropped`, `clamped`, `gap`, `previous_seq`, `last_seq`, `server_now`
- `POST /api/v1/sessions/{session_id}/media/presign` Presign Media · Permission `applications.own`: admin, mentor, intern, guest · body (JSON): `kind*`, `mime_type`, `size_bytes*` · answers 201: `file_id`, `upload_url`, `method`, `headers`, `expires_in`
- `POST /api/v1/sessions/{session_id}/media` Complete Media · Permission `applications.own`: admin, mentor, intern, guest · body (JSON): `file_id*`, `at`, `sent_at` · answers 201: `id`, `kind`, `t_ms`, `created_at`, `url`

### programs

- `GET /api/v1/programs` List Programs · Public: anonymous callers allowed; a signed-in caller is recognised by the access cookie · query: `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `GET /api/v1/programs/manage` Admin List Programs · Permission `programs.manage`: admin · query: `status`, `include_archived`, `q`, `slug`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/programs/manage` Admin Create Program · Permission `programs.manage`: admin · body (JSON): `title*`, `slug`, `summary`, `description_md`, `requirements_md`, `responsibilities_md`, `benefits_md`, `format`, `location`, `is_paid`, `stipend_text`, `status`, `apply_opens_at`, `apply_closes_at` and 7 more · answers 201: `id`, `slug`, `title`, `summary`, `format`, `location`, `is_paid`, `stipend_text`, `status`, `apply_opens_at`, `apply_closes_at`, `starts_at`, `ends_at`, `capacity` and 15 more
- `GET /api/v1/programs/manage/{program_id}` Admin Get Program · Permission `programs.manage`: admin · answers 200: `id`, `slug`, `title`, `summary`, `format`, `location`, `is_paid`, `stipend_text`, `status`, `apply_opens_at`, `apply_closes_at`, `starts_at`, `ends_at`, `capacity` and 15 more
- `DELETE /api/v1/programs/manage/{program_id}` Admin Archive Program · Permission `programs.manage`: admin · answers 200: `ok`
- `PATCH /api/v1/programs/manage/{program_id}` Admin Update Program · Permission `programs.manage`: admin · body (JSON): `title`, `slug`, `summary`, `description_md`, `requirements_md`, `responsibilities_md`, `benefits_md`, `format`, `location`, `is_paid`, `stipend_text`, `status`, `apply_opens_at`, `apply_closes_at` and 7 more · answers 200: `id`, `slug`, `title`, `summary`, `format`, `location`, `is_paid`, `stipend_text`, `status`, `apply_opens_at`, `apply_closes_at`, `starts_at`, `ends_at`, `capacity` and 15 more
- `PUT /api/v1/programs/manage/{program_id}/stages` Admin Put Stages · Permission `programs.manage`: admin · body (JSON): array of `title*`, `description`, `date_text` · answers 200: array of `id`, `position`, `title`, `description`, `date_text`
- `GET /api/v1/programs/{slug}` Get Program · Public: anonymous callers allowed; a signed-in caller is recognised by the access cookie · answers 200: `id`, `slug`, `title`, `summary`, `format`, `location`, `is_paid`, `stipend_text`, `status`, `apply_opens_at`, `apply_closes_at`, `starts_at`, `ends_at`, `capacity` and 8 more

### public-profiles

- `GET /api/v1/users` List Profiles · Public: anonymous callers allowed; a signed-in caller is recognised by the access cookie · query: `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `GET /api/v1/users/{handle}` Get Profile · Public: anonymous callers allowed; a signed-in caller is recognised by the access cookie · answers 200: `handle`, `name`, `avatar_url`, `headline`, `member_since`, `skills`, `practice`, `contests`, `badges`, `indexable`
- `GET /api/v1/me/public-profile` Get Settings · Any signed-in member of the portal (guest or higher) · answers 200: `enabled`, `headline`, `show_name`, `show_avatar`, `show_skills`, `show_practice`, `show_contests`, `show_badges`, `handle`, `visible`, `hidden_globally`, `url_path`
- `PUT /api/v1/me/public-profile` Put Settings · Any signed-in member of the portal (guest or higher) · body (JSON): `enabled`, `headline`, `show_name`, `show_avatar`, `show_skills`, `show_practice`, `show_contests`, `show_badges`, `handle` · answers 200: `enabled`, `headline`, `show_name`, `show_avatar`, `show_skills`, `show_practice`, `show_contests`, `show_badges`, `handle`, `visible`, `hidden_globally`, `url_path`

### question_tools

- `POST /api/v1/question-tools/infer-dataset` Infer Dataset · Permission `questions.manage`: admin, mentor (when the portal setting `mentor_can_author` is on) · body (multipart/form-data): `files*`, `names` · answers 200: `tables`, `error`
- `POST /api/v1/question-tools/sql-hints` Sql Hints Check · Permission `questions.manage`: admin, mentor (when the portal setting `mentor_can_author` is on) · body (JSON): `reference_query`, `hints` · answers 200: `auto`, `effective`
- `POST /api/v1/question-tools/parse-mcq` Parse Mcq · Permission `questions.manage`: admin, mentor (when the portal setting `mentor_can_author` is on) · body (JSON): `text*` · answers 200: `questions`, `errors`
- `POST /api/v1/question-tools/import-mcq` Import Mcq · Permission `questions.manage`: admin, mentor (when the portal setting `mentor_can_author` is on) · body (JSON): `text*`, `usage`, `language` · answers 201: `created`, `ids`
- `POST /api/v1/question-tools/ai-draft` Ai Draft · Permission `questions.manage`: admin, mentor (when the portal setting `mentor_can_author` is on) · body (JSON): `idea*`, `type*`, `difficulty`, `usage` · answers 202: `job_id`
- `POST /api/v1/question-tools/ai-more-tests` Ai More Tests · Permission `questions.manage`: admin, mentor (when the portal setting `mentor_can_author` is on) · body (JSON): `question_id*`, `count` · answers 202: `job_id`
- `POST /api/v1/question-tools/ai-improve` Ai Improve · Permission `questions.manage`: admin, mentor (when the portal setting `mentor_can_author` is on) · body (JSON): `question_id*` · answers 202: `job_id`
- `POST /api/v1/question-tools/ai-mcq` Ai Mcq · Permission `questions.manage`: admin, mentor (when the portal setting `mentor_can_author` is on) · body (JSON): `topic*`, `count`, `difficulty` · answers 202: `job_id`
- `POST /api/v1/question-tools/test-grader` Test Grader · Permission `questions.manage`: admin, mentor (when the portal setting `mentor_can_author` is on) · body (JSON): `question_id*`, `answer*` · answers 202: `job_id`
- `GET /api/v1/question-tools/ai-jobs/{job_id}` Ai Job · Permission `questions.manage`: admin, mentor (when the portal setting `mentor_can_author` is on) · answers 200: `id`, `kind`, `status`, `model`, `result`, `error`

### questions

- `GET /api/v1/questions` List Questions · Permission `questions.manage`: admin, mentor (when the portal setting `mentor_can_author` is on) · query: `type`, `difficulty`, `usage`, `status`, `tag`, `q`, `include_archived`, `language`, `missing_language`, `id`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/questions` Create Question · Permission `questions.manage`: admin, mentor (when the portal setting `mentor_can_author` is on) · body (JSON): `language`, `title*`, `slug`, `statement_md`, `difficulty`, `tags`, `topic`, `usage`, `default_points`, `time_limit_ms`, `memory_limit_mb`, `translations`, `python`, `sql` and 6 more · answers 201: `id`, `type`, `title`, `slug`, `difficulty`, `tags`, `topic`, `usage`, `status`, `version`, `default_points`, `updated_at`, `archived_at`, `stats` and 20 more
- `POST /api/v1/questions/bulk-tag` Bulk Tag · Permission `questions.manage`: admin, mentor (when the portal setting `mentor_can_author` is on) · body (JSON): `ids*`, `add`, `remove` · answers 200: `updated`
- `POST /api/v1/questions/import` Import Questions · Permission `questions.manage`: admin, mentor (when the portal setting `mentor_can_author` is on) · query: `dry_run` · body (multipart/form-data): `file*` · answers 200: `dry_run`, `total`, `created`, `rows`
- `GET /api/v1/questions/import/template` Import Template · Permission `questions.manage`: admin, mentor (when the portal setting `mentor_can_author` is on) · answers 200: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
- `GET /api/v1/questions/export` Export Questions · Permission `questions.manage`: admin, mentor (when the portal setting `mentor_can_author` is on) · query: `ids` · answers 200: application/zip
- `GET /api/v1/questions/tags` List Question Tags · Permission `questions.manage`: admin, mentor (when the portal setting `mentor_can_author` is on) · query: `include_archived` · answers 200: array of `tag`, `count`
- `GET /api/v1/questions/{question_id}` Get Question · Permission `questions.manage`: admin, mentor (when the portal setting `mentor_can_author` is on) · answers 200: `id`, `type`, `title`, `slug`, `difficulty`, `tags`, `topic`, `usage`, `status`, `version`, `default_points`, `updated_at`, `archived_at`, `stats` and 20 more
- `DELETE /api/v1/questions/{question_id}` Archive Question · Permission `questions.manage`: admin, mentor (when the portal setting `mentor_can_author` is on) · answers 200: `ok`
- `PATCH /api/v1/questions/{question_id}` Update Question · Permission `questions.manage`: admin, mentor (when the portal setting `mentor_can_author` is on) · query: `confirm_usage_change` · body (JSON): `language`, `title`, `slug`, `statement_md`, `difficulty`, `tags`, `topic`, `usage`, `default_points`, `time_limit_ms`, `memory_limit_mb`, `translations`, `python`, `sql` and 5 more · answers 200: `id`, `type`, `title`, `slug`, `difficulty`, `tags`, `topic`, `usage`, `status`, `version`, `default_points`, `updated_at`, `archived_at`, `stats` and 20 more
- `POST /api/v1/questions/{question_id}/validate` Validate Question · Permission `questions.manage`: admin, mentor (when the portal setting `mentor_can_author` is on) · answers 200: `ok`, `items`
- `POST /api/v1/questions/{question_id}/status` Set Status · Permission `questions.manage`: admin, mentor (when the portal setting `mentor_can_author` is on) · body (JSON): `status*`, `confirm_usage_change` · answers 200: `id`, `type`, `title`, `slug`, `difficulty`, `tags`, `topic`, `usage`, `status`, `version`, `default_points`, `updated_at`, `archived_at`, `stats` and 20 more
- `POST /api/v1/questions/{question_id}/duplicate` Duplicate Question · Permission `questions.manage`: admin, mentor (when the portal setting `mentor_can_author` is on) · answers 201: `id`, `type`, `title`, `slug`, `difficulty`, `tags`, `topic`, `usage`, `status`, `version`, `default_points`, `updated_at`, `archived_at`, `stats` and 20 more
- `POST /api/v1/questions/{question_id}/generate-expected` Generate Expected · Permission `questions.manage`: admin, mentor (when the portal setting `mentor_can_author` is on) · answers 200: `updated`, `errors`, `tests`
- `POST /api/v1/questions/{question_id}/generate-tests` Generate Tests · Permission `questions.manage`: admin, mentor (when the portal setting `mentor_can_author` is on) · body (JSON): `count` · answers 200: `updated`, `errors`, `tests`
- `POST /api/v1/questions/{question_id}/sql/add-variant` Add Sql Variant · Permission `questions.manage`: admin, mentor (when the portal setting `mentor_can_author` is on) · body (JSON): `mutations` · answers 201: `id`, `position`, `input`, `expected_output`, `is_hidden`, `weight`, `note`, `mutations`, `differs_from_main`, `attempts`
- `GET /api/v1/questions/{question_id}/preview` Preview Question · Permission `questions.manage`: admin, mentor (when the portal setting `mentor_can_author` is on) · answers 200: `id`, `type`, `title`, `statement_md`, `difficulty`, `time_limit_ms`, `memory_limit_mb`, `language`, `translations`, `python_mode`, `function_signature`, `starter_code`, `visible_tests`, `hidden_tests_count` and 9 more

### sessions

- `GET /api/v1/assessment/invites/{token}` Invite Landing · Permission `applications.own`: admin, mentor, intern, guest · answers 200: `program_title`, `assessment_title`, `instructions_md`, `duration_minutes`, `sections`, `total_questions`, `rules`, `required_consents`, `optional_consents`, `consent_version`, `valid_from`, `valid_until`, `status`, `session_id` and 5 more
- `POST /api/v1/assessment/invites/{token}/start` Start Assessment · Permission `applications.own`: admin, mentor, intern, guest · body (JSON): `device_check`, `consents` · answers 200: `id`, `status`, `is_preview`, `assessment`, `started_at`, `deadline_at`, `submitted_at`, `server_now`, `remaining_ms`, `sections`, `questions`, `telemetry_token`, `auto_score`, `timed_sections` and 4 more
- `POST /api/v1/applications/{application_id}/assessment-link` Regenerate Assessment Link · Permission `applications.own`: admin, mentor, intern, guest · answers 200: `url`, `valid_until`
- `GET /api/v1/sessions/{session_id}` Get Session · Permission `applications.own`: admin, mentor, intern, guest · answers 200: `id`, `status`, `is_preview`, `assessment`, `started_at`, `deadline_at`, `submitted_at`, `server_now`, `remaining_ms`, `sections`, `questions`, `telemetry_token`, `auto_score`, `timed_sections` and 4 more
- `GET /api/v1/sessions/{session_id}/time` Get Session Time · Permission `applications.own`: admin, mentor, intern, guest · answers 200: `status`, `server_now`, `deadline_at`, `remaining_ms`, `section_id`, `section_deadline_at`, `section_remaining_ms`
- `PUT /api/v1/sessions/{session_id}/questions/{session_question_id}/answer` Save Answer · Permission `applications.own`: admin, mentor, intern, guest · body (JSON): `selected_option_ids`, `text`, `code`, `rev` · answers 200: `session_question_id`, `status`, `saved_at`, `word_count`, `word_limit_ok`, `seq`, `rev`, `stale`
- `POST /api/v1/sessions/{session_id}/questions/{session_question_id}/run` Run Code · Permission `applications.own`: admin, mentor, intern, guest · headers: `Idempotency-Key` · body (JSON): `code*`, `rev` · answers 200: `submission_id`, `verdict`, `tests_passed`, `tests_total`, `compile_error`, `message`, `error`, `tests`, `runs_count`, `runs_left`
- `POST /api/v1/sessions/{session_id}/questions/{session_question_id}/submit` Submit Code · Permission `applications.own`: admin, mentor, intern, guest · headers: `Idempotency-Key` · body (JSON): `code*`, `rev` · answers 200: `submission_id`, `verdict`, `tests_passed`, `tests_total`, `compile_error`, `message`, `error`, `visible`, `hidden`, `status`
- `POST /api/v1/sessions/{session_id}/pitch` Upload Pitch · Permission `applications.own`: admin, mentor, intern, guest · body (JSON): `file_id*`, `duration_sec*`, `session_question_id` · answers 201: `id`, `session_question_id`, `attempt`, `attempts_left`, `status`, `duration_sec`, `created_at`, `file_id`
- `POST /api/v1/sessions/{session_id}/sections/{section_id}/finish` Finish Section · Permission `applications.own`: admin, mentor, intern, guest · answers 200: `id`, `status`, `is_preview`, `assessment`, `started_at`, `deadline_at`, `submitted_at`, `server_now`, `remaining_ms`, `sections`, `questions`, `telemetry_token`, `auto_score`, `timed_sections` and 4 more
- `POST /api/v1/sessions/{session_id}/finish` Finish Session · Permission `applications.own`: admin, mentor, intern, guest · answers 200: `id`, `status`, `submitted_at`, `show_score`, `auto_score`

### set_links

- `GET /api/v1/me/set-attempts` My Set Attempts · Permission `applications.own`: admin, mentor, intern, guest · query: `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `GET /api/v1/set-links/{code}` Set Link · Public: anonymous callers allowed; a signed-in caller is recognised by the access cookie · query: `invite` · answers 200: `title`, `description_md`, `form_fields`, `assessment`, `opens_at`, `closes_at`, `status`, `show_result`, `me`
- `POST /api/v1/set-links/{code}/start` Start Set · Permission `applications.own`: admin, mentor, intern, guest · body (JSON): `answers`, `personal_data_consent`, `consents`, `device_check`, `invite_token` · answers 200: `application_id`, `session_id`, `session_url`, `started`
- `GET /api/v1/set-links/{code}/result` My Set Result · Permission `applications.own`: admin, mentor, intern, guest · answers 200: `visible`, `reason`, `score`, `max_score`, `sections`, `feedback`

### sets

- `GET /api/v1/sets` List Sets · Permission `programs.manage`: admin · query: `status`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/sets` Create Set · Permission `programs.manage`: admin · body (JSON): `title*`, `description_md`, `assessment_id*`, `form_fields`, `show_result`, `show_feedback`, `opens_at`, `closes_at` · answers 201: `id`, `code`, `url`, `title`, `description_md`, `assessment_id`, `form_fields`, `show_result`, `show_feedback`, `opens_at`, `closes_at`, `status`, `participants_count`, `completed_count` and 3 more
- `GET /api/v1/sets/{set_id}` Get Set · Permission `programs.manage`: admin · answers 200: `id`, `code`, `url`, `title`, `description_md`, `assessment_id`, `form_fields`, `show_result`, `show_feedback`, `opens_at`, `closes_at`, `status`, `participants_count`, `completed_count` and 3 more
- `PATCH /api/v1/sets/{set_id}` Update Set · Permission `programs.manage`: admin · body (JSON): `title`, `description_md`, `assessment_id`, `form_fields`, `show_result`, `show_feedback`, `opens_at`, `closes_at` · answers 200: `id`, `code`, `url`, `title`, `description_md`, `assessment_id`, `form_fields`, `show_result`, `show_feedback`, `opens_at`, `closes_at`, `status`, `participants_count`, `completed_count` and 3 more
- `POST /api/v1/sets/{set_id}/archive` Archive Set · Permission `programs.manage`: admin · answers 200: `id`, `code`, `url`, `title`, `description_md`, `assessment_id`, `form_fields`, `show_result`, `show_feedback`, `opens_at`, `closes_at`, `status`, `participants_count`, `completed_count` and 3 more
- `GET /api/v1/sets/{set_id}/results` Set Results · Permission `applications.read_all`: admin · query: `q`, `state`, `sort`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/sets/{set_id}/results/{application_id}/release` Release Result · Permission `programs.manage`: admin · answers 200: `application_id`, `user`, `state`, `score`, `max_score`, `sections`, `ai_feedback`, `candidate_feedback`, `started_at`, `submitted_at`, `result_released`, `feedback_after_release`, `session_id`, `integrity_score` and 1 more

### settings

- `GET /api/v1/portal/settings/ai` Get Ai Config · Permission `portal.settings`: admin · answers 200: `enabled`, `provider`, `model`, `grading_model`, `providers`, `env_default_provider`, `monthly_budget_usd`
- `PUT /api/v1/portal/settings/ai` Put Ai Config · Permission `portal.settings`: admin · body (JSON): `enabled`, `provider`, `model`, `grading_model`, `monthly_budget_usd` · answers 200: `enabled`, `provider`, `model`, `grading_model`, `providers`, `env_default_provider`, `monthly_budget_usd`

### talent

- `GET /api/v1/talent/search` Search · Permission `talent_pool.manage`: admin · query: `q`, `skill`, `min_skill_level`, `min_score`, `min_rating`, `min_solved`, `active_days`, `min_hours`, `role`, `in_pool`, `sort`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `GET /api/v1/talent-pool` List Entries · Permission `talent_pool.manage`: admin · query: `q`, `source`, `status`, `shortlist`, `min_rating`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/talent-pool` Add Entries · Permission `talent_pool.manage`: admin · body (JSON): `user_ids*`, `tags`, `note` · answers 201: `added`, `updated`
- `GET /api/v1/talent-pool/shortlists` Shortlists · Permission `talent_pool.manage`: admin · query: `q`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `DELETE /api/v1/talent-pool/shortlists/{name}` Delete Shortlist · Permission `talent_pool.manage`: admin · answers 200: `ok`
- `PATCH /api/v1/talent-pool/shortlists/{name}` Rename Shortlist · Permission `talent_pool.manage`: admin · body (JSON): `name*` · answers 200: `ok`
- `POST /api/v1/talent-pool/bulk` Bulk · Permission `talent_pool.manage`: admin · body (JSON): `user_ids*`, `action*`, `shortlist`, `status` · answers 200: `affected`, `created`
- `GET /api/v1/talent-pool/programs` Invite Programs · Permission `talent_pool.manage`: admin · query: `q`, `cursor`, `limit`, `page`, `page_size` · answers 200: `items`, `next_cursor`, `total`
- `POST /api/v1/talent-pool/invite` Invite · Permission `talent_pool.manage`: admin · body (JSON): `user_ids*`, `program_id*`, `message` · answers 200: `invited`, `skipped`, `drafts`
- `GET /api/v1/talent-pool/export` Export · Permission `exports.run`: admin · query: `q`, `source`, `status`, `shortlist`, `min_rating` · answers 200: text/csv
- `GET /api/v1/talent-pool/{entry_id}` Get Entry · Permission `talent_pool.manage`: admin · answers 200: `id`, `user`, `source`, `source_id`, `source_label`, `tags`, `note`, `status`, `invited_program`, `created_by_name`, `created_at`, `updated_at`, `rating`, `practice_solved` and 2 more
- `DELETE /api/v1/talent-pool/{entry_id}` Delete Entry · Permission `talent_pool.manage`: admin · answers 200: `ok`
- `PATCH /api/v1/talent-pool/{entry_id}` Update Entry · Permission `talent_pool.manage`: admin · body (JSON): `status`, `tags`, `note` · answers 200: `id`, `user`, `source`, `source_id`, `source_label`, `tags`, `note`, `status`, `invited_program`, `created_by_name`, `created_at`, `updated_at`, `rating`, `practice_solved` and 2 more

<!-- endpoint-index:end -->
