Skip to content

Jobs API contract

Paths below are relative to /api/v1/jobs. Successful data is inside the standard data envelope; DELETE returns 204 with no body. Missing resources and another user's UUID return 404, conflicting duplicates or protected deletes return 409, and invalid requests return 422. JSON dates are YYYY-MM-DD, times are HH:MM:SS and timestamps have an offset. Unless stated otherwise, omitted write fields are unchanged. A judgement replaces its complete set of values instead.

Shared response shapes

  • Flag: uuid, name, looks_for, kind (good/issue), icon, colour (0–7), position, builtin (null or skills_gap/level_unclear/would_move_first).
  • Finding: flag (Flag), why, found_at, source (role/company).
  • Correction: uuid, text, said_on.
  • Profile: headline, summary, places (ordered {name,note} array), pay_now, pay_floor, pay_currency, looking (picky/open/need_job, default open), watch_chat_session (nullable chat UUID), about_md, corrections (newest said_on first). Amounts and currency begin null.
  • Company: uuid, name, website, summary, research_md, fit_level, notes, careers_url, place, work_mode, does, people, money, careers_note, careers_checked_on, shelf, shelf_why, sector, rule_uuid (nullable), rule (Rule or null), unread, judged_at, findings, not_found (Flag array), job_count. A nested Company has job_count 0; company list/detail calculate it.
  • RoleCard: uuid, title, company_name, company_uuid, location, location_fit, location_note, level, work_mode, role, fit_score, assessed_by, deadline_date, posted_on, first_seen_on, last_seen_on, pay_min, pay_max, pay_currency, pay_note, judged_at, company_judged_at, findings (both sources, issues first, then flag position), not_found (role's missing good signs after inherited findings), company_not_found, unread, standing, pass_reason, stage, closed_reason, applied_on, stage_changed_at, next_action, next_action_due, next_action_time.
  • Assessment: fit_score, summary, why_good, why_bad, concerns, questions_md, details_md, score_breakdown (string→integer), assessed_by, assessed_at. Old fields stay readable. A new judgement clears why_good, why_bad, concerns, details_md and score_breakdown.
  • Application: uuid, stage, closed_reason, applied_on, stage_changed_at, next_action, next_action_due, next_action_time, materials_md, pass_reason.
  • Event: uuid, at, kind, body, restorable, from_stage, to_stage, from_closed_reason, to_closed_reason, undone. Event kinds remain stage, close, reopen, done, snooze, undo (historical), interview, outreach, call, note.
  • RoleDetail: RoleCard plus url, source (manual/chat), description_md, notes, company (Company), assessment (Assessment or null), application (Application or null), events (up to 100, newest first), done_available.
  • ActionResult: job (RoleDetail), event_uuid, label.
  • CompanyDetail: Company plus jobs (RoleCard array), calculated job_count.
  • CompanyRoles: company (Company), roles (RoleCard array), role_total.
  • CompanyTotals: all, undecided, watch, good_role, need_job, not_for_me. Counts are global to the user and unaffected by filters.
  • Rule: uuid, name (up to 80 characters), looks_for (matching sentence), kind (never/not_my_kind/need_job), position, created_at, updated_at, caught_count (number of companies referencing it, including undecided matches). The nested rule on a company uses caught_count 0; /rules calculates counts.
  • Figures: from_date, to_date, to_decide, going_for, sent, in_talks, closed, all_closed_passed, total.
  • Page: page (zero-based), page_size, page_items (T array), total.
  • Facet: value, count; a company facet on the role list uses uuid, name, count instead.

standing is to_decide with no application, going_for for shortlisted, sent for applied, in_talks for screening/interviewing/offer, passed for dismissed, closed for any other closure. stage stays shortlisted/applied/screening/interviewing/ offer or null; closed_reason stays dismissed/rejected_by_them/withdrew/declined/ posting_closed/accepted or null. Closed reason takes precedence over stage. level is junior/mid/senior/staff/principal/lead, work_mode is remote/hybrid/ onsite, location_fit is eligible/likely/uncertain/not_eligible; all are nullable.

Roles and workflow routes

Method and path Request → data response
GET /health No arguments → {status:"healthy",service:"loryth-jobs"}; public.
GET /jobs Query status pending/applied/passed (default pending), q, repeated level, work_mode, role, company UUID, show_not_eligible, show_past_deadline, show_older (false), url, date (local today), tz (UTC), page (0), size (50, max 100) → {page:Page<RoleCard>,counts:{pending,applied,passed},hidden:{not_eligible,past_deadline,older},facets:{status,level,work_mode,role,company},seen_cutoff}. URL lookup spans every status and hidden group.
POST /jobs Required company_name, title; optional url, location, deadline_date, role, level, work_mode, description_md, source (manual), start_as pending/shortlisted/applied (pending), on, tz (UTC) → RoleDetail, 201. Canonical URL duplicate → 409 {detail:{code:"already_tracked",job_uuid}}.
GET /jobs/{uuid} UUID → RoleDetail.
PATCH /jobs/{uuid} Any subset of title, company_name, url, location, location_fit, location_note, role, level, work_mode, deadline_date, notes, description_md → RoleDetail.
DELETE /jobs/{uuid} UUID → 204. Company remains saved.
PUT /jobs/{uuid}/judgement fit_score (0–10 or null), summary, questions_md, pay_min, pay_max, pay_currency, pay_note, location_fit, location_note, findings:[{flag_uuid,why}], unread → RoleDetail. All fields optional; omitted scalar values clear to null and findings clear to empty. Stamps judged_at and assessment.assessed_at, sets assessed_by chat.
POST /jobs/{uuid}/stage Required to_stage, on; tz (UTC) → ActionResult.
POST /jobs/{uuid}/dismiss Required on; optional tz (UTC), pass_reason → ActionResult.
POST /jobs/{uuid}/close Required reason (closed_reason except dismissed), on; optional tz (UTC), pass_reason → ActionResult.
POST /jobs/{uuid}/reopen Required on; optional tz (UTC) → ActionResult.
PATCH /jobs/{uuid}/application Any subset of applied_on, next_action, next_action_due, next_action_time, materials_md, pass_reason → Application. An application must already exist. A live application past shortlisted requires a next_action_due.
POST /jobs/{uuid}/events Required kind (outreach/call/interview/note), at (day); optional body (empty), tz (UTC) → Event.
POST /jobs/{uuid}/next-action/done Required date; optional tz (UTC) → ActionResult.
POST /jobs/{uuid}/next-action/snooze Required date; optional tz (UTC) → ActionResult.

Pay values are nullable nonnegative whole yearly amounts; pay_min ≤ pay_max when both exist. Currencies use three uppercase letters. Findings require one of the user's flag UUIDs, a nonempty why (max 300), and no duplicate flag. There is no assessment write or undo route. Unused role/application fields are rejected, including priority, tags, deadline_note, channel, cv_label and contacts.

Profile and flag routes

Method and path Request → data response
GET /profile No arguments → Profile, empty defaults when no profile row exists.
PUT /profile Any subset of headline, summary, places:[{name,note}], pay_now, pay_floor, pay_currency, looking, watch_chat_session, about_md → Profile. Lists replace as a whole; nullable pay values can be cleared.
POST /profile/corrections Required text, said_on → Correction, 201.
DELETE /profile/corrections/{uuid} UUID → 204.
GET /flags No arguments → Flag array. Creates missing built-in issues on the first read; issues first, then good signs, each in position order.
POST /flags Required name, looks_for, kind; optional icon (icon:sparkles), colour (0), position (appends within kind) → Flag, 201. Names are unique ignoring case.
PATCH /flags/{uuid} Any subset of name, looks_for, kind, icon, colour, position → Flag. Fields cannot be null. Built-ins reject changes to kind or looks_for.
DELETE /flags/{uuid} UUID → 204, removes its findings; built-ins return 409.
PUT /flags/order Required uuids array containing every flag UUID once in desired order → Flag array in that order. GET still groups issues before good signs.

Icons are canonical refs: icon:<lucide-name>, emoji:<lowercase-hex> or custom:<uuid>, normalized by the shared icon helper and limited to 80 characters. Colours are required categorical palette slots 0–7. The three builtin keys identify the protected issues even after renaming. Nothing is seeded by company, role or profile reads/writes.

Company rules

Method and path Request → data response
GET /rules No arguments → Rule array in position order, with caught_count.
POST /rules Required name, looks_for (up to 1000 characters), kind; optional position (appends by default) → Rule, 201. Names are unique per user ignoring case.
PATCH /rules/{uuid} Any subset of name, looks_for, kind, position → Rule. Fields cannot be null. Does not move existing companies.
DELETE /rules/{uuid} UUID → 204. Clears references from companies, preserving their shelves and reasons.
PUT /rules/order Required uuids, every rule UUID once in desired order → Rule array with new positions.

Never and not_my_kind rules map to not_for_me; need_job rules map to need_job. Creating a rule does not move existing companies. A judgement can record a match without applying it; undecided matches are available for Needs you in Companies. Single decisions have no rule UUID. Changing looking does not relax never or not_my_kind rules.

Company routes

Method and path Request → data response
GET /companies Query q, repeated place, work_mode, shelf, sector, page (0), size (50, max 50) → {page:Page<CompanyRow>,facets:{place,work_mode,shelf,sector},totals:CompanyTotals}. CompanyRow is Company plus counts (one count per standing), calculated job_count.
POST /companies Required name; any CompanyPatch fields below → CompanyDetail, 201. Reuses the user's company with the same slug and changes only supplied fields.
GET /companies/{uuid} UUID → CompanyDetail.
PATCH /companies/{uuid} Any subset of CompanyPatch → CompanyDetail.
DELETE /companies/{uuid} UUID → 204; returns 409 if any roles remain.
PUT /companies/shelf Required company_uuids (1–1000 distinct UUIDs), shelf; optional why, rule_uuid → {companies:Company[],totals:CompanyTotals}. One atomic write; unknown/private UUIDs fail the whole call. A supplied rule must map to the requested shelf. Omitted why and rule clear previous values. Never changes findings, unread or judged_at.
PUT /companies/{uuid}/judgement Optional findings:[{flag_uuid,why}], rule_uuid, shelf_why, apply_rule (true), unread → CompanyDetail. Replaces findings and unread; stamps judged_at. A supplied rule sets the match and reason, and applies its shelf unless apply_rule=false. No rule clears the match and leaves shelf and reason unchanged.
PUT /companies/{uuid}/logo Raw PNG or WebP body, Content-Type image/png or image/webp; optional X-Source-Url → 204. At most 64 KiB and 64 pixels per side. Oversize body → 413; invalid media, decoding or dimensions → 422. Jobs never fetches a URL.
GET /companies/{uuid}/logo Private cached image bytes, original media type, nosniff; 404 when missing or another user's company.

CompanyPatch: name, website, summary, research_md, notes, careers_url, place, work_mode, does, people, money, careers_note, careers_checked_on, sector (free text, up to 80 characters), shelf, shelf_why, rule_uuid. Name, notes and shelf cannot be null. Findings, judged_at and unread change only via judgement. Existing fit_level stays readable. A supplied shelf clears a previous rule and reason unless explicitly supplied in the same patch. A supplied rule with a shelf must map to that shelf. Use the bulk shelf route for decisions, including one-company moves.

Shelf values: undecided (To look at, default), watch (Watching), good_role (If a role fits), need_job (If I need a job), not_for_me (Not for me). Company q matches name, place, does and sector, ignoring case. OR within each repeated filter; AND between filters. Facets count with their own filter omitted while retaining q and the other filters. Totals always count the full catalogue. The former state filter and ruled-out/never fields are removed without aliases.

Migration v07 carries ruled-out reasons to not_for_me and shelf_why, turns each profile never entry into a never rule, maps company never_item by its matching sentence and user, and removes the old columns. Legacy never entries longer than 80 characters retain their full looks_for sentence and use a shortened name with a stable hash suffix. Judgements and findings are preserved.

Screen reads

Method and path Request → data response
GET /today Optional query date (local today), tz (UTC) → Today below.
GET /overview Required query date; optional tz (UTC) → {today:Today,figures:Figures,to_decide:CompanyRoles[],to_decide_company_total,to_decide_role_total,not_judged_count,going_for:RoleCard[],companies:CompanyTotals,profile:Profile}.
GET /roles/figures Required query date; optional tz (UTC) → Figures.
GET /roles No arguments → {groups:[{standing,roles:RoleCard[],total}],total}. Includes all six standings, even empty ones.
GET /find Required query q, date; optional tz (UTC), limit (20, max 50 groups), roles_per_company (50, max 100) → {companies:CompanyRoles[],company_total,role_total}. Totals are before either cap.

Today: due:[{job:RoleCard,overdue_days,is_appointment,done_available}], due_more, ghosted_count, closing:RoleCard[], closing_more, next_to_apply:RoleCard[], next_more, totals:{jobs,inbox,inbox_hidden,shortlist}, week:{applied,outreach,calls,interviews}. Each list caps at five. Due includes steps due or late and timed appointments through the caller's week's Sunday. Closing uses deadlines from today through seven days later. Quiet applications have spent strictly more than 21 local days in applied/screening/interviewing.

Overview returns to-decide company groups in best pending-role fit order. Not-for-me companies are excluded; need_job companies join the other groups only while profile.looking is need_job. The Companies tile always counts all five actual shelves, without moving companies when looking changes. Within each group, pending roles come first in fit order, then the company's other open roles in fit order. Closed roles are excluded from these groups. to_decide_role_total counts only pending roles, while each group's role_total includes its folded open roles. not_judged_count counts live roles with null judged_at. Going-for roles are sorted by fit. The phone can show three groups and link to the full list; desktop can show every group from the same read.

Figures use the 30 inclusive local dates from date−29 through date. Live roles found on or before date count even if older. Closed roles count only when their current closure is inside that window and its reason is not accepted. Each role counts once, where it stands now. Passed and other eligible closures are combined in closed. all_closed_passed is true when no counted closure has a reason other than dismissed, including an empty closed group.

Find matches company name/place/does and role title/location/standing words, ignoring case. A company name match includes all its roles; otherwise only matching roles appear. Company place/does matches can return a group with no matching roles. Groups with roles come first, late steps before others, then best fit, then company name; groups without matching roles come last. Every role status is searched, including passed, rejected and accepted. Within each group roles sort by fit, deadline, then newest insertion. Find and overview do not apply the old pending hidden-group rules.