Files
lincodex/api/core/openapi.bundle.yml
T

1954 lines
91 KiB
YAML

openapi: 3.2.0
info:
title: Lincodex API
version: 0.1.0
servers:
- url: /
security:
- sessionCookie: []
tags:
- name: health
description: Liveness of the API process.
- name: identity
description: Registration, email verification, login, logout, and the current account. Sessions are server-side and travel in an HttpOnly cookie; mutating requests that require a session also carry a CSRF token.
- name: catalog
description: 'Public reference data: directions, specializations with their assessment availability, and the grade scale.'
- name: candidate
description: Data of the current candidate, such as the questionnaire with the chosen specializations and self-assessed grades. Confirmed grades and categories come only from assessment results.
paths:
/api/v1/healthz:
get:
operationId: GetHealthz
summary: Check whether the API process is responding.
security: []
tags:
- health
responses:
'200':
description: The API process is responding.
content:
application/json:
schema:
$ref: '#/components/schemas/HealthResponse'
examples:
ok:
summary: The process is responding
value:
status: ok
default:
$ref: '#/components/responses/Problem'
/api/v1/identity/consent-texts/{purpose}:
get:
operationId: GetConsentText
summary: Read the currently published text of a registration consent.
description: Public operation without a session. Returns the current text of a consent that is given before an account exists; only `c1` is available. The registration page shows this text and sends its `text_version` with RegisterAccount, and the server hashes the same stored text when it records the acceptance. If the text changes while the page is open, RegisterAccount answers 400 validation_failed with the pointer `/consent_c1/text_version`, and the page reads the text again. An unknown purpose fails parameter validation with 400.
security: []
tags:
- identity
parameters:
- name: purpose
in: path
required: true
description: Consent whose text is requested.
schema:
$ref: '#/components/schemas/ConsentPurpose'
responses:
'200':
description: The current consent text.
content:
application/json:
schema:
$ref: '#/components/schemas/ConsentText'
examples:
c1:
summary: Current C1 text
value:
purpose: c1
text_version: c1-2026-10-01
text: |-
I consent to the processing of my personal data for registration and the use of the service.
The full text is published by the operator.
published_at: '2026-10-01T00:00:00Z'
'400':
$ref: '#/components/responses/ValidationFailed'
default:
$ref: '#/components/responses/Problem'
/api/v1/identity/registrations:
post:
operationId: RegisterAccount
summary: Register an account by email with a scenario and consent C1.
description: |-
Public operation without a session. The client reads the current C1 text with GetConsentText and sends the email, the password, the chosen scenario, and consent C1 with the version of the text the user accepted.
The answer is the same 202 whether the email is new, registered but not verified, or verified, so registration does not enumerate accounts:
- New email: the server creates an unverified account with the scenario and the first onboarding step, records C1 with its text version and text hash, stores only the hash of a one-time verification token, and queues the verification message, all in one transaction.
- Registered but not verified: the server treats the request as a new registration of that address. In one transaction it replaces the password hash, the scenario, the onboarding step, and the C1 record, advances the registration version, invalidates every earlier verification token, and queues a message with a new token. A pre-registration with someone else's password therefore never survives the address owner's own registration.
- Verified: nothing changes. The server may queue a rate-limited "you already have an account" notice to the address.
Every verification token is bound to the registration version it was issued for, so a token issued before a re-registration can never confirm the newer credentials. An account that stays unverified is deleted with its consent record and tokens 7 days after its last registration (planned value from configuration). Verification tokens live 24 hours (planned value from configuration).
The response does not depend on the branch in content or timing. Before it looks up the email, the server validates the whole body, including the password bounds after normalization, the password blocklist, and the C1 version, and it computes the Argon2id hash on every branch; a 400 therefore never depends on whether the email exists. Mail is delivered asynchronously from the outbox.
The operation requires Idempotency-Key. For this anonymous operation the key is scoped by the operation, the key, and an HMAC of the normalized email, and the request fingerprint is an HMAC-SHA-256 with a server secret over the canonical JSON body. The server never stores the body, the password, or a plain hash of either; the secret keeps the fingerprint from serving as an offline password check. A retry with the same key, email, and body replays the stored 202 without a second message; the same key and email with a different body answers 422 idempotency_key_reused.
It is rate-limited per client and per email and answers 429 with Retry-After when the limit is reached. Like every unsafe request, it requires an allowed Origin and answers 403 csrf_check_failed otherwise.
security: []
tags:
- identity
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/RegistrationRequest'
examples:
candidate:
summary: Candidate registration
value:
email: candidate@example.com
password: correct horse battery staple
scenario: candidate
consent_c1:
text_version: c1-2026-10-01
accepted: true
responses:
'202':
description: Registration request accepted. If the email can be registered, a verification link is on its way; the response does not say whether it was.
content:
application/json:
schema:
$ref: '#/components/schemas/IdentityRequestAccepted'
examples:
accepted:
summary: Neutral acknowledgement
value:
status: accepted
'400':
$ref: '#/components/responses/RegistrationValidationFailed'
'403':
$ref: '#/components/responses/CsrfCheckFailed'
'409':
$ref: '#/components/responses/IdempotencyInProgress'
'422':
$ref: '#/components/responses/UnprocessableContent'
'429':
$ref: '#/components/responses/TooManyRequests'
default:
$ref: '#/components/responses/Problem'
/api/v1/identity/email-verification-requests:
post:
operationId: ResendEmailVerification
summary: Request a new email verification link.
description: |-
Public operation without a session. The answer is the same 202 for an unknown email, a verified email, and an unverified one, so it does not enumerate accounts. Only for an unverified account does the server issue a new one-time token bound to the current registration version, invalidate every earlier token of that account, and queue the message. Resend never changes the password, the scenario, or the consent record; a user who did not start the pending registration registers again instead, which replaces it.
It is rate-limited per client and per email and answers 429 with Retry-After when the limit is reached. A retry is safe without Idempotency-Key: at worst it replaces the token again within the rate limit. Like every unsafe request, it requires an allowed Origin and answers 403 csrf_check_failed otherwise.
security: []
tags:
- identity
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/EmailVerificationResendRequest'
examples:
resend:
summary: Resend to an address
value:
email: candidate@example.com
responses:
'202':
description: Request accepted. If the address belongs to an unverified account, a new link is on its way; the response does not say whether it was.
content:
application/json:
schema:
$ref: '#/components/schemas/IdentityRequestAccepted'
examples:
accepted:
summary: Neutral acknowledgement
value:
status: accepted
'400':
$ref: '#/components/responses/ValidationFailed'
'403':
$ref: '#/components/responses/CsrfCheckFailed'
'429':
$ref: '#/components/responses/TooManyRequests'
default:
$ref: '#/components/responses/Problem'
/api/v1/identity/email-verifications:
post:
operationId: ConfirmEmail
summary: Verify an email with the one-time token from the link.
description: |-
Public operation without a session. The verification link has the form `<frontend origin>/verify-email#token=<token>`: the token travels in the URL fragment, so it never reaches a server log or a Referer header. The page first removes the fragment with `history.replaceState`, then waits for an explicit user action, such as a Confirm button, before it posts the token here. A link scanner that only fetches the page therefore does not consume the token.
The server looks up the token by its hash and, in one transaction, checks that it is unused, not expired, and bound to the current registration version, marks it used, and marks the email verified. Only one of several parallel requests with the same token succeeds. An expired token answers verification_token_expired; an unknown, used, replaced, or superseded token answers verification_token_invalid; neither changes anything. For both, the client offers a new link and sign-in, because the address may already be verified.
A repeated confirmation with an already used token is not an idempotent 200: exactly one request may succeed for a token, so the outcome of parallel requests stays unambiguous, and the next step after either outcome is sign-in anyway.
Success does not start a session: the link may be opened on another device or by a mail scanner, and a session must come only from the password. The response returns the scenario and the saved onboarding step so the client can continue after sign-in. The operation is rate-limited and requires an allowed Origin.
security: []
tags:
- identity
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/EmailVerificationRequest'
examples:
token:
summary: Token from the link
value:
token: q3Zt9b2Kx7LmP4vR8sW1yC6nD0fH5jA2eG9uI3oT7kE
responses:
'200':
description: The email is verified.
content:
application/json:
schema:
$ref: '#/components/schemas/EmailVerificationResult'
examples:
candidate:
summary: A candidate continues with consents
value:
email_verified: true
scenario: candidate
onboarding_step: candidate_consents
'400':
$ref: '#/components/responses/EmailVerificationFailed'
'403':
$ref: '#/components/responses/CsrfCheckFailed'
'429':
$ref: '#/components/responses/TooManyRequests'
default:
$ref: '#/components/responses/Problem'
/api/v1/identity/sessions:
post:
operationId: Login
summary: Sign in with email and password and start a session.
description: |-
Public operation that starts a server session. The server verifies the password with Argon2id; for an unknown email it verifies against a fixed dummy hash, so the response time does not reveal whether the account exists. An unknown email and a wrong password both answer 401 invalid_credentials.
Correct credentials for an unverified email answer 403 email_not_verified and create no session. This reveals the verification state only to someone who already knows the password, which proves more than the state itself; the client offers to resend the link.
On success the server revokes the session that the request carried, if any, creates a new random session in PostgreSQL with a new identifier and a new CSRF token, sets the HttpOnly session cookie, and returns the account and the CSRF token. The new session follows the idle and absolute timeouts of the sessionCookie scheme. The client keeps the token in memory and sends it in X-CSRF-Token with every mutating request that requires a session.
Login is rate-limited per client and per email and answers 429 with Retry-After. Like every unsafe request, it requires an allowed Origin, which protects against login CSRF, and answers 403 csrf_check_failed otherwise.
security: []
tags:
- identity
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/LoginRequest'
examples:
login:
summary: Email and password
value:
email: candidate@example.com
password: correct horse battery staple
responses:
'201':
description: Session started; the session cookie is set.
headers:
Set-Cookie:
$ref: '#/components/headers/SessionCookieSet'
Cache-Control:
$ref: '#/components/headers/CacheControlNoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/Session'
examples:
candidate:
$ref: '#/components/examples/CandidateSession'
'400':
$ref: '#/components/responses/ValidationFailed'
'401':
$ref: '#/components/responses/InvalidCredentials'
'403':
description: Correct credentials for an unverified email (email_not_verified), or a disallowed Origin (csrf_check_failed). No session was created.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
examples:
email_not_verified:
$ref: '#/components/examples/EmailNotVerified'
csrf_check_failed:
$ref: '#/components/examples/CsrfCheckFailed'
'429':
$ref: '#/components/responses/TooManyRequests'
default:
$ref: '#/components/responses/Problem'
/api/v1/identity/sessions/current:
get:
operationId: GetCurrentSession
summary: Read the current session and its CSRF token.
description: Requires the session cookie. Returns the account and the CSRF token of the current session, so the client can restore the token after a page reload or after 403 csrf_check_failed. A missing, unknown, expired, or revoked session answers 401 unauthenticated. Cross-origin pages cannot read the token, because the API sends no Access-Control-Allow-Origin header.
security:
- sessionCookie: []
tags:
- identity
responses:
'200':
description: The current session.
headers:
Cache-Control:
$ref: '#/components/headers/CacheControlNoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/Session'
examples:
candidate:
$ref: '#/components/examples/CandidateSession'
'401':
$ref: '#/components/responses/Unauthenticated'
default:
$ref: '#/components/responses/Problem'
delete:
operationId: Logout
summary: Sign out and revoke the current session.
description: Requires the session cookie and the CSRF token of that session in X-CSRF-Token, and an allowed Origin. The server revokes the session in PostgreSQL, so the cookie value stops working even if a copy remains, and clears the cookie. A missing, expired, or revoked session answers 401 unauthenticated and also clears the cookie, so a stale cookie does not stay in the browser; a missing or wrong CSRF token or a disallowed Origin answers 403 csrf_check_failed and keeps the session and the cookie. The client clears its private query cache after the response.
security:
- sessionCookie: []
sessionCsrf: []
tags:
- identity
responses:
'204':
description: The session is revoked and the cookie is cleared.
headers:
Set-Cookie:
$ref: '#/components/headers/SessionCookieCleared'
'401':
description: No valid session; code unauthenticated. The cookie is cleared as well.
headers:
Set-Cookie:
$ref: '#/components/headers/SessionCookieCleared'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
examples:
unauthenticated:
$ref: '#/components/examples/Unauthenticated'
'403':
$ref: '#/components/responses/CsrfCheckFailed'
default:
$ref: '#/components/responses/Problem'
/api/v1/identity/me:
get:
operationId: GetCurrentAccount
summary: Read the account of the current session.
description: Requires the session cookie. The account comes from the session, never from a request parameter. The client uses `scenario` and `onboarding_step` to return the user to the unfinished onboarding step. A missing, unknown, expired, or revoked session answers 401 unauthenticated. An unverified account never has a session, because login answers 403 email_not_verified for it, so this operation also answers 401 for such an account.
security:
- sessionCookie: []
tags:
- identity
responses:
'200':
description: The current account.
headers:
Cache-Control:
$ref: '#/components/headers/CacheControlNoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/Account'
examples:
candidate:
$ref: '#/components/examples/CandidateAccount'
'401':
$ref: '#/components/responses/Unauthenticated'
default:
$ref: '#/components/responses/Problem'
/api/v1/specializations:
get:
operationId: GetSpecializationCatalog
summary: Read the catalog of directions, specializations, and grades.
description: |-
Public operation without a session. Returns the directions with their specializations, the assessment availability of each specialization, and the grade scale. The candidate picks specializations and self-assessed grades from this catalog for the questionnaire, and the client joins the codes stored in the questionnaire with the titles here.
The catalog is public because it is the same for every caller and contains no personal data: the product shows it before registration, and a public read lets intermediaries and the browser cache it. It reveals nothing beyond what the landing pages already show.
A category is a specialization together with a confirmed grade. Task languages and the stack are attributes of a chosen specialization and never appear as categories. `test_availability` is derived from the published task banks at the time of the request, so it changes when a bank is published, without a contract change: the MVP opens an assessment only for a category with a published bank, and every other specialization is marked `in_development`. Presence in the catalog never means that its test is ready.
security: []
tags:
- catalog
responses:
'200':
description: The catalog.
content:
application/json:
schema:
$ref: '#/components/schemas/SpecializationCatalog'
examples:
mvp:
$ref: '#/components/examples/SpecializationCatalog'
default:
$ref: '#/components/responses/Problem'
/api/v1/me/questionnaire:
get:
operationId: GetMyQuestionnaire
summary: Read the questionnaire of the current candidate.
description: |-
Requires the session cookie of a candidate account. The candidate comes from the session, never from a request parameter. A candidate who has not saved the questionnaire yet gets 200 with version 0 and no specializations rather than 404, so the client reads the version for the first save in the same way as for later ones and a missing questionnaire is not an error state.
The response never contains a confirmed grade or a category; those come only from assessment results. A missing, unknown, expired, or revoked session answers 401 unauthenticated; an employer account answers 403 forbidden.
security:
- sessionCookie: []
tags:
- candidate
responses:
'200':
description: The questionnaire of the current candidate.
headers:
Cache-Control:
$ref: '#/components/headers/CacheControlNoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/CandidateQuestionnaire'
examples:
new_candidate:
$ref: '#/components/examples/NewCandidateQuestionnaire'
backend_go_and_network_engineer:
$ref: '#/components/examples/BackendGoAndNetworkEngineerQuestionnaire'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/Forbidden'
default:
$ref: '#/components/responses/Problem'
put:
operationId: SaveMyQuestionnaire
summary: Replace the questionnaire of the current candidate.
description: |-
Requires the session cookie of a candidate account, the CSRF token of that session in X-CSRF-Token, and an allowed Origin. The body is the complete new state: one or two specializations, each with a self-assessed grade, task languages, stack tags, and stated experience or null, and the working context. It replaces the stored questionnaire as a whole.
Self-assessment is a claim. It influences where the assessment starts and which grade the assessment step offers first, but it adds no points and never writes a confirmed grade or a category: a self-assessed `senior`, or the word "Senior" in a stack tag, never assigns the Senior category. A real profile stays invisible to employers until an assessment confirms a category. Choosing a specialization whose test is `in_development` is allowed; no assessment starts for it until its bank is published. Removing a specialization from the questionnaire does not change assessment results.
Optimistic concurrency uses `expected_version` in the body: the client sends the `version` it read, 0 for the first save. If it is not the current version, the server answers 412 version_conflict and changes nothing; the client reads the questionnaire again. The version travels in the body rather than in If-Match because the generated client cannot read the ETag response header yet. The status and code are the same as for a failed If-Match, since the client action is the same.
The operation needs no Idempotency-Key: it replaces the whole state and is idempotent. A body whose specializations and working context equal the stored ones changes nothing, keeps the version, and answers 200 with the current questionnaire even when `expected_version` is older, so a retry after a lost response of a successful save succeeds instead of failing with 412.
Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation (400), account scenario (403 forbidden for an employer), domain rules (400), then the version (412). The schema rejects more than two specializations, an unknown grade, specialization, or task language, and unknown fields. The server also rejects a repeated specialization and a task language that the specialization's published bank does not offer, with 400 validation_failed and pointers to the items, for example `/specializations/1/specialization` or `/specializations/0/task_languages/0`.
A successful save on the onboarding step candidate_questionnaire advances the account to candidate_assessment (planned).
security:
- sessionCookie: []
sessionCsrf: []
tags:
- candidate
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CandidateQuestionnaireUpdate'
examples:
backend_go_and_network_engineer:
$ref: '#/components/examples/BackendGoAndNetworkEngineerQuestionnaireUpdate'
responses:
'200':
description: The saved questionnaire with its new version.
headers:
Cache-Control:
$ref: '#/components/headers/CacheControlNoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/CandidateQuestionnaire'
examples:
backend_go_and_network_engineer:
$ref: '#/components/examples/BackendGoAndNetworkEngineerQuestionnaire'
'400':
$ref: '#/components/responses/QuestionnaireValidationFailed'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/CsrfCheckFailedOrForbidden'
'412':
$ref: '#/components/responses/QuestionnaireVersionConflict'
default:
$ref: '#/components/responses/Problem'
components:
schemas:
Problem:
type: object
description: Problem details (RFC 9457) returned with the application/problem+json media type for every error response. `code` is the stable, machine-readable reason; clients branch on it rather than on `title`, `detail`, or the HTTP status alone. The body never contains internal error text, stack traces, SQL, file paths, credentials, contact data, or echoed request values.
additionalProperties: false
required:
- type
- title
- status
- code
properties:
type:
type: string
format: uri-reference
maxLength: 256
description: URI that identifies the problem type. It has the form `urn:lincodex:problem:<code>` and is an identifier, not a link to dereference.
title:
type: string
minLength: 1
maxLength: 200
description: Short, fixed English summary of the problem type. It does not change between occurrences.
status:
type: integer
format: int32
minimum: 400
maximum: 599
description: HTTP status code generated by the origin server.
code:
$ref: '#/components/schemas/ProblemCode'
detail:
type: string
maxLength: 1000
description: Safe English explanation of this occurrence. It never contains internal error text or request values.
instance:
type: string
format: uri-reference
maxLength: 2048
description: URI reference that identifies this occurrence, when one exists.
trace_id:
type: string
minLength: 1
maxLength: 128
pattern: ^[A-Za-z0-9._-]+$
description: Request identifier, equal to the X-Request-ID response header. Quote it when reporting the problem; it is not a secret.
errors:
type: array
maxItems: 100
description: Field-level reasons for validation_failed. Other codes omit it.
items:
$ref: '#/components/schemas/ProblemFieldError'
ProblemCode:
type: string
description: |-
Stable public error code. Adding a code is a contract change; renaming or removing one is a breaking change. Clients must handle an unknown code by its HTTP status.
- validation_failed (400): parameters or body do not match the contract, or a body violates a domain rule such as salary_from <= salary_to; `errors` points at the fields.
- verification_token_invalid (400): the email verification token is unknown, already used, or replaced by a newer one; request a new link or sign in.
- verification_token_expired (400): the email verification token is past its lifetime; request a new link.
- unauthenticated (401): no valid session or credentials.
- invalid_credentials (401): the email and password do not match an account; an unknown email and a wrong password are not distinguished.
- forbidden (403): the caller is authenticated but not allowed.
- email_not_verified (403): the credentials are correct but the email is not verified yet.
- csrf_check_failed (403): the request failed cross-site request protection: a missing or wrong X-CSRF-Token or a disallowed Origin.
- not_found (404): the route or object does not exist or is not visible.
- method_not_allowed (405): the route does not support the method.
- idempotency_in_progress (409): a request with the same Idempotency-Key is still being processed.
- state_conflict (409): the operation conflicts with the current state of the resource, for example an invitation that was already accepted.
- version_conflict (412): If-Match, or an `expected_version` field in the request body, does not match the current version; nothing was changed.
- payload_too_large (413): the request body exceeds the limit.
- unsupported_media_type (415): the request Content-Type is not accepted.
- idempotency_key_reused (422): the Idempotency-Key was already used with a different request.
- precondition_required (428): the operation requires If-Match.
- rate_limited (429): too many requests; see Retry-After.
- internal (500): unexpected server error.
- not_implemented (501): the operation is in the contract but not implemented yet.
enum:
- validation_failed
- verification_token_invalid
- verification_token_expired
- unauthenticated
- invalid_credentials
- forbidden
- email_not_verified
- csrf_check_failed
- not_found
- method_not_allowed
- idempotency_in_progress
- state_conflict
- version_conflict
- payload_too_large
- unsupported_media_type
- idempotency_key_reused
- precondition_required
- rate_limited
- internal
- not_implemented
ProblemFieldError:
type: object
description: One reason why a request field or parameter is invalid.
additionalProperties: false
required:
- in
- pointer
- code
- message
properties:
in:
$ref: '#/components/schemas/ProblemFieldLocation'
pointer:
type: string
maxLength: 1024
pattern: ^(/([^~/]|~[01])*)*$
description: JSON Pointer (RFC 6901). For `body` it points into the request body document, for example `/salary_from`; an empty string means the whole body. For a parameter it is `/` followed by the parameter name, for example `/limit` or `/Idempotency-Key`.
code:
type: string
minLength: 1
maxLength: 64
pattern: ^[a-z][a-z0-9_]*$
description: Stable field reason. Current values are `required` (missing value) and `invalid` (malformed value or a value outside the schema). Clients must tolerate new values.
message:
type: string
minLength: 1
maxLength: 500
description: Fixed English message that never echoes the submitted value.
ProblemFieldLocation:
type: string
description: Part of the request that contains the invalid field.
enum:
- body
- query
- path
- header
- cookie
Timestamp:
type: string
format: date-time
description: UTC instant in RFC 3339 format with the Z suffix, for example 2026-10-05T09:30:00Z. Servers always emit UTC. Every date-time field in this contract uses this schema.
examples:
- '2026-10-05T09:30:00Z'
PageInfo:
type: object
description: Cursor pagination state of a list response. Lists are ordered by a stable server-defined key. To read the next page, repeat the request with the same filters and `cursor` set to `next_cursor`.
additionalProperties: false
required:
- has_more
- next_cursor
properties:
has_more:
type: boolean
description: Whether another page follows this one.
next_cursor:
type:
- string
- 'null'
minLength: 1
maxLength: 512
pattern: ^[A-Za-z0-9_-]+$
description: Opaque cursor of the next page, or null on the last page. Clients must not parse, build, or store it beyond the current listing.
EmailAddress:
type: string
format: email
minLength: 3
maxLength: 254
description: Account email address. The server compares addresses without regard to letter case and never reveals in a response whether an address belongs to an account.
examples:
- candidate@example.com
NewPassword:
type: string
minLength: 15
maxLength: 128
description: Password chosen at registration. The server normalizes it to Unicode NFKC, as NIST SP 800-63B-4 recommends, and then requires 15 to 128 Unicode code points; a value that the schema accepts can still fail this check after normalization. The 15-character minimum follows NIST SP 800-63B-4 for a password used as the only authentication factor; there are no composition rules. The upper bound limits the cost of password hashing. Generated client validators count UTF-16 code units, so a password with characters outside the Basic Multilingual Plane can pass the client check and fail on the server; a later client check should count code points. A password on the server blocklist of common or breached passwords answers 400 validation_failed with the pointer `/password`. The value is never returned, logged, or echoed in a problem.
LoginPassword:
type: string
minLength: 1
maxLength: 128
description: Password entered at login. The server applies the same NFKC normalization as at registration before it verifies the hash. Only the hashing bound applies, so a later change of the registration policy does not lock out existing accounts and a login error does not reveal the policy. The value is never returned, logged, or echoed in a problem.
AccountScenario:
type: string
description: 'Scenario chosen at registration: `candidate` looks for an offer and passes the assessment, `employer` represents a company that searches for candidates. The scenario selects the onboarding steps.'
enum:
- candidate
- employer
OnboardingStep:
type: string
description: |-
Saved onboarding step that the account returns to after login. The server stores it and advances it as each step completes; clients route by it and never set it directly.
- candidate_consents: candidate consents beyond C1, which was given at registration.
- candidate_profile: candidate profile.
- candidate_questionnaire: candidate questionnaire.
- candidate_assessment: the assessment. The expected grade is the `self_assessed_grade` saved in the questionnaire, and this step offers it first; only an assessment result confirms a grade. The first successful SaveMyQuestionnaire moves the account from candidate_questionnaire to this step (planned).
- employer_company: company profile of the employer.
- completed: onboarding is finished; the client opens the scenario home.
Candidate steps follow the order above and end with completed; the employer has employer_company and then completed. New steps may be added as onboarding grows; adding a value is a contract change.
enum:
- candidate_consents
- candidate_profile
- candidate_questionnaire
- candidate_assessment
- employer_company
- completed
ConsentPurpose:
type: string
description: 'Consent whose text the client may read before an account exists. Only the consents given at registration are listed: `c1` is the consent to the processing of personal data.'
enum:
- c1
ConsentText:
type: object
description: Currently published consent text. The server stores an acceptance with `text_version` and the hash of exactly this text.
additionalProperties: false
required:
- purpose
- text_version
- text
- published_at
properties:
purpose:
$ref: '#/components/schemas/ConsentPurpose'
text_version:
$ref: '#/components/schemas/ConsentTextVersion'
text:
type: string
minLength: 1
maxLength: 100000
description: Full consent text in plain UTF-8; paragraphs are separated by an empty line. The client shows it as text, never as HTML.
published_at:
$ref: '#/components/schemas/Timestamp'
ConsentTextVersion:
type: string
minLength: 1
maxLength: 64
pattern: ^[A-Za-z0-9._-]+$
description: Identifier of the published consent text that the user saw and accepted. The server stores the acceptance with this version and the hash of its text; the client never sends or receives the hash.
examples:
- c1-2026-10-01
PersonalDataConsentAcceptance:
type: object
description: Consent C1 to the processing of personal data, given at registration. The client reads the current text and its version with GetConsentText(c1) and sends that version here. A version that is not the currently published one answers 400 validation_failed with the pointer `/consent_c1/text_version`; the client then reads the text again and asks the user to accept the new version. Unknown fields are rejected, so registration cannot carry any other consent; in particular, C4 is never part of registration.
additionalProperties: false
required:
- text_version
- accepted
properties:
text_version:
$ref: '#/components/schemas/ConsentTextVersion'
accepted:
type: boolean
enum:
- true
description: Explicit acceptance. Only true is valid.
RegistrationRequest:
type: object
description: New account with its scenario and consent C1.
additionalProperties: false
required:
- email
- password
- scenario
- consent_c1
properties:
email:
$ref: '#/components/schemas/EmailAddress'
password:
$ref: '#/components/schemas/NewPassword'
scenario:
$ref: '#/components/schemas/AccountScenario'
consent_c1:
$ref: '#/components/schemas/PersonalDataConsentAcceptance'
EmailVerificationResendRequest:
type: object
description: Address that should receive a new verification link.
additionalProperties: false
required:
- email
properties:
email:
$ref: '#/components/schemas/EmailAddress'
IdentityRequestAccepted:
type: object
description: Neutral acknowledgement. Its content is identical whether or not the address belongs to an account or is already verified, so the response does not enumerate accounts. The client tells the user to check the mailbox.
additionalProperties: false
required:
- status
properties:
status:
type: string
enum:
- accepted
VerificationToken:
type: string
minLength: 32
maxLength: 128
pattern: ^[A-Za-z0-9_-]+$
description: 'One-time raw token copied from the verification link. It is request input only: the server stores only its hash and never returns a token.'
EmailVerificationRequest:
type: object
description: Token from the email verification link.
additionalProperties: false
required:
- token
properties:
token:
$ref: '#/components/schemas/VerificationToken'
EmailVerificationResult:
type: object
description: Result of a successful email verification. It does not start a session; the user signs in next and continues from `onboarding_step`.
additionalProperties: false
required:
- email_verified
- scenario
- onboarding_step
properties:
email_verified:
type: boolean
enum:
- true
description: Always true in a successful response.
scenario:
$ref: '#/components/schemas/AccountScenario'
onboarding_step:
$ref: '#/components/schemas/OnboardingStep'
LoginRequest:
type: object
description: Email and password of the account.
additionalProperties: false
required:
- email
- password
properties:
email:
$ref: '#/components/schemas/EmailAddress'
password:
$ref: '#/components/schemas/LoginPassword'
CsrfToken:
type: string
minLength: 32
maxLength: 128
pattern: ^[A-Za-z0-9_-]+$
description: CSRF token bound to the current session. The client keeps it in memory only and sends it in the X-CSRF-Token header of every mutating request that requires a session. It changes when a new session starts.
Account:
type: object
description: Current account view. It never contains password hashes, token hashes, session identifiers, or other storage secrets.
additionalProperties: false
required:
- id
- email
- email_verified
- scenario
- onboarding_step
- created_at
properties:
id:
type: string
format: uuid
description: Account identifier.
email:
$ref: '#/components/schemas/EmailAddress'
email_verified:
type: boolean
description: Whether the address is verified. A session exists only for a verified account, so this is true in every current response.
scenario:
$ref: '#/components/schemas/AccountScenario'
onboarding_step:
$ref: '#/components/schemas/OnboardingStep'
created_at:
$ref: '#/components/schemas/Timestamp'
Session:
type: object
description: 'Current session as the client may see it: the account and the CSRF token. The session identifier itself travels only in the HttpOnly session cookie and never appears in a body.'
additionalProperties: false
required:
- account
- csrf_token
properties:
account:
$ref: '#/components/schemas/Account'
csrf_token:
$ref: '#/components/schemas/CsrfToken'
DirectionCode:
type: string
description: |-
Stable code of a professional direction, the group that a specialization belongs to.
- development: Development.
- infrastructure: Infrastructure.
- data: Data.
- security: Security.
- quality: Quality.
Adding a value is a contract change.
enum:
- development
- infrastructure
- data
- security
- quality
SpecializationCode:
type: string
description: |-
Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.
- backend: Backend (development).
- frontend: Frontend (development).
- mobile: Mobile (development).
- network_engineer: Network Engineer (infrastructure).
- devops_sre: DevOps/SRE (infrastructure).
- data_analyst: Data Analyst (data).
- ds_ml: DS/ML (data).
- information_security: Information security (security).
- qa: QA (quality).
Adding a value is a contract change; renaming or removing one is a breaking change.
enum:
- backend
- frontend
- mobile
- network_engineer
- devops_sre
- data_analyst
- ds_ml
- information_security
- qa
GradeCode:
type: string
description: 'Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'
enum:
- intern
- junior
- middle
- senior
TaskLanguage:
type: string
description: Programming language in which assessment tasks of a specialization are offered and solved. It is the language of the task bank, not the candidate's platform stack, and it never forms a separate category. Only banks that offer a choice of language define task languages; the first Backend bank offers Python and Go. Adding a value is a contract change.
enum:
- python
- go
TestAvailabilityStatus:
type: string
description: Whether an assessment can start for the specialization. `available` means that a published task bank exists for at least one grade, listed in `TestAvailability.grades`. `in_development` means that no grade of the specialization has a published bank yet; the specialization can still be chosen in the questionnaire, but no assessment starts and no category can be confirmed for it. Presence in the catalog or in demo data never means that a test is ready.
enum:
- available
- in_development
TestAvailability:
type: object
description: Assessment availability of a specialization, derived by the server from the published task banks at the time of the request. The MVP opens an assessment only for a category, a specialization and a grade, that has a published bank. `status` is `available` exactly when `grades` is not empty; for `in_development` both `grades` and `task_languages` are empty.
additionalProperties: false
required:
- status
- grades
- task_languages
- note
properties:
status:
$ref: '#/components/schemas/TestAvailabilityStatus'
grades:
type: array
maxItems: 10
uniqueItems: true
description: Grades of the specialization with a published task bank, in ascending order. Only these categories can be assessed and confirmed.
items:
$ref: '#/components/schemas/GradeCode'
task_languages:
type: array
maxItems: 2
uniqueItems: true
description: Task languages that the published bank offers for this specialization. Empty when the bank does not offer a choice of language, as for Network Engineer, or when no bank is published. The questionnaire accepts only these languages for the specialization.
items:
$ref: '#/components/schemas/TaskLanguage'
note:
type:
- string
- 'null'
minLength: 1
maxLength: 300
description: Short Russian note for the candidate, for example why the test is not available yet, or null. Plain text; the client shows it as text, never as HTML.
CatalogSpecialization:
type: object
description: Specialization in the catalog with its assessment availability.
additionalProperties: false
required:
- code
- title
- test_availability
properties:
code:
$ref: '#/components/schemas/SpecializationCode'
title:
type: string
minLength: 1
maxLength: 100
description: Display name in Russian. Plain text.
test_availability:
$ref: '#/components/schemas/TestAvailability'
CatalogDirection:
type: object
description: Professional direction with its specializations. Each specialization belongs to exactly one direction.
additionalProperties: false
required:
- code
- title
- specializations
properties:
code:
$ref: '#/components/schemas/DirectionCode'
title:
type: string
minLength: 1
maxLength: 100
description: Display name in Russian. Plain text.
specializations:
type: array
minItems: 1
maxItems: 20
description: Specializations of the direction in display order.
items:
$ref: '#/components/schemas/CatalogSpecialization'
CatalogGrade:
type: object
description: Grade of the scale with its display name.
additionalProperties: false
required:
- code
- title
properties:
code:
$ref: '#/components/schemas/GradeCode'
title:
type: string
minLength: 1
maxLength: 100
description: Display name in Russian. Plain text.
SpecializationCatalog:
type: object
description: Catalog of directions, specializations, and the grade scale that the questionnaire and the assessment use. The catalog is reference data and identical for every caller; it contains no personal data.
additionalProperties: false
required:
- directions
- grades
properties:
directions:
type: array
minItems: 1
maxItems: 20
description: Directions in display order.
items:
$ref: '#/components/schemas/CatalogDirection'
grades:
type: array
minItems: 1
maxItems: 10
description: Grade scale in ascending order.
items:
$ref: '#/components/schemas/CatalogGrade'
QuestionnaireVersion:
type: integer
format: int64
minimum: 0
description: Version of the candidate questionnaire. A candidate without a saved questionnaire has version 0; every save that changes the questionnaire advances it by one.
examples:
- 3
StackTag:
type: string
minLength: 1
maxLength: 50
pattern: ^\S(?:.*\S)?$
description: 'Free technology tag of the candidate''s stack, for example PostgreSQL, Kubernetes, or Django. A tag is a descriptive attribute: it never forms a category, never selects the task language, and never changes a grade, so a tag such as "Senior" has no effect on any category. It has no leading or trailing whitespace and no line breaks. The server compares tags without regard to letter case. Clients show tags as text, never as HTML.'
WorkFormat:
type: string
description: 'Acceptable work format: `remote`, `office`, or `hybrid`.'
enum:
- remote
- office
- hybrid
WorkContext:
type: object
description: Working context of the candidate's search. It holds no personal data such as an address or a city; location, relocation, and salary expectations belong to the candidate profile.
additionalProperties: false
required:
- work_formats
properties:
work_formats:
type: array
minItems: 1
maxItems: 3
uniqueItems: true
description: Acceptable work formats.
items:
$ref: '#/components/schemas/WorkFormat'
CandidateExperience:
type: object
description: 'Experience that the candidate states for one specialization, in whole months. It is self-reported context: it never adds assessment points and never confirms a grade.'
additionalProperties: false
required:
- commercial_months
- academic_months
properties:
commercial_months:
type: integer
format: int32
minimum: 0
maximum: 600
description: Months of commercial work in the specialization.
academic_months:
type: integer
format: int32
minimum: 0
maximum: 600
description: Months of study, internships, or academic projects in the specialization.
QuestionnaireSpecialization:
type: object
description: 'One specialization chosen by the candidate with the candidate''s self-assessment. `self_assessed_grade` is a claim: it influences where the assessment starts and which grade the assessment step offers first, but it adds no points and never becomes a confirmed grade. A confirmed grade, and with it a category, comes only from an assessment result and is never part of the questionnaire; unknown fields such as `confirmed_grade` or `category` are rejected. Task languages and the stack are attributes of the chosen specialization, not categories.'
additionalProperties: false
required:
- specialization
- self_assessed_grade
- task_languages
- stack
- experience
properties:
specialization:
$ref: '#/components/schemas/SpecializationCode'
self_assessed_grade:
$ref: '#/components/schemas/GradeCode'
task_languages:
type: array
maxItems: 2
uniqueItems: true
description: Task languages in which the candidate wants to solve assessment tasks of this specialization. Each value must be one of `test_availability.task_languages` of the specialization in the current catalog; any other value answers 400 validation_failed with a pointer to it. Empty when the bank offers no choice of language.
items:
$ref: '#/components/schemas/TaskLanguage'
stack:
type: array
maxItems: 20
uniqueItems: true
description: Technology tags of the candidate in this specialization.
items:
$ref: '#/components/schemas/StackTag'
experience:
description: Stated experience, or null when the candidate did not state it.
oneOf:
- $ref: '#/components/schemas/CandidateExperience'
- type: 'null'
CandidateQuestionnaire:
type: object
description: 'Questionnaire of the current candidate: the chosen specializations with self-assessed grades and the working context. It never contains a confirmed grade or a category; those come only from assessment results. A candidate who has not saved the questionnaire yet gets version 0, no specializations, and null `work_context` and `updated_at`.'
additionalProperties: false
required:
- version
- specializations
- work_context
- updated_at
properties:
version:
$ref: '#/components/schemas/QuestionnaireVersion'
specializations:
type: array
maxItems: 2
description: Chosen specializations in the order the candidate gave them, each specialization at most once. Each one is assessed independently.
items:
$ref: '#/components/schemas/QuestionnaireSpecialization'
work_context:
description: Working context, or null before the first save.
oneOf:
- $ref: '#/components/schemas/WorkContext'
- type: 'null'
updated_at:
description: Time of the last change, or null before the first save.
oneOf:
- $ref: '#/components/schemas/Timestamp'
- type: 'null'
CandidateQuestionnaireUpdate:
type: object
description: Complete new state of the questionnaire. It replaces the stored specializations and working context as a whole. Unknown fields are rejected, so a request cannot set a confirmed grade or a category.
additionalProperties: false
required:
- expected_version
- specializations
- work_context
properties:
expected_version:
$ref: '#/components/schemas/QuestionnaireVersion'
specializations:
type: array
minItems: 1
maxItems: 2
description: One or two chosen specializations. The schema limits the count; the server also requires each specialization to appear at most once and answers a repeated one with 400 validation_failed and the pointer of the repeated item's `specialization`, for example `/specializations/1/specialization`.
items:
$ref: '#/components/schemas/QuestionnaireSpecialization'
work_context:
$ref: '#/components/schemas/WorkContext'
HealthResponse:
type: object
additionalProperties: false
required:
- status
properties:
status:
type: string
enum:
- ok
parameters:
IdempotencyKey:
name: Idempotency-Key
in: header
required: true
description: |-
Client-generated key that makes a retried mutating command safe; a UUID v4 is recommended. The value is sent without quotes. The server scopes the key by caller and operation and fingerprints the request by method, path, and body.
Stored for 24 hours after the first request and replayed with the same status, headers, and body: the final 2xx outcome and final deterministic 4xx business outcomes of the command, such as 404 not_found or 409 state_conflict. A replay does not repeat the side effect.
Not stored, so a retry with the same key is evaluated again: 400 validation_failed, 413, and 415 for the request itself, 401 and 403, 409 idempotency_in_progress, 412 version_conflict and 428 precondition_required (nothing changed; read the resource again and retry), 422 idempotency_key_reused, 429, and every 5xx.
Order of checks: authentication (401), request validation (400, 413, 415), authorization (403), then the key. A stored or running request with a different fingerprint returns 422 idempotency_key_reused before any other key check; a running request with the same fingerprint returns 409 idempotency_in_progress; a stored outcome with the same fingerprint is replayed. Only after that does the server check If-Match, so a retry of a completed change replays its outcome instead of failing on the version it has just changed. After 24 hours the key may be accepted as new.
schema:
type: string
minLength: 1
maxLength: 255
pattern: ^[A-Za-z0-9._:-]+$
example: 5f0c6a8e-3b0e-4c47-9f4c-2a8f9e5d7c11
IfMatch:
name: If-Match
in: header
required: false
description: |-
Strong entity tag of the resource version the client last read, copied from the ETag response header. An operation that changes a versioned resource says in its own description that it requires If-Match.
On such an operation, a missing If-Match returns 428 precondition_required. An If-Match that does not equal the current ETag returns 412 version_conflict and changes nothing; read the resource again before retrying. Only one strong entity tag is accepted; weak tags, lists, and `*` fail validation with 400. The parameter is optional in the schema so that a missing header reaches the application, which answers 428.
schema:
type: string
minLength: 3
maxLength: 130
pattern: ^"[A-Za-z0-9._~-]{1,128}"$
example: '"v7"'
PageLimit:
name: limit
in: query
required: false
description: Maximum number of items in the page. The server may return fewer items even when more remain; use `page.has_more` to detect the end.
schema:
type: integer
format: int32
minimum: 1
maximum: 100
default: 20
PageCursor:
name: cursor
in: query
required: false
description: Opaque `page.next_cursor` value from the previous page of the same listing. Omit it to read the first page. A malformed or foreign cursor returns 400 with code validation_failed.
schema:
type: string
minLength: 1
maxLength: 512
pattern: ^[A-Za-z0-9_-]+$
headers:
ETag:
description: Strong entity tag of the returned resource version. Send it back in If-Match to change this version.
required: true
schema:
type: string
minLength: 3
maxLength: 130
pattern: ^"[A-Za-z0-9._~-]{1,128}"$
example: '"v7"'
RetryAfter:
description: Number of seconds to wait before retrying the request.
schema:
type: integer
format: int32
minimum: 0
maximum: 86400
example: 30
SessionCookieSet:
description: Sets the session cookie `__Host-lincodex_session` with an opaque random value and the attributes `Path=/; Secure; HttpOnly; SameSite=Strict` and no Domain. The `__Host-` prefix makes the browser reject the cookie without Secure and Path=/ or with a Domain. Max-Age equals the remaining absolute session lifetime. The value is never readable by scripts or present in a body.
required: true
schema:
type: string
minLength: 1
maxLength: 4096
pattern: ^__Host-lincodex_session=
example: __Host-lincodex_session=opaque-session-value; Path=/; Max-Age=604800; Secure; HttpOnly; SameSite=Strict
SessionCookieCleared:
description: Removes the session cookie with an empty value, `Max-Age=0`, and the same attributes it was set with.
required: true
schema:
type: string
minLength: 1
maxLength: 4096
pattern: ^__Host-lincodex_session=
example: __Host-lincodex_session=; Path=/; Max-Age=0; Secure; HttpOnly; SameSite=Strict
CacheControlNoStore:
description: '`no-store`: the response carries account or session data that browsers and intermediaries must not keep.'
required: true
schema:
type: string
enum:
- no-store
example: no-store
responses:
ValidationFailed:
description: Parameters, headers, or the body do not match the contract, or the body violates a domain rule such as salary_from <= salary_to. The body has code validation_failed and lists the failing fields in `errors` with body or parameter pointers.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
examples:
validation_failed:
$ref: '#/components/examples/ValidationFailed'
domain_rule:
$ref: '#/components/examples/DomainValidationFailed'
Unauthenticated:
description: No valid session or credentials; code unauthenticated.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
examples:
unauthenticated:
$ref: '#/components/examples/Unauthenticated'
Forbidden:
description: The caller is authenticated but may not perform the operation; code forbidden.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
examples:
forbidden:
$ref: '#/components/examples/Forbidden'
NotFound:
description: The object does not exist or is not visible to the caller; code not_found. Missing and inaccessible objects are not distinguished.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
examples:
not_found:
$ref: '#/components/examples/NotFound'
IdempotencyInProgress:
description: A request with the same Idempotency-Key and the same fingerprint is still being processed; code idempotency_in_progress. Retry after the original request completes.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
examples:
idempotency_in_progress:
$ref: '#/components/examples/IdempotencyInProgress'
StateConflict:
description: The operation conflicts with the current state of the resource, for example a transition that is not allowed from its current status; code state_conflict.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
examples:
state_conflict:
$ref: '#/components/examples/StateConflict'
PreconditionFailed:
description: If-Match does not match the current resource version; code version_conflict. Nothing was changed.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
examples:
version_conflict:
$ref: '#/components/examples/VersionConflict'
PayloadTooLarge:
description: The request body exceeds the operation limit; code payload_too_large.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
examples:
payload_too_large:
$ref: '#/components/examples/PayloadTooLarge'
UnprocessableContent:
description: The Idempotency-Key was already used with a different request within 24 hours; code idempotency_key_reused. Nothing was changed.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
examples:
idempotency_key_reused:
$ref: '#/components/examples/IdempotencyKeyReused'
PreconditionRequired:
description: The operation requires If-Match; code precondition_required.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
examples:
precondition_required:
$ref: '#/components/examples/PreconditionRequired'
TooManyRequests:
description: Too many requests; code rate_limited.
headers:
Retry-After:
$ref: '#/components/headers/RetryAfter'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
examples:
rate_limited:
$ref: '#/components/examples/RateLimited'
Internal:
description: Unexpected server error; code internal.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
examples:
internal:
$ref: '#/components/examples/Internal'
NotImplemented:
description: The operation is declared in the contract but not implemented yet; code not_implemented.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
examples:
not_implemented:
$ref: '#/components/examples/NotImplemented'
Problem:
description: Any error response. The body is a Problem whose `status` equals the HTTP status and whose `code` is one of ProblemCode.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
examples:
validation_failed:
$ref: '#/components/examples/ValidationFailed'
not_found:
$ref: '#/components/examples/NotFound'
internal:
$ref: '#/components/examples/Internal'
not_implemented:
$ref: '#/components/examples/NotImplemented'
RegistrationValidationFailed:
description: 'The body does not match the contract or violates a registration rule: a password outside 15-128 characters or on the blocklist, or a consent text version that is not the current one; code validation_failed with body pointers. An email that already belongs to an account is never a validation error.'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
examples:
validation_failed:
$ref: '#/components/examples/RegistrationValidationFailed'
EmailVerificationFailed:
description: The token cannot verify an email. Code verification_token_expired means the token is past its lifetime; verification_token_invalid means it is unknown, already used, or replaced by a newer link; validation_failed with the pointer `/token` means the token is malformed. Nothing was changed in any case.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
examples:
verification_token_expired:
$ref: '#/components/examples/VerificationTokenExpired'
verification_token_invalid:
$ref: '#/components/examples/VerificationTokenInvalid'
validation_failed:
$ref: '#/components/examples/VerificationTokenMalformed'
InvalidCredentials:
description: The email and password do not match an account; code invalid_credentials. An unknown email and a wrong password get the same response.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
examples:
invalid_credentials:
$ref: '#/components/examples/InvalidCredentials'
CsrfCheckFailed:
description: 'The request failed cross-site request protection: the X-CSRF-Token header is missing or does not belong to the session, or the Origin is not allowed; code csrf_check_failed. Nothing was changed.'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
examples:
csrf_check_failed:
$ref: '#/components/examples/CsrfCheckFailed'
CsrfCheckFailedOrForbidden:
description: 'The request failed cross-site request protection, code csrf_check_failed: the X-CSRF-Token header is missing or does not belong to the session, or the Origin is not allowed. Or the account may not perform the operation, code forbidden. Nothing was changed in either case.'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
examples:
csrf_check_failed:
$ref: '#/components/examples/CsrfCheckFailed'
forbidden:
$ref: '#/components/examples/Forbidden'
QuestionnaireValidationFailed:
description: 'The body does not match the contract or violates a questionnaire rule: more than two specializations, an unknown specialization, grade, or task language, an unknown field such as confirmed_grade, a repeated specialization, or a task language that the specialization''s published bank does not offer; code validation_failed with body pointers. When the decoder does not record the path of a nested field, the pointer is the whole body. Nothing was changed.'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
examples:
too_many_specializations:
$ref: '#/components/examples/QuestionnaireTooManySpecializations'
unknown_grade:
$ref: '#/components/examples/QuestionnaireUnknownGrade'
repeated_specialization:
$ref: '#/components/examples/QuestionnaireRepeatedSpecialization'
QuestionnaireVersionConflict:
description: '`expected_version` is not the current questionnaire version; code version_conflict. Nothing was changed; read the questionnaire again before retrying.'
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
examples:
version_conflict:
$ref: '#/components/examples/VersionConflict'
securitySchemes:
sessionCookie:
type: apiKey
in: cookie
name: __Host-lincodex_session
description: |-
Opaque random session identifier issued by Login in an HttpOnly cookie with `Path=/; Secure; HttpOnly; SameSite=Strict` and no Domain. The server keeps the session in PostgreSQL, checks its expiry and revocation on every request, and derives the caller from it; operations never take a user identifier from the body. A session ends after an idle timeout of 24 hours or an absolute lifetime of 7 days, whichever comes first (planned values from configuration); activity extends only the idle deadline. A missing, unknown, expired, or revoked session answers 401 unauthenticated. Scripts cannot read the cookie, and it never appears in a body, log, or problem.
SameSite=Strict costs the single-page application nothing: its HTML is public and every API call is a same-origin fetch, which carries the cookie even right after a cross-site navigation, while cross-site requests never carry it.
sessionCsrf:
type: apiKey
in: header
name: X-CSRF-Token
description: 'Synchronizer token bound to the session, returned by Login and GetCurrentSession. Every mutating operation that requires a session also requires this header; a missing token or one that does not belong to the session answers 403 csrf_check_failed. The token is defense in depth next to SameSite=Strict and the Origin check: every unsafe request (POST, PUT, PATCH, DELETE), including public ones such as Login, must carry an Origin from the configured allowlist, otherwise it answers 403 csrf_check_failed; a missing Origin is rejected too, and the server never derives the allowed Origin from the Host header. Request bodies are accepted only as application/json, which a cross-site form cannot send. A backend test requires every unsafe operation that requires sessionCookie to require this scheme as well.'
examples:
ValidationFailed:
summary: Request parameters do not match the contract
value:
type: urn:lincodex:problem:validation_failed
title: Request validation failed
status: 400
code: validation_failed
detail: One or more request fields are invalid.
trace_id: 0b6f6f0e-7c55-4c8f-a8d1-6f3f3b8f2a10
errors:
- in: query
pointer: /limit
code: invalid
message: The value does not match the contract.
- in: header
pointer: /Idempotency-Key
code: required
message: The value is required.
NotFound:
summary: Unknown route or invisible object
value:
type: urn:lincodex:problem:not_found
title: Resource not found
status: 404
code: not_found
detail: The requested resource does not exist.
trace_id: 1c2d3e4f-5a6b-4c7d-8e9f-0a1b2c3d4e5f
Internal:
summary: Unexpected server error
value:
type: urn:lincodex:problem:internal
title: Internal server error
status: 500
code: internal
detail: The server could not complete the request.
trace_id: 9c0d1e2f-3a4b-4c5d-8e6f-7a8b9c0d1e2f
NotImplemented:
summary: Operation declared in the contract without an implementation
value:
type: urn:lincodex:problem:not_implemented
title: Operation not implemented
status: 501
code: not_implemented
detail: This operation is not available yet.
trace_id: 0d1e2f3a-4b5c-4d6e-9f7a-8b9c0d1e2f3a
DomainValidationFailed:
summary: The body violates a domain rule
value:
type: urn:lincodex:problem:validation_failed
title: Request validation failed
status: 400
code: validation_failed
detail: One or more request fields are invalid.
trace_id: 2f3a4b5c-6d7e-4f8a-9b0c-1d2e3f4a5b6c
errors:
- in: body
pointer: /salary_from
code: invalid
message: The value does not match the contract.
RegistrationValidationFailed:
summary: The password is too short and the consent text is outdated
value:
type: urn:lincodex:problem:validation_failed
title: Request validation failed
status: 400
code: validation_failed
detail: One or more request fields are invalid.
trace_id: 9b0c1d2e-3f4a-4b5c-8d6e-7f8a9b0c1d2e
errors:
- in: body
pointer: /password
code: invalid
message: The value does not match the contract.
- in: body
pointer: /consent_c1/text_version
code: invalid
message: The value does not match the contract.
CsrfCheckFailed:
summary: Missing or wrong CSRF token, or a disallowed Origin
value:
type: urn:lincodex:problem:csrf_check_failed
title: Cross-site request check failed
status: 403
code: csrf_check_failed
detail: Read the current session to get a new CSRF token and repeat the request.
trace_id: 8a9b0c1d-2e3f-4a4b-9c5d-6e7f8a9b0c1d
IdempotencyInProgress:
summary: The first request with this key is still running
value:
type: urn:lincodex:problem:idempotency_in_progress
title: Request with this idempotency key is in progress
status: 409
code: idempotency_in_progress
detail: Retry after the original request completes.
trace_id: 2d3e4f5a-6b7c-4d8e-9f0a-1b2c3d4e5f6a
IdempotencyKeyReused:
summary: The same Idempotency-Key was sent with a different body
value:
type: urn:lincodex:problem:idempotency_key_reused
title: Idempotency key reused with a different request
status: 422
code: idempotency_key_reused
detail: Use a new Idempotency-Key for a different request.
trace_id: 4f5a6b7c-8d9e-4f0a-9b1c-3d4e5f6a7b8c
RateLimited:
summary: Too many requests
value:
type: urn:lincodex:problem:rate_limited
title: Too many requests
status: 429
code: rate_limited
detail: Wait for the Retry-After interval and retry.
trace_id: 6b7c8d9e-0f1a-4b2c-9d3e-5f6a7b8c9d0e
VerificationTokenExpired:
summary: The verification token is past its lifetime
value:
type: urn:lincodex:problem:verification_token_expired
title: Verification link expired
status: 400
code: verification_token_expired
detail: Request a new verification link.
trace_id: 4c5d6e7f-8a9b-4c0d-9e1f-2a3b4c5d6e7f
VerificationTokenInvalid:
summary: The verification token is unknown, used, or replaced
value:
type: urn:lincodex:problem:verification_token_invalid
title: Verification link is not valid
status: 400
code: verification_token_invalid
detail: Request a new verification link, or sign in if the address is already verified.
trace_id: 3b4c5d6e-7f8a-4b9c-8d0e-1f2a3b4c5d6e
VerificationTokenMalformed:
summary: The token from the link is malformed
value:
type: urn:lincodex:problem:validation_failed
title: Request validation failed
status: 400
code: validation_failed
detail: One or more request fields are invalid.
trace_id: 5d6e7f8a-9b0c-4d1e-8f2a-3b4c5d6e7f8a
errors:
- in: body
pointer: /token
code: invalid
message: The value does not match the contract.
CandidateSession:
summary: Session of a verified candidate
value:
account:
id: 0f8b6c2e-4d1a-4e7b-9c3f-5a2d8e6b1c47
email: candidate@example.com
email_verified: true
scenario: candidate
onboarding_step: candidate_questionnaire
created_at: '2026-10-05T09:30:00Z'
csrf_token: Xk4pR9tV2mQ7wL1sN8bC5dF0gH3jZ6yA9eU2iO7rT4c
InvalidCredentials:
summary: Unknown email or wrong password
value:
type: urn:lincodex:problem:invalid_credentials
title: Invalid email or password
status: 401
code: invalid_credentials
detail: Check the email and password and try again.
trace_id: 6e7f8a9b-0c1d-4e2f-9a3b-4c5d6e7f8a9b
EmailNotVerified:
summary: Correct credentials for an unverified email
value:
type: urn:lincodex:problem:email_not_verified
title: Email not verified
status: 403
code: email_not_verified
detail: Confirm the email address with the link from the verification message.
trace_id: 7f8a9b0c-1d2e-4f3a-8b4c-5d6e7f8a9b0c
Unauthenticated:
summary: No valid session
value:
type: urn:lincodex:problem:unauthenticated
title: Authentication required
status: 401
code: unauthenticated
detail: Sign in and repeat the request.
trace_id: 4f2d1c3b-6a5e-4d7f-8b9a-0c1d2e3f4a5b
CandidateAccount:
summary: A verified candidate on the questionnaire step
value:
id: 0f8b6c2e-4d1a-4e7b-9c3f-5a2d8e6b1c47
email: candidate@example.com
email_verified: true
scenario: candidate
onboarding_step: candidate_questionnaire
created_at: '2026-10-05T09:30:00Z'
SpecializationCatalog:
summary: Illustrative MVP catalog with the Backend and Network Engineer banks published
description: Illustrative values. The directions, specializations, and grades follow the MVP scale; `test_availability` comes from the published task banks, so the grades and languages shown here are not a statement about any deployed bank.
value:
directions:
- code: development
title: Разработка
specializations:
- code: backend
title: Backend
test_availability:
status: available
grades:
- intern
- junior
- middle
- senior
task_languages:
- python
- go
note: null
- code: frontend
title: Frontend
test_availability:
status: in_development
grades: []
task_languages: []
note: Тест в разработке.
- code: mobile
title: Mobile
test_availability:
status: in_development
grades: []
task_languages: []
note: Тест в разработке.
- code: infrastructure
title: Инфраструктура
specializations:
- code: network_engineer
title: Сетевой инженер
test_availability:
status: available
grades:
- junior
- middle
task_languages: []
note: null
- code: devops_sre
title: DevOps/SRE
test_availability:
status: in_development
grades: []
task_languages: []
note: Тест в разработке.
- code: data
title: Данные
specializations:
- code: data_analyst
title: Аналитик данных
test_availability:
status: in_development
grades: []
task_languages: []
note: Тест в разработке.
- code: ds_ml
title: DS/ML
test_availability:
status: in_development
grades: []
task_languages: []
note: Тест в разработке.
- code: security
title: Безопасность
specializations:
- code: information_security
title: Информационная безопасность
test_availability:
status: in_development
grades: []
task_languages: []
note: Тест в разработке.
- code: quality
title: Качество
specializations:
- code: qa
title: QA
test_availability:
status: in_development
grades: []
task_languages: []
note: Тест в разработке.
grades:
- code: intern
title: Стажер
- code: junior
title: Junior
- code: middle
title: Middle
- code: senior
title: Senior
NewCandidateQuestionnaire:
summary: A candidate who has not saved the questionnaire yet
value:
version: 0
specializations: []
work_context: null
updated_at: null
BackendGoAndNetworkEngineerQuestionnaire:
summary: Backend with Go and Network Engineer, two independent specializations
description: Go is a task language of the `backend` specialization and PostgreSQL and gRPC are stack tags; none of them is a category. The candidate has two specializations, `backend` and `network_engineer`, each assessed independently. The self-assessed grades are claims; no confirmed grade appears.
value:
version: 3
specializations:
- specialization: backend
self_assessed_grade: middle
task_languages:
- go
stack:
- PostgreSQL
- gRPC
- Kafka
experience:
commercial_months: 30
academic_months: 12
- specialization: network_engineer
self_assessed_grade: junior
task_languages: []
stack:
- Cisco IOS
- BGP
experience: null
work_context:
work_formats:
- remote
- hybrid
updated_at: '2026-10-05T09:30:00Z'
Forbidden:
summary: The caller may not access the object
value:
type: urn:lincodex:problem:forbidden
title: Access denied
status: 403
code: forbidden
detail: You do not have permission to perform this operation.
trace_id: 7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d
BackendGoAndNetworkEngineerQuestionnaireUpdate:
summary: Save Backend with Go and Network Engineer over version 2
value:
expected_version: 2
specializations:
- specialization: backend
self_assessed_grade: middle
task_languages:
- go
stack:
- PostgreSQL
- gRPC
- Kafka
experience:
commercial_months: 30
academic_months: 12
- specialization: network_engineer
self_assessed_grade: junior
task_languages: []
stack:
- Cisco IOS
- BGP
experience: null
work_context:
work_formats:
- remote
- hybrid
QuestionnaireTooManySpecializations:
summary: Three specializations were sent; at most two are allowed
value:
type: urn:lincodex:problem:validation_failed
title: Request validation failed
status: 400
code: validation_failed
detail: One or more request fields are invalid.
trace_id: 6c7d8e9f-0a1b-4c2d-8e3f-4a5b6c7d8e9f
errors:
- in: body
pointer: /specializations
code: invalid
message: The value does not match the contract.
QuestionnaireUnknownGrade:
summary: A self-assessed grade outside the grade scale, such as lead
value:
type: urn:lincodex:problem:validation_failed
title: Request validation failed
status: 400
code: validation_failed
detail: One or more request fields are invalid.
trace_id: 7d8e9f0a-1b2c-4d3e-9f4a-5b6c7d8e9f0a
errors:
- in: body
pointer: /specializations/0/self_assessed_grade
code: invalid
message: The value does not match the contract.
QuestionnaireRepeatedSpecialization:
summary: The same specialization was chosen twice
value:
type: urn:lincodex:problem:validation_failed
title: Request validation failed
status: 400
code: validation_failed
detail: One or more request fields are invalid.
trace_id: 8e9f0a1b-2c3d-4e4f-8a5b-6c7d8e9f0a1b
errors:
- in: body
pointer: /specializations/1/specialization
code: invalid
message: The value does not match the contract.
VersionConflict:
summary: If-Match does not match the current version
value:
type: urn:lincodex:problem:version_conflict
title: Resource version conflict
status: 412
code: version_conflict
detail: The resource changed after it was read. Read it again before retrying.
trace_id: 3e4f5a6b-7c8d-4e9f-8a0b-2c3d4e5f6a7b
StateConflict:
summary: The resource state does not allow the operation
value:
type: urn:lincodex:problem:state_conflict
title: Resource state conflict
status: 409
code: state_conflict
detail: The resource is in a state that does not allow this operation.
trace_id: 1e2f3a4b-5c6d-4e7f-8a9b-0c1d2e3f4a5b
PayloadTooLarge:
summary: The request body exceeds the limit
value:
type: urn:lincodex:problem:payload_too_large
title: Request body too large
status: 413
code: payload_too_large
detail: Reduce the request body size and retry.
trace_id: 8b9c0d1e-2f3a-4b4c-9d5e-6f7a8b9c0d1e
PreconditionRequired:
summary: The operation requires If-Match
value:
type: urn:lincodex:problem:precondition_required
title: Precondition required
status: 428
code: precondition_required
detail: Send If-Match with the ETag of the version you read.
trace_id: 5a6b7c8d-9e0f-4a1b-8c2d-4e5f6a7b8c9d