{"openapi":"3.1.0","info":{"title":"B55 API","version":"0.2.0","description":"Evidence-backed developer screening for hiring products: jobs, candidates and reports. Sandbox: b55_test_ keys, fictional candidates only. Live: b55_live_ keys from the console, real candidates who signed in with GitHub and consented."},"servers":[{"url":"/sandbox-api","description":"Local sandbox, through the docs proxy (console on B55_SANDBOX_URL, default http://localhost:3100)"}],"security":[{"bearer":[]}],"paths":{"/v0/roles":{"get":{"operationId":"roles.list","summary":"List supported roles","responses":{"200":{"description":"Role catalog","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/v0/roles/suggest":{"post":{"operationId":"roles.suggest","summary":"Suggest a role, seniority and skills from a job description","description":"Rule-based by default. When the console has OPENAI_API_KEY, it may ask an AI model first (only the description is sent) and falls back to the rules; `source` says which.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuggestRole"},"example":{"description":"Senior backend engineer to build payment APIs in golang on Postgres. Python is a plus."}}}},"responses":{"200":{"description":"Suggestion","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleSuggestion"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/InvalidSuggest"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/v0/jobs":{"get":{"operationId":"jobs.list","summary":"List jobs, newest first","parameters":[{"name":"status","in":"query","required":false,"description":"Only open or only closed jobs","schema":{"type":"string","enum":["open","closed"]}},{"name":"client_id","in":"query","required":false,"description":"Only jobs with this client_id (one of your customers)","schema":{"type":"string"}}],"responses":{"200":{"description":"Jobs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"422":{"$ref":"#/components/responses/InvalidQuery"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"jobs.create","summary":"Create a job with one apply link. Idempotent on client_id.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateJob"},"example":{"title":"Senior backend engineer","description":"Payment APIs in Go on Postgres.","company":"Acme","role":{"base":"backend","seniority":"senior","must":["Go","SQL"],"nice":["Python"]},"client_id":"tenant-42:req-981"}}}},"responses":{"200":{"description":"Job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/InvalidJob"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/v0/jobs/{job_id}":{"parameters":[{"$ref":"#/components/parameters/JobId"}],"get":{"operationId":"jobs.get","summary":"Get a job, with candidate counts","responses":{"200":{"description":"Job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/JobNotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/v0/jobs/{job_id}/close":{"parameters":[{"$ref":"#/components/parameters/JobId"}],"post":{"operationId":"jobs.close","summary":"Close a job: no new candidates. Closing twice is a no-op.","responses":{"200":{"description":"Job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/JobNotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/v0/jobs/{job_id}/candidates":{"parameters":[{"$ref":"#/components/parameters/JobId"}],"get":{"operationId":"candidates.list","summary":"List a job's candidates, ranked: verified first, then role fit, then confidence, then newest","parameters":[{"name":"sort","in":"query","required":false,"description":"Default ranked. There is no single score.","schema":{"type":"string","enum":["ranked","newest","oldest"]}},{"name":"status","in":"query","required":false,"description":"Only this status","schema":{"type":"string","enum":["invited","opened","consented","scanned","ready","insufficient_evidence"]}},{"name":"verdict","in":"query","required":false,"description":"Only this report verdict","schema":{"type":"string","enum":["verified","partially-verified","self-reported","insufficient-evidence"]}}],"responses":{"200":{"description":"Candidates","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CandidateList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/JobNotFound"},"422":{"$ref":"#/components/responses/InvalidQuery"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"candidates.create","summary":"Add a candidate by email. Idempotent per job on email and client_id.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddCandidate"},"example":{"email":"maya-frontend@example.com","client_id":"application-1042"}}}},"responses":{"200":{"description":"Candidate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Candidate"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/JobNotFound"},"409":{"$ref":"#/components/responses/JobClosed"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/InvalidCandidate"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/v0/jobs/{job_id}/events":{"parameters":[{"$ref":"#/components/parameters/JobId"}],"get":{"operationId":"events.list","summary":"The job's events, oldest first (the webhook order)","responses":{"200":{"description":"Events","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/JobNotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/v0/jobs/{job_id}/apply":{"parameters":[{"$ref":"#/components/parameters/JobId"}],"post":{"operationId":"jobs.apply","summary":"Candidate-facing: apply through the job's link and consent. No API key.","description":"Called by the apply page in the candidate's browser, never by your backend. Sandbox: `github` names a fictional developer. Production plan: GitHub OAuth on the apply page.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Apply"},"example":{"github":"maya-frontend","consent":true}}}},"responses":{"200":{"description":"Candidate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Candidate"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"404":{"$ref":"#/components/responses/JobNotFound"},"409":{"$ref":"#/components/responses/JobClosed"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/InvalidApply"},"default":{"$ref":"#/components/responses/Error"}}}},"/v0/candidates/{candidate_id}":{"parameters":[{"$ref":"#/components/parameters/CandidateId"}],"get":{"operationId":"candidates.get","summary":"Get a candidate","responses":{"200":{"description":"Candidate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Candidate"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/CandidateNotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"candidates.delete","summary":"Delete a candidate","description":"Erases the candidate's email, GitHub identity, scan and report. The candidate stays listed with status `withdrawn` (ids and timeline only), and a `candidate.deleted` event follows.","responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deleted"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/CandidateNotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/v0/candidates/{candidate_id}/advance":{"parameters":[{"$ref":"#/components/parameters/CandidateId"}],"post":{"operationId":"candidates.advance","summary":"Sandbox only: play the candidate's next step","responses":{"200":{"description":"Candidate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Candidate"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/CandidateNotFound"},"409":{"$ref":"#/components/responses/CandidateFinished"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/v0/candidates/{candidate_id}/scan":{"parameters":[{"$ref":"#/components/parameters/CandidateId"}],"post":{"operationId":"candidates.scan","summary":"Candidate-facing: the CLI uploads a signed scan. No API key.","description":"Sent by the B55 CLI, never by your backend. Accepted only after consent. Sandbox: no token, the candidate id is the capability, and the hosted sandbox takes only --demo scans. Live: `Authorization: Bearer b55ct_…`, the single-use token from the apply page; the payload's evidence.nonce must equal the token's id, and the server checks a fresh random sample of the public commits on GitHub before the report is built.","security":[{},{"candidateToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"The signed ScanPayload exactly as the CLI produced it (17 fields, integrityHash included, plus the optional sessionAnalysis block: aggregate numbers only, a strict allowlist with no free text)."}}}},"responses":{"200":{"description":"Candidate","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Candidate"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/CandidateTokenInvalid"},"404":{"$ref":"#/components/responses/CandidateNotFound"},"409":{"$ref":"#/components/responses/ScanConflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"422":{"$ref":"#/components/responses/InvalidScan"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/v0/reports/{report_id}":{"parameters":[{"$ref":"#/components/parameters/ReportId"}],"get":{"operationId":"reports.get","summary":"Get a report","responses":{"200":{"description":"Report","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Report"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/ReportNotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}},"delete":{"operationId":"reports.delete","summary":"Delete a report","description":"Deletes the report. Its candidate keeps its status; `report_id`, `verdict`, `relevance` and `confidence` become null and the timeline gets a `report_deleted` entry.","responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Deleted"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/ReportNotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}},"/v0/reports/{report_id}/embed-token":{"parameters":[{"$ref":"#/components/parameters/ReportId"}],"post":{"operationId":"reports.embedToken","summary":"Create a report embed token","description":"Live only. A signed, read-only link to the report that works for 15 minutes, for an iframe on one of the account's registered embed origins. No body. The sandbox answers `embed_live_only`: sandbox reports embed without a token.","responses":{"200":{"description":"Embed token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbedToken"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/ReportNotFound"},"422":{"$ref":"#/components/responses/EmbedLiveOnly"},"429":{"$ref":"#/components/responses/RateLimited"},"default":{"$ref":"#/components/responses/Error"}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"b55_test_… (sandbox, fictional data) or b55_live_… (live, created in the console and shown once)"},"candidateToken":{"type":"http","scheme":"bearer","bearerFormat":"b55ct_…","description":"Live only: the signed, single-use candidate token from the apply page (2 hours, bound to the candidate's GitHub sign-in). Only POST /v0/candidates/{candidate_id}/scan takes it."}},"parameters":{"JobId":{"name":"job_id","in":"path","required":true,"schema":{"type":"string"}},"CandidateId":{"name":"candidate_id","in":"path","required":true,"schema":{"type":"string"}},"ReportId":{"name":"report_id","in":"path","required":true,"schema":{"type":"string"}}},"responses":{"BadRequest":{"description":"Bad request. `code` is `invalid_json`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"invalid_json":{"$ref":"#/components/examples/invalid_json"}}}}},"CandidateTokenInvalid":{"description":"Live scans only: the candidate token was refused. `code` is one of `token_malformed`, `token_bad_signature`, `token_expired`, `token_wrong_candidate`, `token_unknown`, `token_revoked`, `token_identity_mismatch`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"token_malformed":{"$ref":"#/components/examples/token_malformed"},"token_bad_signature":{"$ref":"#/components/examples/token_bad_signature"},"token_expired":{"$ref":"#/components/examples/token_expired"},"token_wrong_candidate":{"$ref":"#/components/examples/token_wrong_candidate"},"token_unknown":{"$ref":"#/components/examples/token_unknown"},"token_revoked":{"$ref":"#/components/examples/token_revoked"},"token_identity_mismatch":{"$ref":"#/components/examples/token_identity_mismatch"}}}}},"PayloadTooLarge":{"description":"The body is over the size limit. `code` is `payload_too_large`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"payload_too_large":{"$ref":"#/components/examples/payload_too_large"}}}}},"RateLimited":{"description":"Too many requests. `code` is `rate_limited`. Wait the number of seconds in Retry-After.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limited":{"$ref":"#/components/examples/rate_limited"}}}}},"Unauthorized":{"description":"Unauthorized. `code` is `unauthorized` (no key, a malformed key, or an unknown or revoked live key) or `live_keys_unavailable` (a `b55_live_` key sent to a server that runs the sandbox only).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unauthorized":{"$ref":"#/components/examples/unauthorized"},"live_keys_unavailable":{"$ref":"#/components/examples/live_keys_unavailable"}}}}},"EmbedLiveOnly":{"description":"Validation failed. `code` is `embed_live_only`: embed tokens are for live reports.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"embed_live_only":{"$ref":"#/components/examples/embed_live_only"}}}}},"JobNotFound":{"description":"Not found. `code` is `job_not_found`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"job_not_found":{"$ref":"#/components/examples/job_not_found"}}}}},"CandidateNotFound":{"description":"Not found. `code` is `candidate_not_found`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"candidate_not_found":{"$ref":"#/components/examples/candidate_not_found"}}}}},"ReportNotFound":{"description":"Not found. `code` is `report_not_found`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"report_not_found":{"$ref":"#/components/examples/report_not_found"}}}}},"JobClosed":{"description":"Conflict. `code` is `job_closed`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"job_closed":{"$ref":"#/components/examples/job_closed"}}}}},"CandidateFinished":{"description":"Conflict. `code` is `candidate_finished`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"candidate_finished":{"$ref":"#/components/examples/candidate_finished"}}}}},"ScanConflict":{"description":"Conflict. `code` is one of `consent_required`, `candidate_finished`, `scan_replayed`, `token_used`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"consent_required":{"$ref":"#/components/examples/consent_required"},"candidate_finished":{"$ref":"#/components/examples/candidate_finished"},"scan_replayed":{"$ref":"#/components/examples/scan_replayed"},"token_used":{"$ref":"#/components/examples/token_used"}}}}},"InvalidQuery":{"description":"Validation failed. `code` is `invalid_query`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"invalid_query":{"$ref":"#/components/examples/invalid_query"}}}}},"InvalidSuggest":{"description":"Validation failed. `code` is `invalid_description`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"invalid_description":{"$ref":"#/components/examples/invalid_description"}}}}},"InvalidJob":{"description":"Validation failed. `code` is one of `invalid_title`, `invalid_description`, `invalid_company`, `invalid_client_id`, `invalid_role`, `role_not_supported`, `invalid_seniority`, `invalid_ai_usage`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"invalid_title":{"$ref":"#/components/examples/invalid_title"},"invalid_description":{"$ref":"#/components/examples/invalid_description"},"invalid_company":{"$ref":"#/components/examples/invalid_company"},"invalid_client_id":{"$ref":"#/components/examples/invalid_client_id"},"invalid_role":{"$ref":"#/components/examples/invalid_role"},"role_not_supported":{"$ref":"#/components/examples/role_not_supported"},"invalid_seniority":{"$ref":"#/components/examples/invalid_seniority"},"invalid_ai_usage":{"$ref":"#/components/examples/invalid_ai_usage"}}}}},"InvalidCandidate":{"description":"Validation failed. `code` is one of `invalid_email`, `invalid_client_id`, `sandbox_fictional_only` (hosted sandbox: made-up addresses only).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"invalid_email":{"$ref":"#/components/examples/invalid_email"},"invalid_client_id":{"$ref":"#/components/examples/invalid_client_id"},"sandbox_fictional_only":{"$ref":"#/components/examples/sandbox_fictional_only"}}}}},"InvalidApply":{"description":"Validation failed. `code` is one of `invalid_github`, `invalid_email`, `consent_missing`, `sandbox_fictional_only` (hosted sandbox: made-up addresses only).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"invalid_github":{"$ref":"#/components/examples/invalid_github"},"invalid_email":{"$ref":"#/components/examples/invalid_email"},"consent_missing":{"$ref":"#/components/examples/consent_missing"},"sandbox_fictional_only":{"$ref":"#/components/examples/sandbox_fictional_only"}}}}},"InvalidScan":{"description":"Validation failed. `code` is one of `invalid_scan`, `scan_integrity_failed`, `nonce_mismatch` (live: signed for another token), `demo_scan` (live: --demo scans go to the sandbox), `sandbox_demo_only` (hosted sandbox: --demo scans only).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"invalid_scan":{"$ref":"#/components/examples/invalid_scan"},"scan_integrity_failed":{"$ref":"#/components/examples/scan_integrity_failed"},"nonce_mismatch":{"$ref":"#/components/examples/nonce_mismatch"},"demo_scan":{"$ref":"#/components/examples/demo_scan"},"sandbox_demo_only":{"$ref":"#/components/examples/sandbox_demo_only"}}}}},"Error":{"description":"Any other error: `not_found` (404, no such route) or `internal_error` (500). Every error has the shape { name, message, code, docs }.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"$ref":"#/components/examples/not_found"},"internal_error":{"$ref":"#/components/examples/internal_error"}}}}}},"schemas":{"Error":{"type":"object","required":["name","message","code","docs"],"properties":{"name":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"docs":{"type":"string"}}},"RoleId":{"type":"string","enum":["frontend","backend","fullstack","mobile","systems","ml-ai-engineer","data-engineer","qa-sdet","web3","devops-sre","ai-engineer","founding-engineer","forward-deployed","design-engineer","technical-pm","ai-pm","solutions-engineer","android","ios","react-native","flutter","game","embedded","platform","security","data-scientist","analytics-engineer","mlops","database","devrel"]},"Seniority":{"type":"string","enum":["intern","junior","mid","senior","staff"]},"RoleSpec":{"type":"object","required":["base"],"properties":{"base":{"$ref":"#/components/schemas/RoleId"},"seniority":{"$ref":"#/components/schemas/Seniority"},"must":{"type":"array","items":{"type":"string"}},"nice":{"type":"array","items":{"type":"string"}},"ai_usage":{"type":"string","enum":["expected","neutral","discouraged"]}}},"Role":{"type":"object","required":["id","label","pack","strength","languages","frameworks","focus","description"],"properties":{"id":{"$ref":"#/components/schemas/RoleId"},"label":{"type":"string"},"pack":{"type":"string","enum":["dev","ai-builder"]},"strength":{"type":"string","enum":["strong","medium","weak"]},"languages":{"type":"array","items":{"type":"string"}},"frameworks":{"type":"array","items":{"type":"string"}},"focus":{"type":"array","items":{"type":"string","enum":["tests","ai"]}},"description":{"type":"string"}}},"RoleList":{"type":"object","required":["object","data"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Role"}}}},"SuggestRole":{"type":"object","required":["description"],"properties":{"description":{"type":"string","maxLength":4000,"description":"The recruiter's own words. Only this is read (and, when the AI path is on, only this is sent to the model)."}}},"RoleSuggestion":{"type":"object","required":["object","role","role_label","seniority","seniority_stated","must","nice","nice_from_catalog","reasons","alternatives","weak","source","model"],"properties":{"object":{"const":"role_suggestion"},"role":{"type":["string","null"],"description":"A RoleId, or null when nothing points at a role"},"role_label":{"type":["string","null"]},"seniority":{"$ref":"#/components/schemas/Seniority"},"seniority_stated":{"type":"boolean"},"must":{"type":"array","items":{"type":"string"}},"nice":{"type":"array","items":{"type":"string"}},"nice_from_catalog":{"type":"array","items":{"type":"string"}},"reasons":{"type":"array","items":{"type":"object","required":["term","means","kind"],"properties":{"term":{"type":"string"},"means":{"type":"string"},"kind":{"type":"string","enum":["skill","role","seniority"]}}}},"alternatives":{"type":"array","items":{"type":"object","required":["id","label","terms"],"properties":{"id":{"$ref":"#/components/schemas/RoleId"},"label":{"type":"string"},"terms":{"type":"array","items":{"type":"string"}}}}},"weak":{"type":"boolean","description":"No role word matched: the role was guessed from skills alone, or there is none. Check it by hand."},"source":{"type":"string","enum":["rules","ai"]},"model":{"type":["string","null"]}}},"JobRole":{"type":"object","required":["base","seniority","must","nice","ai_usage"],"properties":{"base":{"$ref":"#/components/schemas/RoleId"},"seniority":{"$ref":"#/components/schemas/Seniority"},"must":{"type":"array","items":{"type":"string"}},"nice":{"type":"array","items":{"type":"string"}},"ai_usage":{"type":"string","enum":["expected","neutral","discouraged"]}}},"CreateJob":{"type":"object","required":["title","role"],"properties":{"title":{"type":"string","maxLength":200},"description":{"type":"string","maxLength":4000},"company":{"type":"string","maxLength":200,"description":"Shown to candidates on the apply page"},"role":{"oneOf":[{"$ref":"#/components/schemas/RoleId"},{"$ref":"#/components/schemas/RoleSpec"}]},"client_id":{"type":"string","description":"Your own id for this job (e.g. tenant:requisition). Repeating a create returns the existing job."}}},"JobCounts":{"type":"object","required":["total","invited","opened","consented","scanned","ready","insufficient_evidence","withdrawn"],"properties":{"total":{"type":"integer"},"invited":{"type":"integer"},"opened":{"type":"integer"},"consented":{"type":"integer"},"scanned":{"type":"integer"},"ready":{"type":"integer"},"insufficient_evidence":{"type":"integer"},"withdrawn":{"type":"integer"}}},"Job":{"type":"object","required":["object","id","client_id","title","description","company","role","role_label","status","apply_url","counts","created_at","closed_at"],"properties":{"object":{"const":"job"},"id":{"type":"string"},"client_id":{"type":["string","null"]},"title":{"type":"string"},"description":{"type":"string"},"company":{"type":["string","null"]},"role":{"$ref":"#/components/schemas/JobRole"},"role_label":{"type":"string"},"status":{"type":"string","enum":["open","closed"]},"apply_url":{"type":"string","description":"The one link every candidate gets"},"counts":{"$ref":"#/components/schemas/JobCounts"},"created_at":{"type":"string","format":"date-time"},"closed_at":{"type":["string","null"],"format":"date-time"}}},"JobList":{"type":"object","required":["object","data"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Job"}}}},"AddCandidate":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email"},"client_id":{"type":"string"}}},"Apply":{"type":"object","required":["github","consent"],"properties":{"github":{"type":"string","description":"Sandbox: one of the fictional developers (stands in for Sign in with GitHub). Production plan: GitHub OAuth."},"email":{"type":"string","format":"email"},"consent":{"const":true,"description":"The candidate saw what is shared and agreed"}}},"CandidateStatus":{"type":"string","enum":["invited","opened","consented","scanned","ready","insufficient_evidence","withdrawn"]},"Verdict":{"type":"string","enum":["verified","partially-verified","self-reported","insufficient-evidence"]},"Relevance":{"type":"string","enum":["strong","partial","weak","not-assessed"]},"Confidence":{"type":"string","enum":["high","medium","low"]},"Candidate":{"type":"object","required":["object","id","job_id","client_id","email","github","source","status","command","report_id","verdict","relevance","confidence","timeline","created_at","updated_at"],"properties":{"object":{"const":"candidate"},"id":{"type":"string"},"job_id":{"type":"string"},"client_id":{"type":["string","null"]},"email":{"type":["string","null"]},"github":{"type":["string","null"],"description":"Null until the candidate signs in"},"source":{"type":"string","enum":["apply_link","email"]},"status":{"$ref":"#/components/schemas/CandidateStatus"},"command":{"type":"string","description":"The one line the candidate pastes after consenting"},"report_id":{"type":["string","null"]},"verdict":{"oneOf":[{"$ref":"#/components/schemas/Verdict"},{"type":"null"}]},"relevance":{"oneOf":[{"$ref":"#/components/schemas/Relevance"},{"type":"null"}]},"confidence":{"oneOf":[{"$ref":"#/components/schemas/Confidence"},{"type":"null"}]},"timeline":{"type":"array","items":{"type":"object","required":["status","at"],"properties":{"status":{"description":"A status, or a report note that is not a status (`report_expired`, `report_deleted`).","oneOf":[{"$ref":"#/components/schemas/CandidateStatus"},{"type":"string","enum":["report_expired","report_deleted"]}]},"at":{"type":"string","format":"date-time"}}}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"CandidateList":{"type":"object","required":["object","data"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Candidate"}}}},"WorkingMetric":{"type":"object","description":"One habit with its own sample size. fraction: numerator / denominator, value 0-1. median: value in the metric's unit. count: an integer. value is null when the sample is too small to say anything.","required":["id","group","label","kind","value","numerator","denominator","sample","confidence","definition","sentence"],"properties":{"id":{"type":"string","enum":["explores_before_editing","edits_before_first_check","checks_after_editing","fixes_after_failures","recovers_from_failures","red_to_green_minutes","edits_kept","steers_the_agent","session_minutes","tool_calls_per_session","prompts_per_session","uses_subagents","active_days"]},"group":{"type":"string","enum":["planning","verification","steering","depth"]},"label":{"type":"string"},"kind":{"type":"string","enum":["fraction","median","count"]},"value":{"type":["number","null"]},"numerator":{"type":["integer","null"]},"denominator":{"type":["integer","null"]},"sample":{"type":"integer"},"confidence":{"type":"string","enum":["enough","thin","not-enough"]},"definition":{"type":"string"},"sentence":{"type":"string"}}},"WorkingWithAi":{"type":"object","description":"How the candidate works with AI coding agents (Claude Code, Cursor, Codex), computed on their laptop from session logs. Aggregate numbers only: no prompts, code, paths, commands or model output. Always self-reported. No single score.","required":["provenance","status","summary","sessions","agents","model_families","mcp_categories","metrics"],"properties":{"provenance":{"const":"self-reported"},"status":{"type":"string","enum":["analysed","not-enough-sessions","not-collected"]},"summary":{"type":"string"},"sessions":{"type":"integer"},"agents":{"type":"array","items":{"type":"object","required":["agent","sessions"],"properties":{"agent":{"type":"string","enum":["Claude Code","Cursor","Codex"]},"sessions":{"type":"integer"}}}},"model_families":{"type":"array","items":{"type":"string","enum":["claude-opus","claude-sonnet","claude-haiku","claude-other","gpt-4","gpt-5","gpt-6","gpt-other","openai-o","gemini","cursor","other"]}},"mcp_categories":{"type":"array","items":{"type":"object","required":["category","calls"],"properties":{"category":{"type":"string","enum":["browser","code-host","docs","database","cloud","issues","chat","memory","design","other"]},"calls":{"type":"integer"}}}},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/WorkingMetric"}}}},"Report":{"type":"object","required":["object","id","role","seniority","verdict","reason","confidence","identity","attribution","assessment","role_fit","working_with_ai","gaps","interview_questions","generated_at"],"properties":{"object":{"const":"report"},"id":{"type":"string"},"role":{"$ref":"#/components/schemas/RoleId"},"seniority":{"$ref":"#/components/schemas/Seniority"},"verdict":{"$ref":"#/components/schemas/Verdict"},"reason":{"type":"string"},"confidence":{"type":"string","enum":["high","medium","low"]},"identity":{"type":"object","required":["github","account_age_days","signed_share","provenance"],"properties":{"github":{"type":"string"},"account_age_days":{"type":"integer"},"signed_share":{"type":"number"},"provenance":{"const":"checked"}}},"attribution":{"type":"object","required":["sampled","matched","evidence_coverage","flags","provenance"],"properties":{"sampled":{"type":"integer"},"matched":{"type":"integer"},"evidence_coverage":{"type":"number"},"flags":{"type":"array","items":{"type":"string"}},"provenance":{"type":"string","enum":["checked","self-reported"]}}},"assessment":{"type":"object","required":["provenance","languages","test_share","ai_survival","ai_sessions","ai_tools"],"properties":{"provenance":{"const":"self-reported"},"languages":{"type":"array","items":{"type":"object","required":["language","share","years"],"properties":{"language":{"type":"string"},"framework":{"type":"string"},"share":{"type":"number"},"years":{"type":"number"}}}},"test_share":{"type":"number"},"ai_survival":{"type":"number"},"ai_sessions":{"type":"integer"},"ai_tools":{"type":"array","items":{"type":"string"}}}},"role_fit":{"type":"object","required":["relevance","relevant_share","matched_must","missing_must","matched_nice"],"properties":{"relevance":{"type":"string","enum":["strong","partial","weak","not-assessed"]},"relevant_share":{"type":"number"},"matched_must":{"type":"array","items":{"type":"string"}},"missing_must":{"type":"array","items":{"type":"string"}},"matched_nice":{"type":"array","items":{"type":"string"}}}},"working_with_ai":{"$ref":"#/components/schemas/WorkingWithAi"},"gaps":{"type":"array","items":{"type":"string"}},"interview_questions":{"type":"array","items":{"type":"string"}},"generated_at":{"type":"string","format":"date-time"}}},"Event":{"type":"object","required":["object","event_id","event_type","job_id","candidate_id","report_id","created_at"],"properties":{"object":{"const":"event"},"event_id":{"type":"string"},"event_type":{"type":"string","enum":["candidate.created","candidate.opened","candidate.consented","scan.received","report.ready","report.insufficient_evidence","consent.revoked","candidate.deleted"]},"job_id":{"type":"string"},"candidate_id":{"type":"string"},"report_id":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"}}},"Deleted":{"type":"object","required":["deleted"],"properties":{"deleted":{"const":true}}},"EmbedToken":{"type":"object","required":["object","token","url","expires_at"],"properties":{"object":{"const":"embed_token"},"token":{"type":"string","description":"Signed, read-only, for this report only."},"url":{"type":"string","format":"uri","description":"Put this in an iframe src. It works for 15 minutes, only on the account's embed origins."},"expires_at":{"type":"string","format":"date-time"}}},"EventList":{"type":"object","required":["object","data"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Event"}}}}},"examples":{"invalid_json":{"summary":"400 invalid_json: The body is missing, not JSON, or not a JSON object","value":{"name":"invalid_json","message":"Body must be a JSON object.","code":"invalid_json","docs":"https://docs.b55.ai/errors#invalid_json"}},"unauthorized":{"summary":"401 unauthorized: Missing key, or not a b55_test_ key","value":{"name":"unauthorized","message":"Send Authorization: Bearer b55_test_… (sandbox keys only).","code":"unauthorized","docs":"https://docs.b55.ai/errors#unauthorized"}},"live_keys_unavailable":{"summary":"401 live_keys_unavailable: A b55_live_ key sent to a sandbox-only server","value":{"name":"live_keys_unavailable","message":"This server runs the sandbox only. Use a b55_test_ key.","code":"live_keys_unavailable","docs":"https://docs.b55.ai/errors#live_keys_unavailable"}},"not_found":{"summary":"404 not_found: No such route","value":{"name":"not_found","message":"No route GET /api/v0/jobs/job_000001/nope.","code":"not_found","docs":"https://docs.b55.ai/errors#not_found"}},"job_not_found":{"summary":"404 job_not_found: Unknown job_id","value":{"name":"job_not_found","message":"No job job_999999.","code":"job_not_found","docs":"https://docs.b55.ai/errors#job_not_found"}},"candidate_not_found":{"summary":"404 candidate_not_found: Unknown candidate_id","value":{"name":"candidate_not_found","message":"No candidate cand_999999.","code":"candidate_not_found","docs":"https://docs.b55.ai/errors#candidate_not_found"}},"report_not_found":{"summary":"404 report_not_found: Unknown report_id","value":{"name":"report_not_found","message":"No report rpt_999999.","code":"report_not_found","docs":"https://docs.b55.ai/errors#report_not_found"}},"job_closed":{"summary":"409 job_closed: The job is closed and takes no new candidates","value":{"name":"job_closed","message":"Job job_000001 is closed and takes no new candidates.","code":"job_closed","docs":"https://docs.b55.ai/errors#job_closed"}},"candidate_finished":{"summary":"409 candidate_finished: The candidate already has a report","value":{"name":"candidate_finished","message":"Candidate is already ready.","code":"candidate_finished","docs":"https://docs.b55.ai/errors#candidate_finished"}},"consent_required":{"summary":"409 consent_required: A scan arrived before the candidate consented","value":{"name":"consent_required","message":"Candidate cand_000002 is invited. They must open the apply link and consent before a scan is accepted.","code":"consent_required","docs":"https://docs.b55.ai/errors#consent_required"}},"scan_replayed":{"summary":"409 scan_replayed: This exact scan was already accepted","value":{"name":"scan_replayed","message":"This exact scan was already received. Run the command again for a fresh scan.","code":"scan_replayed","docs":"https://docs.b55.ai/errors#scan_replayed"}},"invalid_query":{"summary":"422 invalid_query: A query parameter has a value outside its list","value":{"name":"invalid_query","message":"sort must be one of ranked, newest, oldest.","code":"invalid_query","docs":"https://docs.b55.ai/errors#invalid_query"}},"invalid_description":{"summary":"422 invalid_description: description is empty, not a string, or longer than 4000 characters","value":{"name":"invalid_description","message":"description must be a non-empty string of at most 4000 characters.","code":"invalid_description","docs":"https://docs.b55.ai/errors#invalid_description"}},"invalid_title":{"summary":"422 invalid_title: title is missing, empty or longer than 200 characters","value":{"name":"invalid_title","message":"title must be a non-empty string of at most 200 characters.","code":"invalid_title","docs":"https://docs.b55.ai/errors#invalid_title"}},"invalid_company":{"summary":"422 invalid_company: company is not a string, or longer than 200 characters","value":{"name":"invalid_company","message":"company must be a string of at most 200 characters.","code":"invalid_company","docs":"https://docs.b55.ai/errors#invalid_company"}},"invalid_client_id":{"summary":"422 invalid_client_id: client_id is not a string","value":{"name":"invalid_client_id","message":"client_id must be a string.","code":"invalid_client_id","docs":"https://docs.b55.ai/errors#invalid_client_id"}},"invalid_email":{"summary":"422 invalid_email: email is missing or not an email address","value":{"name":"invalid_email","message":"email must be an email address.","code":"invalid_email","docs":"https://docs.b55.ai/errors#invalid_email"}},"invalid_role":{"summary":"422 invalid_role: role is not a string or an object with base, or must/nice are not string arrays","value":{"name":"invalid_role","message":"role must be a role id string or an object with base.","code":"invalid_role","docs":"https://docs.b55.ai/errors#invalid_role"}},"role_not_supported":{"summary":"422 role_not_supported: role (or role.base) is not in the catalog","value":{"name":"role_not_supported","message":"Role \"recruiter\" is not supported. Call GET /v0/roles for the list.","code":"role_not_supported","docs":"https://docs.b55.ai/errors#role_not_supported"}},"invalid_seniority":{"summary":"422 invalid_seniority: role.seniority is not one of the Seniority values","value":{"name":"invalid_seniority","message":"seniority must be one of intern, junior, mid, senior, staff.","code":"invalid_seniority","docs":"https://docs.b55.ai/errors#invalid_seniority"}},"invalid_ai_usage":{"summary":"422 invalid_ai_usage: role.ai_usage is not expected, neutral or discouraged","value":{"name":"invalid_ai_usage","message":"ai_usage must be one of expected, neutral, discouraged.","code":"invalid_ai_usage","docs":"https://docs.b55.ai/errors#invalid_ai_usage"}},"invalid_github":{"summary":"422 invalid_github: github is not one of the sandbox developers","value":{"name":"invalid_github","message":"Sandbox: github must be one of maya-frontend, omar-backend, lin-mobile, ravi-systems, ada-agents, sam-private, nia-new, kai-quiet.","code":"invalid_github","docs":"https://docs.b55.ai/errors#invalid_github"}},"consent_missing":{"summary":"422 consent_missing: consent is not true","value":{"name":"consent_missing","message":"The candidate must see what is shared and consent: send \"consent\": true.","code":"consent_missing","docs":"https://docs.b55.ai/errors#consent_missing"}},"invalid_scan":{"summary":"422 invalid_scan: Not a valid signed ScanPayload, or it has extra top-level fields","value":{"name":"invalid_scan","message":"Not a valid scan: unknown field repoPath.","code":"invalid_scan","docs":"https://docs.b55.ai/errors#invalid_scan"}},"scan_integrity_failed":{"summary":"422 scan_integrity_failed: integrityHash does not match the payload","value":{"name":"scan_integrity_failed","message":"integrityHash does not match the payload. Send the payload exactly as the CLI signed it.","code":"scan_integrity_failed","docs":"https://docs.b55.ai/errors#scan_integrity_failed"}},"token_malformed":{"summary":"401 token_malformed: Not a B55 candidate token","value":{"name":"token_malformed","message":"That is not a B55 candidate token. Copy the command again from the apply page.","code":"token_malformed","docs":"https://docs.b55.ai/errors#token_malformed"}},"token_bad_signature":{"summary":"401 token_bad_signature: The token was not issued by this server","value":{"name":"token_bad_signature","message":"That token was not issued by this server. Copy the command again from the apply page.","code":"token_bad_signature","docs":"https://docs.b55.ai/errors#token_bad_signature"}},"token_expired":{"summary":"401 token_expired: The token is older than two hours","value":{"name":"token_expired","message":"This command expired. Get a new one from the apply page.","code":"token_expired","docs":"https://docs.b55.ai/errors#token_expired"}},"token_wrong_candidate":{"summary":"401 token_wrong_candidate: The token belongs to another candidate","value":{"name":"token_wrong_candidate","message":"This command is for a different application. Copy it again from the apply page.","code":"token_wrong_candidate","docs":"https://docs.b55.ai/errors#token_wrong_candidate"}},"token_unknown":{"summary":"401 token_unknown: No such token on this server","value":{"name":"token_unknown","message":"This command is not valid. Copy it again from the apply page.","code":"token_unknown","docs":"https://docs.b55.ai/errors#token_unknown"}},"token_revoked":{"summary":"401 token_revoked: A newer command replaced this one","value":{"name":"token_revoked","message":"This command was replaced by a newer one. Copy the latest from the apply page.","code":"token_revoked","docs":"https://docs.b55.ai/errors#token_revoked"}},"token_identity_mismatch":{"summary":"401 token_identity_mismatch: The token is bound to another GitHub sign-in","value":{"name":"token_identity_mismatch","message":"This command belongs to a different GitHub sign-in. Get a new one from the apply page.","code":"token_identity_mismatch","docs":"https://docs.b55.ai/errors#token_identity_mismatch"}},"token_used":{"summary":"409 token_used: The token was already used","value":{"name":"token_used","message":"This command was already used. Get a new one from the apply page.","code":"token_used","docs":"https://docs.b55.ai/errors#token_used"}},"nonce_mismatch":{"summary":"422 nonce_mismatch: The scan was signed for another token","value":{"name":"nonce_mismatch","message":"This scan was signed for a different command. Run the command from the apply page again.","code":"nonce_mismatch","docs":"https://docs.b55.ai/errors#nonce_mismatch"}},"demo_scan":{"summary":"422 demo_scan: A --demo scan was sent to a live job","value":{"name":"demo_scan","message":"Demo scans can’t be sent to a real job. Run the command without --demo.","code":"demo_scan","docs":"https://docs.b55.ai/errors#demo_scan"}},"sandbox_demo_only":{"summary":"422 sandbox_demo_only: The hosted sandbox only takes --demo scans","value":{"name":"sandbox_demo_only","message":"The public sandbox only takes --demo scans. Real scans go to a live job.","code":"sandbox_demo_only","docs":"https://docs.b55.ai/errors#sandbox_demo_only"}},"sandbox_fictional_only":{"summary":"422 sandbox_fictional_only: The hosted sandbox only takes made-up email addresses","value":{"name":"sandbox_fictional_only","message":"The public sandbox only takes made-up addresses (for example ada@example.com). Use a live key for real candidates.","code":"sandbox_fictional_only","docs":"https://docs.b55.ai/errors#sandbox_fictional_only"}},"embed_live_only":{"summary":"422 embed_live_only: Embed tokens are for live reports","value":{"name":"embed_live_only","message":"Embed tokens are for live reports. Sandbox reports embed without a token.","code":"embed_live_only","docs":"https://docs.b55.ai/errors#embed_live_only"}},"payload_too_large":{"summary":"413 payload_too_large: The body is over the size limit","value":{"name":"payload_too_large","message":"Bodies are limited to 256 KB.","code":"payload_too_large","docs":"https://docs.b55.ai/errors#payload_too_large"}},"rate_limited":{"summary":"429 rate_limited: Too many requests; retry after Retry-After seconds","value":{"name":"rate_limited","message":"Too many requests. Wait a minute and try again.","code":"rate_limited","docs":"https://docs.b55.ai/errors#rate_limited"}},"internal_error":{"summary":"500 internal_error: Unexpected server error","value":{"name":"internal_error","message":"Something went wrong.","code":"internal_error","docs":"https://docs.b55.ai/errors#internal_error"}}}}}