{"openapi":"3.1.0","info":{"title":"Linkwiz API","version":"1.0.0-rc.1","description":"Release candidate for workspace reports and supplied LinkedIn profiles. Read reports, profile results and scan progress; create reports; validate and import JSON profiles. Added and restored profiles automatically queue scanning. Availability is controlled per workspace. This specification does not announce general availability."},"servers":[{"url":"https://app.linkwiz.ai/api/v1","description":"Production host — workspace access must be enabled. For a preview, use its supplied base URL."}],"security":[{"LinkwizKey":[]}],"paths":{"/context":{"get":{"operationId":"getContext","summary":"Read the calling key's workspace and permissions","parameters":[],"x-required-scopes":["workspace:read"],"responses":{"200":{"description":"Success. Cache-Control: no-store; X-Request-ID matches request_id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextResponse"}}}},"400":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"description":"Seconds until the current UTC minute window ends.","schema":{"type":"integer","minimum":1}}}},"500":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/workspace":{"get":{"operationId":"getWorkspace","summary":"Read the bound workspace","parameters":[],"x-required-scopes":["workspace:read"],"responses":{"200":{"description":"Success. Cache-Control: no-store; X-Request-ID matches request_id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceResponse"}}}},"400":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"description":"Seconds until the current UTC minute window ends.","schema":{"type":"integer","minimum":1}}}},"500":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/reports":{"get":{"operationId":"listReports","summary":"List workspace reports","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":2048,"description":"Signed opaque cursor bound to workspace, route, filters and the first-page upper watermark. Invalid or changed bindings return 400."}},{"name":"company_root_domain","in":"query","required":false,"schema":{"type":"string","description":"Hostname or HTTP(S) company URL. Normalized using public and private suffix rules; matches the root and its subdomains."}},{"name":"include_archived","in":"query","required":false,"schema":{"type":"boolean","default":false}}],"x-required-scopes":["reports:read"],"responses":{"200":{"description":"Success. Cache-Control: no-store; X-Request-ID matches request_id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportCollection"}}}},"400":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"description":"Seconds until the current UTC minute window ends.","schema":{"type":"integer","minimum":1}}}},"500":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createReport","summary":"Create a report and queue supplied profiles","description":"JSON only; maximum 1 MiB and 100 people. All rows validate before mutation. Unknown fields rejected. Duplicates keep the first occurrence. Empty reports queue no scans; populated reports queue full_profile for people and activity for people plus the company page. No external lookup occurs during creation. Default create permits separate reports for one company. return_existing returns workspace matches across all states without adding supplied people. Separate idempotency keys represent separate intents.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,128}$"}}],"x-required-scopes":["reports:create","reports:read"],"x-required-scopes-with-profiles":["profiles:add"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateReport"}}}},"responses":{"200":{"description":"All matching report references, capped at 100. Follow next_cursor through GET /reports?company_root_domain=...&include_archived=true. Supplied profiles are not added and no scans start.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExistingReportsResponse"}}},"headers":{"Idempotency-Replayed":{"description":"true on a replay, with original status and saved data.","schema":{"type":"string","const":"true"}}}},"201":{"description":"Report and queue records committed atomically. Location points to report GET. Scan completion is asynchronous.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedReportResponse"}}},"headers":{"Idempotency-Replayed":{"description":"true on a replay, with original status and saved data.","schema":{"type":"string","const":"true"}},"Location":{"schema":{"type":"string","format":"uri"}}}},"400":{"description":"Redacted JSON error. For 429 honor Retry-After; for an uncertain result retry the same body and Idempotency-Key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Redacted JSON error. For 429 honor Retry-After; for an uncertain result retry the same body and Idempotency-Key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Redacted JSON error. For 429 honor Retry-After; for an uncertain result retry the same body and Idempotency-Key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Redacted JSON error. For 429 honor Retry-After; for an uncertain result retry the same body and Idempotency-Key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Redacted JSON error. For 429 honor Retry-After; for an uncertain result retry the same body and Idempotency-Key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Redacted JSON error. For 429 honor Retry-After; for an uncertain result retry the same body and Idempotency-Key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Redacted JSON error. For 429 honor Retry-After; for an uncertain result retry the same body and Idempotency-Key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Redacted JSON error. For 429 honor Retry-After; for an uncertain result retry the same body and Idempotency-Key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Redacted JSON error. For 429 honor Retry-After; for an uncertain result retry the same body and Idempotency-Key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Redacted JSON error. For 429 honor Retry-After; for an uncertain result retry the same body and Idempotency-Key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Redacted JSON error. For 429 honor Retry-After; for an uncertain result retry the same body and Idempotency-Key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/reports/{report_id}":{"get":{"operationId":"getReport","summary":"Read one report","parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"x-required-scopes":["reports:read"],"responses":{"200":{"description":"Success. Cache-Control: no-store; X-Request-ID matches request_id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportResponse"}}}},"400":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"description":"Seconds until the current UTC minute window ends.","schema":{"type":"integer","minimum":1}}}},"500":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/reports/{report_id}/profiles":{"get":{"operationId":"listReportProfiles","summary":"List active personal profile attachments","parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":2048,"description":"Signed opaque cursor bound to workspace, route, filters and the first-page upper watermark. Invalid or changed bindings return 400."}}],"x-required-scopes":["profiles:read"],"responses":{"200":{"description":"Success. Cache-Control: no-store; X-Request-ID matches request_id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileCollection"}}}},"400":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"description":"Seconds until the current UTC minute window ends.","schema":{"type":"integer","minimum":1}}}},"500":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/reports/{report_id}/scans/{scan_run_id}":{"get":{"operationId":"getReportScan","summary":"Read scan status and counts","parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"scan_run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"x-required-scopes":["reports:read"],"responses":{"200":{"description":"Success. Cache-Control: no-store; X-Request-ID matches request_id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanResponse"}}}},"400":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"description":"Seconds until the current UTC minute window ends.","schema":{"type":"integer","minimum":1}}}},"500":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"JSON error. No token, raw database error or submitted value is echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/reports/{report_id}/profile-imports":{"post":{"operationId":"importProfiles","summary":"Validate or add people to an existing report","description":"JSON only, 1–100 people, at most 1 MiB. Whole-batch validation. validation_only=true creates no roster changes, receipt, retry reservation or scans, but counts against request admission. Commit rechecks current state. Added/restored people queue full-profile and activity jobs; duplicates queue nothing. Removed people are restored with a note and preserved details/history. Receipts omit supplied names and URLs. Idempotency-Key is required for commits, scoped to workspace, operation and report; same normalized ordered body replays the saved receipt for 30 days, different body returns 409. Existing archived reports return 409. Shares configurable write limits with report creation. Default ceilings: 10 requests/key/minute, 50/workspace/minute and 1000 submitted rows/workspace/minute; workspace settings may differ.","x-required-scopes":["reports:read","profiles:add"],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"validation_only","in":"query","schema":{"type":"boolean","default":false}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Required unless validation_only=true. Use a new key for each intended commit; reuse it only to recover that request.","schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileImport"}}}},"responses":{"200":{"description":"Preview only; state may change before commit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportValidationResponse"}}}},"201":{"description":"Import committed or saved receipt replayed. Scan status is a separate read.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportReceiptResponse"}}},"headers":{"Location":{"schema":{"type":"string","format":"uri"},"description":"Absolute saved receipt endpoint."},"Idempotency-Replayed":{"schema":{"const":"true"},"description":"Present only when returning the saved result."}}},"400":{"description":"No-store JSON error with X-Request-ID. No supplied personal values, keys or internal database errors are echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No-store JSON error with X-Request-ID. No supplied personal values, keys or internal database errors are echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"No-store JSON error with X-Request-ID. No supplied personal values, keys or internal database errors are echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No-store JSON error with X-Request-ID. No supplied personal values, keys or internal database errors are echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"No-store JSON error with X-Request-ID. No supplied personal values, keys or internal database errors are echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"No-store JSON error with X-Request-ID. No supplied personal values, keys or internal database errors are echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"No-store JSON error with X-Request-ID. No supplied personal values, keys or internal database errors are echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"No-store JSON error with X-Request-ID. No supplied personal values, keys or internal database errors are echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportValidationError"}}}},"429":{"description":"No-store JSON error with X-Request-ID. No supplied personal values, keys or internal database errors are echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds until the UTC minute window ends."}}},"500":{"description":"No-store JSON error with X-Request-ID. No supplied personal values, keys or internal database errors are echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"No-store JSON error with X-Request-ID. No supplied personal values, keys or internal database errors are echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/reports/{report_id}/profile-imports/{import_id}":{"get":{"operationId":"getProfileImport","summary":"Recover a saved import receipt","description":"Requires current access; receipt contents are immutable and are not live scan status. Known authorized receipts expire after 30 days (410); wrong report/workspace or unknown receipt returns 404. Shares read limits: 60 requests/key/minute and 300/workspace/minute.","x-required-scopes":["imports:read"],"parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"import_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Saved receipt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportReceiptResponse"}}}},"400":{"description":"No-store JSON error with X-Request-ID. No supplied personal values, keys or internal database errors are echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No-store JSON error with X-Request-ID. No supplied personal values, keys or internal database errors are echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"No-store JSON error with X-Request-ID. No supplied personal values, keys or internal database errors are echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No-store JSON error with X-Request-ID. No supplied personal values, keys or internal database errors are echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"No-store JSON error with X-Request-ID. No supplied personal values, keys or internal database errors are echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"No-store JSON error with X-Request-ID. No supplied personal values, keys or internal database errors are echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds until the UTC minute window ends."}}},"500":{"description":"No-store JSON error with X-Request-ID. No supplied personal values, keys or internal database errors are echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"No-store JSON error with X-Request-ID. No supplied personal values, keys or internal database errors are echoed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"LinkwizKey":{"type":"http","scheme":"bearer","bearerFormat":"lw_test_… or lw_live_…"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},"request_id":{"type":"string","format":"uuid"}},"required":["error","request_id"],"additionalProperties":false},"Context":{"type":"object","properties":{"key_id":{"type":"string","format":"uuid"},"user_id":{"type":"string","format":"uuid"},"workspace_id":{"type":"string","format":"uuid"},"scopes":{"type":"array","items":{"enum":["*","workspace:read","reports:read","profiles:read","reports:create","profiles:add"]}},"limits":{"type":"object","properties":{"reads_per_minute_per_key":{"const":60},"reads_per_minute_per_workspace":{"const":300},"page_size_max":{"const":100},"writes_per_minute_per_key":{"type":"integer","const":10},"writes_per_minute_per_workspace":{"type":"integer","const":50},"submitted_profiles_per_minute_per_workspace":{"type":"integer","const":1000},"profiles_per_write_max":{"type":"integer","const":100}},"required":["reads_per_minute_per_key","reads_per_minute_per_workspace","page_size_max","writes_per_minute_per_key","writes_per_minute_per_workspace","submitted_profiles_per_minute_per_workspace","profiles_per_write_max"],"additionalProperties":false}},"required":["key_id","user_id","workspace_id","scopes","limits"],"additionalProperties":false},"Workspace":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"status":{"const":"active"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","slug","status","created_at","updated_at"],"additionalProperties":false},"Report":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"workspace_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"company":{"type":"object","properties":{"name":{"type":"string"},"supplied_domain":{"type":"string"},"root_domain":{"type":["string","null"]},"linkedin_company_url":{"type":"string","format":"uri"}},"required":["name","supplied_domain","root_domain","linkedin_company_url"],"additionalProperties":false},"visibility":{"enum":["private","public"]},"archived":{"type":"boolean"},"analysis_state":{"enum":["not_requested","queued","running","available","failed"]},"profile_count":{"type":"integer","minimum":0},"analyzed_profile_count":{"type":"integer","minimum":0},"public_url":{"type":["string","null"],"format":"uri"},"workspace_url":{"type":"string","format":"uri"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","workspace_id","name","company","visibility","archived","analysis_state","profile_count","analyzed_profile_count","public_url","workspace_url","created_at","updated_at"],"additionalProperties":false},"Profile":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"report_id":{"type":"string","format":"uuid"},"linkedin_url":{"type":"string","format":"uri"},"name":{"type":["string","null"]},"title":{"type":["string","null"]},"headline":{"type":["string","null"]},"source":{"enum":["urls","finder","ops","migration","api_import"]},"analysis_available":{"type":"boolean"},"added_at":{"type":"string","format":"date-time"}},"required":["id","report_id","linkedin_url","name","title","headline","source","analysis_available","added_at"],"additionalProperties":false},"Scan":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"report_id":{"type":"string","format":"uuid"},"mode":{"enum":["full_profile","activity"]},"status":{"enum":["queued","running","completed","partial","failed","inaccessible","cancelled"]},"counts":{"type":"object","properties":{"requested":{"type":"integer","minimum":0},"completed":{"type":"integer","minimum":0},"warnings":{"type":"integer","minimum":0},"failed":{"type":"integer","minimum":0}},"required":["requested","completed","warnings","failed"],"additionalProperties":false},"created_at":{"type":"string","format":"date-time"},"started_at":{"type":["string","null"],"format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"},"terminal_reason":{"type":["string","null"],"enum":["failed","inaccessible","cancelled",null]}},"required":["id","report_id","mode","status","counts","created_at","started_at","completed_at","terminal_reason"],"additionalProperties":false},"ContextResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Context"},"request_id":{"type":"string","format":"uuid"}},"required":["data","request_id"],"additionalProperties":false},"WorkspaceResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Workspace"},"request_id":{"type":"string","format":"uuid"}},"required":["data","request_id"],"additionalProperties":false},"ReportResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Report"},"request_id":{"type":"string","format":"uuid"}},"required":["data","request_id"],"additionalProperties":false},"ProfileResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Profile"},"request_id":{"type":"string","format":"uuid"}},"required":["data","request_id"],"additionalProperties":false},"ScanResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Scan"},"request_id":{"type":"string","format":"uuid"}},"required":["data","request_id"],"additionalProperties":false},"ReportCollection":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Report"}},"page":{"type":"object","properties":{"next_cursor":{"type":["string","null"],"maxLength":2048}},"required":["next_cursor"],"additionalProperties":false},"request_id":{"type":"string","format":"uuid"}},"required":["data","page","request_id"],"additionalProperties":false},"ProfileCollection":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Profile"}},"page":{"type":"object","properties":{"next_cursor":{"type":["string","null"],"maxLength":2048}},"required":["next_cursor"],"additionalProperties":false},"request_id":{"type":"string","format":"uuid"}},"required":["data","page","request_id"],"additionalProperties":false},"CreateProfile":{"type":"object","additionalProperties":false,"required":["linkedin_url"],"properties":{"linkedin_url":{"type":"string","format":"uri","maxLength":2048},"name":{"type":"string","minLength":1,"maxLength":200},"title":{"type":"string","minLength":1,"maxLength":200},"headline":{"type":"string","minLength":1,"maxLength":500}}},"CreateReport":{"type":"object","additionalProperties":false,"required":["company","name"],"properties":{"company":{"type":"object","additionalProperties":false,"required":["name","domain","linkedin_company_url"],"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"domain":{"type":"string","maxLength":2048},"linkedin_company_url":{"type":"string","format":"uri","maxLength":2048}}},"name":{"type":"string","minLength":1,"maxLength":200},"visibility":{"enum":["private","public"],"default":"private"},"on_existing":{"enum":["create","return_existing"],"default":"create"},"profiles":{"type":"array","maxItems":100,"default":[],"items":{"$ref":"#/components/schemas/CreateProfile"}}}},"CreationScan":{"type":"object","additionalProperties":false,"required":["id","mode","status","person_count","company_page_count"],"properties":{"id":{"type":"string","format":"uuid"},"mode":{"enum":["full_profile","activity"]},"status":{"const":"queued"},"person_count":{"type":"integer","minimum":0},"company_page_count":{"type":"integer","minimum":0}}},"CreationRow":{"oneOf":[{"type":"object","additionalProperties":false,"required":["row_number","status","profile_id"],"properties":{"row_number":{"type":"integer","minimum":1},"status":{"const":"added"},"profile_id":{"type":"string","format":"uuid"}}},{"type":"object","additionalProperties":false,"required":["row_number","status","first_row_number"],"properties":{"row_number":{"type":"integer","minimum":1},"status":{"const":"duplicate_in_input"},"first_row_number":{"type":"integer","minimum":1}}}]},"CreatedReportResponse":{"type":"object","additionalProperties":false,"required":["request_id","data"],"properties":{"request_id":{"type":"string","format":"uuid"},"data":{"type":"object","additionalProperties":false,"required":["outcome","report","scan_requests","profiles"],"properties":{"outcome":{"const":"created"},"report":{"$ref":"#/components/schemas/Report"},"scan_requests":{"type":"array","maxItems":2,"items":{"$ref":"#/components/schemas/CreationScan"}},"profiles":{"type":"object","additionalProperties":false,"required":["submitted","added","duplicate_in_input","rows"],"properties":{"submitted":{"type":"integer","minimum":0},"added":{"type":"integer","minimum":0},"duplicate_in_input":{"type":"integer","minimum":0},"rows":{"type":"array","maxItems":100,"items":{"$ref":"#/components/schemas/CreationRow"}}}}}}}},"ExistingReportsResponse":{"type":"object","additionalProperties":false,"required":["request_id","data"],"properties":{"request_id":{"type":"string","format":"uuid"},"data":{"type":"object","additionalProperties":false,"required":["outcome","existing_reports","next_cursor"],"properties":{"outcome":{"const":"existing"},"existing_reports":{"type":"array","minItems":1,"maxItems":100,"items":{"$ref":"#/components/schemas/Report"}},"next_cursor":{"type":["string","null"]}}}}},"ProfileImport":{"type":"object","additionalProperties":false,"required":["profiles"],"properties":{"profiles":{"type":"array","items":{"$ref":"#/components/schemas/CreateProfile"},"minItems":1,"maxItems":100}}},"ImportPreviewRow":{"type":"object","additionalProperties":false,"required":["row_number","status"],"properties":{"row_number":{"type":"integer","minimum":1,"maximum":100},"status":{"enum":["would_add","would_restore","already_present","duplicate_in_input"]},"duplicate_of_row":{"type":"integer","minimum":1,"maximum":100},"notes":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["code","message"],"properties":{"code":{"const":"previously_removed_profile_restored"},"message":{"type":"string"}}}}}},"ImportRow":{"type":"object","additionalProperties":false,"required":["row_number","status"],"properties":{"row_number":{"type":"integer","minimum":1,"maximum":100},"status":{"enum":["added","restored","already_present","duplicate_in_input"]},"duplicate_of_row":{"type":"integer","minimum":1,"maximum":100},"notes":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["code","message"],"properties":{"code":{"const":"previously_removed_profile_restored"},"message":{"type":"string"}}}},"profile_id":{"type":"string","format":"uuid"},"scan_requests":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["scan_run_id","mode"],"properties":{"scan_run_id":{"type":"string","format":"uuid"},"mode":{"enum":["full_profile","activity"]}}},"minItems":2,"maxItems":2}}},"ImportScan":{"type":"object","additionalProperties":false,"required":["scan_run_id","mode","status_at_commit","jobs_created","jobs_coalesced"],"properties":{"scan_run_id":{"type":"string","format":"uuid"},"mode":{"enum":["full_profile","activity"]},"status_at_commit":{"enum":["queued","running","completed","partial","failed","cancelled"]},"jobs_created":{"type":"integer","minimum":0},"jobs_coalesced":{"type":"integer","minimum":0}}},"ImportValidationResponse":{"type":"object","additionalProperties":false,"required":["request_id","data"],"properties":{"request_id":{"type":"string","format":"uuid"},"data":{"type":"object","additionalProperties":false,"required":["validation_only","valid","counts","rows"],"properties":{"validation_only":{"const":true},"valid":{"const":true},"counts":{"type":"object","additionalProperties":false,"required":["submitted","would_add","would_restore","already_present","duplicate_in_input","would_queue_profiles"],"properties":{"submitted":{"type":"integer","minimum":0},"would_add":{"type":"integer","minimum":0},"would_restore":{"type":"integer","minimum":0},"already_present":{"type":"integer","minimum":0},"duplicate_in_input":{"type":"integer","minimum":0},"would_queue_profiles":{"type":"integer","minimum":0}}},"rows":{"type":"array","items":{"$ref":"#/components/schemas/ImportPreviewRow"},"minItems":1,"maxItems":100}}}}},"ImportReceipt":{"type":"object","additionalProperties":false,"required":["id","report_id","state","counts","rows","scan_requests","created_at","expires_at"],"properties":{"id":{"type":"string","format":"uuid"},"report_id":{"type":"string","format":"uuid"},"state":{"const":"completed","description":"Import admission is complete. Scan completion is read separately using the returned report and scan IDs."},"counts":{"type":"object","additionalProperties":false,"required":["submitted","added","restored","already_present","duplicate_in_input","profiles_queued"],"properties":{"submitted":{"type":"integer","minimum":0},"added":{"type":"integer","minimum":0},"restored":{"type":"integer","minimum":0},"already_present":{"type":"integer","minimum":0},"duplicate_in_input":{"type":"integer","minimum":0},"profiles_queued":{"type":"integer","minimum":0}}},"rows":{"type":"array","items":{"$ref":"#/components/schemas/ImportRow"},"minItems":1,"maxItems":100},"scan_requests":{"type":"array","items":{"$ref":"#/components/schemas/ImportScan"}},"created_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time"}}},"ImportReceiptResponse":{"type":"object","additionalProperties":false,"required":["request_id","data"],"properties":{"request_id":{"type":"string","format":"uuid"},"data":{"$ref":"#/components/schemas/ImportReceipt"}}},"ImportValidationError":{"type":"object","additionalProperties":false,"required":["request_id","error"],"properties":{"request_id":{"type":"string","format":"uuid"},"error":{"type":"object","additionalProperties":false,"required":["code","message","retryable","details"],"properties":{"code":{"const":"import_validation_failed"},"message":{"type":"string"},"retryable":{"const":false},"details":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["field","code"],"properties":{"row_number":{"type":"integer","minimum":1,"maximum":100},"field":{"enum":["profiles","linkedin_url","name","title","headline"]},"code":{"type":"string"}}},"maxItems":100}}}}}}}}