{"openapi":"3.1.0","info":{"title":"Elgarde API","description":"The Elgarde API. Everything under **`/v1`** is a free, public, no-auth tier —\nno key, no sign-up, CORS open to any origin, rate-limited per IP:\n\n- `GET /v1/checklist` — the adaptive pre-purchase inspection checklist in\n  English, Portuguese, Russian, Ukrainian and French.\n- `GET /v1/defects` — curated model-specific known weak points.\n- `POST /v1/score` — roll a sheet of 1–5 answers into an overall verdict.\n- `GET /v1/vin/{vin}` — VIN decode over the free NHTSA vPIC dataset.\n\nThe underlying data and the scoring specification are open\n([ElgardeCom/elgarde](https://github.com/ElgardeCom/elgarde),\nCC-BY-4.0). Please keep the attribution that every response carries, and cache\nresults rather than re-fetching static content.\n\nElgarde is a self-service checklist, not a certified, mechanical or legal\ninspection. Every other route on this service belongs to the Elgarde app and\nrequires authentication.\n","contact":{"name":"Elgarde","url":"https://elgarde.com/api/","email":"support@elgarde.com"},"license":{"name":"CC-BY-4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"version":"0.1.0"},"servers":[{"url":"https://api.elgarde.com/api","description":"Production"}],"paths":{"/v1/meta":{"get":{"tags":["public"],"summary":"Canon version, licence and attribution","description":"What this tier serves, which canon version it is on, and how to credit\nit. Free, no key, no auth.","operationId":"meta_v1_meta_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Meta V1 Meta Get"}}}}}}},"/v1/checklist":{"get":{"tags":["public"],"summary":"Adaptive pre-purchase inspection checklist","description":"The checklist for a car: base groups, the fuel-specific module, and the\nknown-defect group when the make/model matches a curated rule.","operationId":"checklist_v1_checklist_get","parameters":[{"name":"lang","in":"query","required":false,"schema":{"type":"string","description":"en · pt · ru · uk · fr (falls back to en)","default":"en","title":"Lang"},"description":"en · pt · ru · uk · fr (falls back to en)"},{"name":"fuel","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"petrol · diesel · hybrid · ev · other","title":"Fuel"},"description":"petrol · diesel · hybrid · ev · other"},{"name":"make","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Adds the model's known defects","title":"Make"},"description":"Adds the model's known defects"},{"name":"model","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Checklist V1 Checklist Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/defects":{"get":{"tags":["public"],"summary":"Known weak points for a make and model","description":"Curated, model-specific things to check — the DQ200 dry clutch, the\nPureTech wet belt, the N47 chain. Empty when nothing is curated for that\nmodel yet; that is not a statement that the model has no known issues.","operationId":"defects_v1_defects_get","parameters":[{"name":"make","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Make"}},{"name":"model","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"}},{"name":"lang","in":"query","required":false,"schema":{"type":"string","description":"en · pt (falls back to en)","default":"en","title":"Lang"},"description":"en · pt (falls back to en)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Defects V1 Defects Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/score":{"post":{"tags":["public"],"summary":"Score an inspection","description":"Roll a sheet of 1–5 answers up into group scores and one overall verdict.\nA failed critical item clamps the verdict down — see the scoring spec.","operationId":"score_v1_score_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScoreRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScoreResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/vin/{vin}":{"get":{"tags":["public"],"summary":"Decode a VIN (free NHTSA vPIC data)","description":"Normalise NHTSA vPIC output into a usable shape. US-centric and thin on\nEuropean models — partial results with nulls are normal, not an error.\nCached for 24h; please cache on your side too.","operationId":"vin_v1_vin__vin__get","parameters":[{"name":"vin","in":"path","required":true,"schema":{"type":"string","title":"Vin"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Vin V1 Vin  Vin  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/register":{"post":{"tags":["auth"],"summary":"Register","operationId":"register_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/login":{"post":{"tags":["auth"],"summary":"Login","operationId":"login_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/refresh":{"post":{"tags":["auth"],"summary":"Refresh","description":"Issue a fresh access token for an already-authenticated user — a sliding\nsession. The app calls this on launch/resume so the expiry rolls forward\nfrom the last time the user actually used the app (stay signed in for a week\nof inactivity, never a hard cut mid-use). Requires a still-valid token; once\nthe current one has expired the user signs in again.","operationId":"refresh_auth_refresh_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/auth/forgot":{"post":{"tags":["auth"],"summary":"Forgot Password","operationId":"forgot_password_auth_forgot_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/reset":{"post":{"tags":["auth"],"summary":"Reset Password","operationId":"reset_password_auth_reset_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/me":{"get":{"tags":["auth"],"summary":"Me","operationId":"me_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserOut"}}}}},"security":[{"HTTPBearer":[]}]}},"/cars/decode/{vin}":{"get":{"tags":["cars"],"summary":"Decode","description":"Decode a VIN via the free (unlimited) vPIC path. Returns partial fields\n(nulls) when unknown. Auth-gated but not usage-capped.","operationId":"decode_cars_decode__vin__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"vin","in":"path","required":true,"schema":{"type":"string","title":"Vin"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Decode Cars Decode  Vin  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/reports":{"post":{"tags":["reports"],"summary":"Create Report","operationId":"create_report_reports_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Org Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportPayload"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/reports/{token}":{"put":{"tags":["reports"],"summary":"Update Report","description":"Re-snapshot an existing report under the SAME token (owner-only), so the\npublic link stays stable when the inspector re-publishes an edited report.\nThe published flag is preserved — updating an already-public report keeps it\nlive with fresh content; updating a private one leaves it private.","operationId":"update_report_reports__token__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportPayload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["reports"],"summary":"Delete Report","description":"Owner erasure (GDPR right-to-be-forgotten). Only the report's owner can\ndelete it.","operationId":"delete_report_reports__token__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/reports/{token}/publish":{"post":{"tags":["reports"],"summary":"Publish Report","description":"Make a saved report public (owner-only). Returns the shareable link — on\nthe owner's org custom domain when set, else the platform default.","operationId":"publish_report_reports__token__publish_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/r/{token}":{"get":{"tags":["reports"],"summary":"Public Report","operationId":"public_report_r__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}},{"name":"lang","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lang"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/r/{token}/pdf":{"get":{"tags":["reports"],"summary":"Public Report Pdf","operationId":"public_report_pdf_r__token__pdf_get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}},{"name":"lang","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lang"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/drafts/{draft_id}":{"put":{"tags":["drafts"],"summary":"Upsert Draft","operationId":"upsert_draft_drafts__draft_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","title":"Draft Id"}},{"name":"known_updated_at","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Known Updated At"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["drafts"],"summary":"Delete Draft","operationId":"delete_draft_drafts__draft_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","title":"Draft Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/drafts":{"get":{"tags":["drafts"],"summary":"List Drafts","operationId":"list_drafts_drafts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response List Drafts Drafts Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/attachments":{"post":{"tags":["attachments"],"summary":"Upload","description":"Store a photo or document in object storage; returns its media key.\n\nPhotos (CLA-115) default to image/jpeg. Documents (CLA-188) may be any\nwhitelisted type; the original filename + content-type are preserved so\nserving returns the right type and a download filename.","operationId":"upload_attachments_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_attachments_post"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Upload Attachments Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/media/{key}":{"get":{"tags":["attachments"],"summary":"Media","description":"Public — reports embed these. Content-addressed → immutable cache.","operationId":"media_media__key__get","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs":{"get":{"tags":["orgs"],"summary":"My Orgs","operationId":"my_orgs_orgs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/OrgSummary"},"type":"array","title":"Response My Orgs Orgs Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["orgs"],"summary":"Create Org","operationId":"create_org_orgs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/orgs/{org_id}":{"get":{"tags":["orgs"],"summary":"Org Detail","operationId":"org_detail_orgs__org_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["orgs"],"summary":"Delete Org","operationId":"delete_org_orgs__org_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/sponsor":{"post":{"tags":["orgs"],"summary":"Set Sponsor","description":"Staff-only: flag an org as sponsored → all its members are Pro (CLA-173).\nReplaces promo codes; there is no user-facing redeem path.","operationId":"set_sponsor_orgs__org_id__sponsor_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_set_sponsor_orgs__org_id__sponsor_post"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/domain":{"put":{"tags":["orgs"],"summary":"Set Domain","description":"Admin only: register (or clear) the org's own hostname for white-label\nreport links. Serving TLS on it is provisioned manually by the Elgarde\nteam after the DNS check passes; this only stores the hostname.","operationId":"set_domain_orgs__org_id__domain_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainUpdate"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["orgs"],"summary":"Domain Status","description":"Member view: the stored domain plus a live DNS check. Resolving the\nhostname covers both an A record (→ our IP) and a CNAME (→ app.elgarde.com,\nwhich itself resolves to our IP), so one lookup verifies either setup.","operationId":"domain_status_orgs__org_id__domain_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/members/{target_id}/role":{"post":{"tags":["orgs"],"summary":"Set Member Role","operationId":"set_member_role_orgs__org_id__members__target_id__role_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"target_id","in":"path","required":true,"schema":{"type":"string","title":"Target Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_set_member_role_orgs__org_id__members__target_id__role_post"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/members/{target_id}":{"delete":{"tags":["orgs"],"summary":"Remove Member","operationId":"remove_member_orgs__org_id__members__target_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"target_id","in":"path","required":true,"schema":{"type":"string","title":"Target Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/leave":{"post":{"tags":["orgs"],"summary":"Leave Org","description":"Leave an org you belong to. The owner must delete the org instead.\nRe-joining later requires a fresh invite code from the org owner.","operationId":"leave_org_orgs__org_id__leave_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/invites":{"post":{"tags":["orgs"],"summary":"Create Invites","operationId":"create_invites_orgs__org_id__invites_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Invite"},"title":"Response Create Invites Orgs  Org Id  Invites Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["orgs"],"summary":"List Invites","operationId":"list_invites_orgs__org_id__invites_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Invite"},"title":"Response List Invites Orgs  Org Id  Invites Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/invites/{code}/revoke":{"post":{"tags":["orgs"],"summary":"Revoke Invite","operationId":"revoke_invite_orgs__org_id__invites__code__revoke_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}},{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/invites/{code}/redeem":{"post":{"tags":["orgs"],"summary":"Redeem Invite","operationId":"redeem_invite_invites__code__redeem_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JoinResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/orgs/{org_id}/branding":{"get":{"tags":["branding"],"summary":"Get Branding","operationId":"get_branding_orgs__org_id__branding_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Branding"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["branding"],"summary":"Put Branding","operationId":"put_branding_orgs__org_id__branding_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandingUpdate"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/me/entitlement":{"get":{"tags":["me"],"summary":"My Entitlement","operationId":"my_entitlement_me_entitlement_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitlementStatus"}}}}},"security":[{"HTTPBearer":[]}]}},"/me/usage":{"get":{"tags":["me"],"summary":"My Usage","operationId":"my_usage_me_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageStatus"}}}}},"security":[{"HTTPBearer":[]}]}},"/admin/user":{"get":{"tags":["admin"],"summary":"Lookup","operationId":"lookup_admin_user_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string","title":"Email"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Lookup Admin User Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/metrics":{"get":{"tags":["admin"],"summary":"Metrics","description":"Product dashboard metrics. Activity is derived from the only per-user\ntimestamps the web app writes: report creation (report_snapshots) and draft\nedits (user_drafts) — there is no passive-login tracking. Days are bucketed\nin Europe/Lisbon. 'Lessons'/output == inspections, i.e. reports. Synthetic /\ninternal accounts are excluded unless ?includeTest=true. The daily `series`\nspans the last `days` days (clamped 1..366), or an explicit\n`date_from`..`date_to` window when both are given.","operationId":"metrics_admin_metrics_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"include_test","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Test"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Metrics Admin Metrics Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/users":{"get":{"tags":["admin"],"summary":"Users List","description":"Every user with their activity: reports (created/published), photos,\ndrafts, Pro status, org memberships, and last-active (max of report creation\n/ draft edit — the only activity signals). Ordered most-recently-active\nfirst. Synthetic/internal accounts are excluded unless ?includeTest=true.","operationId":"users_list_admin_users_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"include_test","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Test"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Users List Admin Users Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/pro":{"post":{"tags":["admin"],"summary":"Grant Pro","description":"Grant Pro. months>0 → a subscription entitlement expiring then;\notherwise a permanent staff-source comp.","operationId":"grant_pro_admin_pro_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantReq"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Grant Pro Admin Pro Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]},"delete":{"tags":["admin"],"summary":"Revoke Pro","description":"Remove all entitlements for the user and demote a legacy 'pro' role.","operationId":"revoke_pro_admin_pro_delete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailReq"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Revoke Pro Admin Pro Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/health":{"get":{"summary":"Health","description":"Liveness — process is up.","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Health Health Get"}}}}}}},"/health/db":{"get":{"summary":"Health Db","description":"Readiness — database reachable.","operationId":"health_db_health_db_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Health Db Health Db Get"}}}}}}}},"components":{"schemas":{"Body_set_member_role_orgs__org_id__members__target_id__role_post":{"properties":{"new_role":{"type":"string","title":"New Role"}},"type":"object","required":["new_role"],"title":"Body_set_member_role_orgs__org_id__members__target_id__role_post"},"Body_set_sponsor_orgs__org_id__sponsor_post":{"properties":{"sponsored":{"type":"boolean","title":"Sponsored"}},"type":"object","required":["sponsored"],"title":"Body_set_sponsor_orgs__org_id__sponsor_post"},"Body_upload_attachments_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_attachments_post"},"Branding":{"properties":{"logo_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Key"},"contact_block":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Block"},"contact":{"anyOf":[{"$ref":"#/components/schemas/Contact"},{"type":"null"}]},"template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template"}},"type":"object","title":"Branding"},"BrandingUpdate":{"properties":{"logo_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Key"},"contact_block":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Block"},"contact":{"anyOf":[{"$ref":"#/components/schemas/Contact"},{"type":"null"}]},"template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template"}},"type":"object","title":"BrandingUpdate"},"Contact":{"properties":{"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"website":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Website"},"instagram":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instagram"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}},"type":"object","title":"Contact","description":"Structured white-label contact details (extensible). Superseeds the legacy\nfree-text ``contact_block``; add fields here as new channels are needed."},"DomainStatus":{"properties":{"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"},"expected_ip":{"type":"string","title":"Expected Ip"},"expected_host":{"type":"string","title":"Expected Host"},"verified":{"type":"boolean","title":"Verified"},"resolved_ip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved Ip"}},"type":"object","required":["domain","expected_ip","expected_host","verified","resolved_ip"],"title":"DomainStatus"},"DomainUpdate":{"properties":{"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"}},"type":"object","title":"DomainUpdate"},"DtcCode":{"properties":{"code":{"type":"string","title":"Code","default":""},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","title":"DtcCode"},"EmailReq":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","required":["email"],"title":"EmailReq"},"EntitlementStatus":{"properties":{"is_pro":{"type":"boolean","title":"Is Pro"},"pro_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Pro Until"}},"type":"object","required":["is_pro"],"title":"EntitlementStatus"},"ForgotPasswordRequest":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","required":["email"],"title":"ForgotPasswordRequest"},"GrantReq":{"properties":{"email":{"type":"string","title":"Email"},"months":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Months"}},"type":"object","required":["email"],"title":"GrantReq"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"Invite":{"properties":{"code":{"type":"string","title":"Code"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"max_redemptions":{"type":"integer","title":"Max Redemptions"},"redeemed_count":{"type":"integer","title":"Redeemed Count"},"revoked":{"type":"boolean","title":"Revoked"}},"type":"object","required":["code","expires_at","max_redemptions","redeemed_count","revoked"],"title":"Invite"},"InviteCreate":{"properties":{"count":{"type":"integer","title":"Count","default":1},"max_redemptions":{"type":"integer","title":"Max Redemptions","default":1},"expires_days":{"type":"integer","title":"Expires Days","default":7}},"type":"object","title":"InviteCreate"},"JoinResult":{"properties":{"org_id":{"type":"string","title":"Org Id"},"name":{"type":"string","title":"Name"},"role":{"type":"string","title":"Role"}},"type":"object","required":["org_id","name","role"],"title":"JoinResult"},"LoginRequest":{"properties":{"email":{"type":"string","title":"Email"},"password":{"type":"string","title":"Password"}},"type":"object","required":["email","password"],"title":"LoginRequest"},"Member":{"properties":{"user_id":{"type":"string","title":"User Id"},"role":{"type":"string","title":"Role"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}},"type":"object","required":["user_id","role"],"title":"Member"},"Odometer":{"properties":{"readings":{"items":{"$ref":"#/components/schemas/OdometerReading"},"type":"array","title":"Readings","default":[]},"rollbackSuspected":{"type":"boolean","title":"Rollbacksuspected","default":false}},"type":"object","title":"Odometer"},"OdometerReading":{"properties":{"date":{"type":"string","title":"Date","default":""},"km":{"type":"integer","title":"Km","default":0},"source":{"type":"string","title":"Source","default":"other"},"sourceLabel":{"anyOf":[{"type":"string"},{"additionalProperties":{"type":"string"},"type":"object"}],"title":"Sourcelabel","default":""}},"type":"object","title":"OdometerReading"},"OkResponse":{"properties":{"ok":{"type":"boolean","title":"Ok","default":true}},"type":"object","title":"OkResponse"},"OrgCreate":{"properties":{"name":{"type":"string","title":"Name"}},"type":"object","required":["name"],"title":"OrgCreate"},"OrgDetail":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"owner_user_id":{"type":"string","title":"Owner User Id"},"my_role":{"type":"string","title":"My Role"},"members":{"items":{"$ref":"#/components/schemas/Member"},"type":"array","title":"Members"},"custom_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custom Domain"}},"type":"object","required":["id","name","owner_user_id","my_role","members"],"title":"OrgDetail"},"OrgSummary":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"role":{"type":"string","title":"Role"}},"type":"object","required":["id","name","role"],"title":"OrgSummary"},"RegisterRequest":{"properties":{"email":{"type":"string","title":"Email"},"password":{"type":"string","title":"Password"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"}},"type":"object","required":["email","password"],"title":"RegisterRequest"},"ReportCar":{"properties":{"vin":{"type":"string","title":"Vin"},"make":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Make"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"year":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Year"},"fuelType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fueltype"},"bodyStyle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bodystyle"}},"type":"object","required":["vin"],"title":"ReportCar"},"ReportCreated":{"properties":{"token":{"type":"string","title":"Token"},"path":{"type":"string","title":"Path"}},"type":"object","required":["token","path"],"title":"ReportCreated"},"ReportDamage":{"properties":{"location":{"anyOf":[{"type":"string"},{"additionalProperties":{"type":"string"},"type":"object"}],"title":"Location"},"type":{"anyOf":[{"type":"string"},{"additionalProperties":{"type":"string"},"type":"object"}],"title":"Type"},"severity":{"type":"string","title":"Severity","default":"minor"},"severityLabel":{"anyOf":[{"type":"string"},{"additionalProperties":{"type":"string"},"type":"object"}],"title":"Severitylabel","default":""},"severityLevel":{"type":"integer","title":"Severitylevel","default":1},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"photos":{"items":{"type":"string"},"type":"array","title":"Photos","default":[]}},"type":"object","required":["location","type"],"title":"ReportDamage"},"ReportDocument":{"properties":{"mediaKey":{"type":"string","title":"Mediakey"},"filename":{"type":"string","title":"Filename","default":"document"},"contentType":{"type":"string","title":"Contenttype","default":"application/octet-stream"},"sizeBytes":{"type":"integer","title":"Sizebytes","default":0},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"type":{"type":"string","title":"Type","default":"other"},"typeLabel":{"anyOf":[{"type":"string"},{"additionalProperties":{"type":"string"},"type":"object"}],"title":"Typelabel","default":""}},"type":"object","required":["mediaKey"],"title":"ReportDocument"},"ReportGeo":{"properties":{"lat":{"type":"number","title":"Lat"},"lng":{"type":"number","title":"Lng"},"place":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Place"}},"type":"object","required":["lat","lng"],"title":"ReportGeo"},"ReportGroup":{"properties":{"title":{"anyOf":[{"type":"string"},{"additionalProperties":{"type":"string"},"type":"object"}],"title":"Title"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score"},"items":{"items":{"$ref":"#/components/schemas/ReportItem"},"type":"array","title":"Items","default":[]},"children":{"items":{"$ref":"#/components/schemas/ReportGroup"},"type":"array","title":"Children","default":[]}},"type":"object","required":["title"],"title":"ReportGroup"},"ReportItem":{"properties":{"prompt":{"anyOf":[{"type":"string"},{"additionalProperties":{"type":"string"},"type":"object"}],"title":"Prompt"},"score":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Score"},"na":{"type":"boolean","title":"Na","default":false},"skipped":{"type":"boolean","title":"Skipped","default":false},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"critical":{"type":"boolean","title":"Critical","default":false},"photos":{"items":{"type":"string"},"type":"array","title":"Photos","default":[]}},"type":"object","required":["prompt"],"title":"ReportItem"},"ReportPayload":{"properties":{"car":{"$ref":"#/components/schemas/ReportCar"},"overall":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Overall"},"groups":{"items":{"$ref":"#/components/schemas/ReportGroup"},"type":"array","title":"Groups","default":[]},"lang":{"type":"string","title":"Lang","default":"en"},"inspector":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inspector"},"createdAt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Createdat"},"inspectedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inspectedat"},"geo":{"anyOf":[{"$ref":"#/components/schemas/ReportGeo"},{"type":"null"}]},"damages":{"items":{"$ref":"#/components/schemas/ReportDamage"},"type":"array","title":"Damages","default":[]},"documents":{"items":{"$ref":"#/components/schemas/ReportDocument"},"type":"array","title":"Documents","default":[]},"odometer":{"anyOf":[{"$ref":"#/components/schemas/Odometer"},{"type":"null"}]},"dtcCodes":{"items":{"$ref":"#/components/schemas/DtcCode"},"type":"array","title":"Dtccodes","default":[]}},"type":"object","required":["car"],"title":"ReportPayload"},"ResetPasswordRequest":{"properties":{"token":{"type":"string","title":"Token"},"new_password":{"type":"string","title":"New Password"}},"type":"object","required":["token","new_password"],"title":"ResetPasswordRequest"},"ScoreRequest":{"properties":{"scores":{"additionalProperties":{"anyOf":[{"type":"integer"},{"type":"null"}]},"type":"object","title":"Scores"},"make":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Make"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"fuelType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fueltype"},"criticalThreshold":{"type":"integer","maximum":5.0,"minimum":1.0,"title":"Criticalthreshold","default":2}},"type":"object","title":"ScoreRequest","description":"Scores keyed by checklist item id. 1–5 rates the item; -1 marks it not\napplicable, -2 not inspected; omit an item to leave it unanswered."},"ScoreResponse":{"properties":{"overall":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Overall"},"overallBeforeClamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Overallbeforeclamp"},"groupScores":{"additionalProperties":{"anyOf":[{"type":"number"},{"type":"null"}]},"type":"object","title":"Groupscores"},"answered":{"type":"integer","title":"Answered"},"total":{"type":"integer","title":"Total"},"clampedBy":{"items":{"type":"string"},"type":"array","title":"Clampedby"},"attribution":{"additionalProperties":true,"type":"object","title":"Attribution"},"disclaimer":{"type":"string","title":"Disclaimer"}},"type":"object","required":["overall","overallBeforeClamp","groupScores","answered","total","clampedBy","attribution","disclaimer"],"title":"ScoreResponse"},"TokenResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"user":{"$ref":"#/components/schemas/UserOut"}},"type":"object","required":["access_token","user"],"title":"TokenResponse"},"UsageStatus":{"properties":{"is_pro":{"type":"boolean","title":"Is Pro"},"inspections_used":{"type":"integer","title":"Inspections Used"},"inspections_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Inspections Limit"},"vin_used":{"type":"integer","title":"Vin Used"},"vin_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Vin Limit"}},"type":"object","required":["is_pro","inspections_used","vin_used"],"title":"UsageStatus"},"UserOut":{"properties":{"id":{"type":"string","title":"Id"},"role":{"type":"string","title":"Role"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"}},"type":"object","required":["id","role"],"title":"UserOut"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}},"tags":[{"name":"public","description":"Free, unauthenticated tier. No key required.","externalDocs":{"description":"API docs","url":"https://elgarde.com/api/"}}]}