{"openapi":"3.0.3","info":{"title":"PageFox API","version":"1.0.0","description":"Read-only Business-plan API for a PageFox organization's own websites, leads, companies, sessions, and conversations. Authenticate with a per-org API key created in Settings -> API keys."},"servers":[{"url":"https://pagefox.co/api/v1"}],"security":[{"bearerAuth":[]}],"paths":{"/websites":{"get":{"operationId":"listWebsites","x-pagefox-scope":"websites:read","summary":"Discover website IDs available to this organization","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1}}],"responses":{"200":{"description":"OK. Demo websites are included and explicitly labelled with data_mode=demo.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true},"url":{"type":"string"},"status":{"type":"string","enum":["active","paused"]},"data_mode":{"type":"string","enum":["live","demo"]}},"required":["id","name","url","status","data_mode"]}},"pagination":{"type":"object","properties":{"page":{"type":"integer"},"per_page":{"type":"integer"},"total":{"type":"integer"},"total_pages":{"type":"integer"}},"required":["page","per_page","total","total_pages"]}},"required":["data","pagination"]}}}},"401":{"description":"Missing, unknown, revoked, or no-longer-entitled API key; or the organization is disabled/pending deletion (indistinguishable — no existence oracle).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key's scopes do not include the scope this endpoint requires.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded for this API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Capability temporarily unavailable while its permission contract is being enabled.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/leads":{"get":{"operationId":"listLeads","x-pagefox-scope":"leads:read","summary":"List leads (identified companies + anonymous visitor rows)","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1}},{"name":"website_id","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"Scope results to one website. Omit for org-wide."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["company"]},"id":{"type":"string"},"name":{"type":"string"},"domain":{"type":"string","nullable":true},"industry":{"type":"string","nullable":true},"employee_count":{"type":"integer","nullable":true},"location":{"type":"string","nullable":true},"relationship_status":{"type":"string","enum":["new","in_pipeline","customer","lapsed"]},"source":{"type":"string","enum":["apollo","ipinfo","pdl","submitted"]},"match_confidence":{"type":"string","nullable":true},"linkedin_url":{"type":"string","nullable":true},"first_seen_at":{"type":"string","format":"date-time"},"last_seen_at":{"type":"string","format":"date-time"},"sessions_count":{"type":"integer"},"pages_viewed_total":{"type":"integer"},"max_lead_score":{"type":"integer"},"leads_count":{"type":"integer"},"conversations_count":{"type":"integer"},"locked":{"type":"boolean","description":"true past the plan's company-metering unlock set (§4.1) — identity fields above are redacted."},"person":{"type":"object","nullable":true,"properties":{"leadId":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"status":{"type":"string"},"conversationId":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"linkedin_url":{"type":"string","nullable":true}}},"last_session_source":{"type":"object","nullable":true,"properties":{"source":{"type":"string","nullable":true},"referrer":{"type":"string","nullable":true},"utm_params":{"type":"object","nullable":true},"geo":{}}}},"required":["kind","id","name","domain","industry","employee_count","location","relationship_status","source","match_confidence","linkedin_url","first_seen_at","last_seen_at","sessions_count","pages_viewed_total","max_lead_score","leads_count","conversations_count","locked","person","last_session_source"]},{"type":"object","properties":{"kind":{"type":"string","enum":["visitor"]},"id":{"type":"string"},"website_id":{"type":"string"},"visitor_id":{"type":"string"},"geo":{},"pages_viewed":{"type":"integer","nullable":true},"last_page_url":{"type":"string","nullable":true},"time_on_site_seconds":{"type":"integer","nullable":true},"visits_count":{"type":"integer","nullable":true},"last_visit_started_at":{"type":"string","nullable":true},"last_visit_pages_viewed":{"type":"integer","nullable":true},"last_visit_time_on_site_seconds":{"type":"integer","nullable":true},"source":{"type":"string","nullable":true},"referrer":{"type":"string","nullable":true},"utm_params":{"type":"object","nullable":true},"device_type":{"type":"string","nullable":true},"lead_score":{"type":"integer","nullable":true},"classification":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"first_seen_at":{"type":"string","nullable":true},"last_seen_at":{"type":"string","nullable":true},"identity_trail":{"type":"string","nullable":true,"description":"Honest evidence line when the identity-judgment verdict flag is on; never a vendor name or company identity."}},"required":["kind","id","website_id","visitor_id","geo","pages_viewed","last_page_url","time_on_site_seconds","visits_count","last_visit_started_at","last_visit_pages_viewed","last_visit_time_on_site_seconds","source","referrer","utm_params","device_type","lead_score","classification","conversation_id","first_seen_at","last_seen_at","identity_trail"]}]}},"pagination":{"type":"object","properties":{"page":{"type":"integer"},"per_page":{"type":"integer"},"total":{"type":"integer"},"total_pages":{"type":"integer"}},"required":["page","per_page","total","total_pages"]}},"required":["data","pagination"]}}}},"400":{"description":"A malformed website_id returns invalid_request. Invalid page or per_page values use their documented defaults.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, unknown, revoked, or no-longer-entitled API key; or the organization is disabled/pending deletion (indistinguishable — no existence oracle).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key's scopes do not include the scope this endpoint requires.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded for this API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/companies":{"get":{"operationId":"listCompanies","x-pagefox-scope":"companies:read","summary":"List identified companies","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1}},{"name":"website_id","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"Scope results to one website. Omit for org-wide."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["company"]},"id":{"type":"string"},"name":{"type":"string"},"domain":{"type":"string","nullable":true},"industry":{"type":"string","nullable":true},"employee_count":{"type":"integer","nullable":true},"location":{"type":"string","nullable":true},"relationship_status":{"type":"string","enum":["new","in_pipeline","customer","lapsed"]},"source":{"type":"string","enum":["apollo","ipinfo","pdl","submitted"]},"match_confidence":{"type":"string","nullable":true},"linkedin_url":{"type":"string","nullable":true},"first_seen_at":{"type":"string","format":"date-time"},"last_seen_at":{"type":"string","format":"date-time"},"sessions_count":{"type":"integer"},"pages_viewed_total":{"type":"integer"},"max_lead_score":{"type":"integer"},"leads_count":{"type":"integer"},"conversations_count":{"type":"integer"},"locked":{"type":"boolean","description":"true past the plan's company-metering unlock set (§4.1) — identity fields above are redacted."},"person":{"type":"object","nullable":true,"properties":{"leadId":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"status":{"type":"string"},"conversationId":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"linkedin_url":{"type":"string","nullable":true}}},"last_session_source":{"type":"object","nullable":true,"properties":{"source":{"type":"string","nullable":true},"referrer":{"type":"string","nullable":true},"utm_params":{"type":"object","nullable":true},"geo":{}}}},"required":["kind","id","name","domain","industry","employee_count","location","relationship_status","source","match_confidence","linkedin_url","first_seen_at","last_seen_at","sessions_count","pages_viewed_total","max_lead_score","leads_count","conversations_count","locked","person","last_session_source"]}},"pagination":{"type":"object","properties":{"page":{"type":"integer"},"per_page":{"type":"integer"},"total":{"type":"integer"},"total_pages":{"type":"integer"}},"required":["page","per_page","total","total_pages"]}},"required":["data","pagination"]}}}},"400":{"description":"A malformed website_id returns invalid_request. Invalid page or per_page values use their documented defaults.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, unknown, revoked, or no-longer-entitled API key; or the organization is disabled/pending deletion (indistinguishable — no existence oracle).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key's scopes do not include the scope this endpoint requires.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded for this API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sessions":{"get":{"operationId":"listSessions","x-pagefox-scope":"sessions:read","summary":"List visitor sessions","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":50,"default":20}},{"name":"website_id","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"Scope results to one website. Omit for org-wide."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"website_id":{"type":"string"},"visitor_id":{"type":"string"},"company_id":{"type":"string","nullable":true},"company_locked":{"type":"boolean"},"geo":{},"pages_viewed":{"type":"integer","nullable":true},"last_page_url":{"type":"string","nullable":true},"time_on_site_seconds":{"type":"integer","nullable":true},"visits_count":{"type":"integer","nullable":true},"last_visit_started_at":{"type":"string","nullable":true},"last_visit_pages_viewed":{"type":"integer","nullable":true},"last_visit_time_on_site_seconds":{"type":"integer","nullable":true},"source":{"type":"string","nullable":true,"description":"Null when company_locked is true (§4.1 — a referrer/utm can carry a locked company's identity). network_context is NEVER returned by this endpoint."},"referrer":{"type":"string","nullable":true},"utm_params":{"type":"object","nullable":true},"device_type":{"type":"string","nullable":true},"lead_score":{"type":"integer","nullable":true},"classification":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"first_seen_at":{"type":"string","nullable":true},"last_seen_at":{"type":"string","nullable":true}},"required":["id","website_id","visitor_id","company_id","company_locked","geo","pages_viewed","last_page_url","time_on_site_seconds","visits_count","last_visit_started_at","last_visit_pages_viewed","last_visit_time_on_site_seconds","source","referrer","utm_params","device_type","lead_score","classification","conversation_id","first_seen_at","last_seen_at"]}},"pagination":{"type":"object","properties":{"page":{"type":"integer"},"per_page":{"type":"integer"},"total":{"type":"integer"},"total_pages":{"type":"integer"}},"required":["page","per_page","total","total_pages"]}},"required":["data","pagination"]}}}},"400":{"description":"A malformed website_id returns invalid_request. Invalid page or per_page values use their documented defaults.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, unknown, revoked, or no-longer-entitled API key; or the organization is disabled/pending deletion (indistinguishable — no existence oracle).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key's scopes do not include the scope this endpoint requires.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded for this API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/conversations":{"get":{"operationId":"listConversations","x-pagefox-scope":"conversations:read","summary":"List AI conversations","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":50,"default":20}},{"name":"website_id","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"Scope results to one website. Omit for org-wide."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"website_id":{"type":"string"},"visitor_id":{"type":"string"},"status":{"type":"string"},"lead_score":{"type":"integer"},"lead_status":{"type":"string"},"source_url":{"type":"string","nullable":true},"referrer":{"type":"string","nullable":true},"utm_params":{"type":"object","nullable":true},"device_type":{"type":"string","nullable":true},"trigger_type":{"type":"string","nullable":true},"company_id":{"type":"string","nullable":true},"company_locked":{"type":"boolean"},"message_count":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","website_id","visitor_id","status","lead_score","lead_status","source_url","referrer","utm_params","device_type","trigger_type","company_id","company_locked","message_count","created_at","updated_at"]}},"pagination":{"type":"object","properties":{"page":{"type":"integer"},"per_page":{"type":"integer"},"total":{"type":"integer"},"total_pages":{"type":"integer"}},"required":["page","per_page","total","total_pages"]}},"required":["data","pagination"]}}}},"400":{"description":"A malformed website_id returns invalid_request. Invalid page or per_page values use their documented defaults.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, unknown, revoked, or no-longer-entitled API key; or the organization is disabled/pending deletion (indistinguishable — no existence oracle).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key's scopes do not include the scope this endpoint requires.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded for this API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/conversations/{id}":{"get":{"operationId":"getConversation","x-pagefox-scope":"conversations:read","summary":"Get a conversation with its messages","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"allOf":[{"type":"object","properties":{"id":{"type":"string"},"website_id":{"type":"string"},"visitor_id":{"type":"string"},"status":{"type":"string"},"lead_score":{"type":"integer"},"lead_status":{"type":"string"},"source_url":{"type":"string","nullable":true},"referrer":{"type":"string","nullable":true},"utm_params":{"type":"object","nullable":true},"device_type":{"type":"string","nullable":true},"trigger_type":{"type":"string","nullable":true},"company_id":{"type":"string","nullable":true},"company_locked":{"type":"boolean"},"message_count":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","website_id","visitor_id","status","lead_score","lead_status","source_url","referrer","utm_params","device_type","trigger_type","company_id","company_locked","message_count","created_at","updated_at"]},{"type":"object","properties":{"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string","enum":["visitor","assistant","system","human_agent"]},"content":{"type":"string"},"sender_name":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"}},"required":["id","role","content","sender_name","created_at"]}}},"required":["messages"]}]}},"required":["data"]}}}},"401":{"description":"Missing, unknown, revoked, or no-longer-entitled API key; or the organization is disabled/pending deletion (indistinguishable — no existence oracle).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key's scopes do not include the scope this endpoint requires.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (used identically for a truly missing resource and a resource belonging to another organization).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded for this API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"pfx_...","description":"Authorization: Bearer pfx_..."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Pagination":{"type":"object","properties":{"page":{"type":"integer"},"per_page":{"type":"integer"},"total":{"type":"integer"},"total_pages":{"type":"integer"}},"required":["page","per_page","total","total_pages"]},"CompanyRow":{"type":"object","properties":{"kind":{"type":"string","enum":["company"]},"id":{"type":"string"},"name":{"type":"string"},"domain":{"type":"string","nullable":true},"industry":{"type":"string","nullable":true},"employee_count":{"type":"integer","nullable":true},"location":{"type":"string","nullable":true},"relationship_status":{"type":"string","enum":["new","in_pipeline","customer","lapsed"]},"source":{"type":"string","enum":["apollo","ipinfo","pdl","submitted"]},"match_confidence":{"type":"string","nullable":true},"linkedin_url":{"type":"string","nullable":true},"first_seen_at":{"type":"string","format":"date-time"},"last_seen_at":{"type":"string","format":"date-time"},"sessions_count":{"type":"integer"},"pages_viewed_total":{"type":"integer"},"max_lead_score":{"type":"integer"},"leads_count":{"type":"integer"},"conversations_count":{"type":"integer"},"locked":{"type":"boolean","description":"true past the plan's company-metering unlock set (§4.1) — identity fields above are redacted."},"person":{"type":"object","nullable":true,"properties":{"leadId":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"status":{"type":"string"},"conversationId":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"linkedin_url":{"type":"string","nullable":true}}},"last_session_source":{"type":"object","nullable":true,"properties":{"source":{"type":"string","nullable":true},"referrer":{"type":"string","nullable":true},"utm_params":{"type":"object","nullable":true},"geo":{}}}},"required":["kind","id","name","domain","industry","employee_count","location","relationship_status","source","match_confidence","linkedin_url","first_seen_at","last_seen_at","sessions_count","pages_viewed_total","max_lead_score","leads_count","conversations_count","locked","person","last_session_source"]},"VisitorRow":{"type":"object","properties":{"kind":{"type":"string","enum":["visitor"]},"id":{"type":"string"},"website_id":{"type":"string"},"visitor_id":{"type":"string"},"geo":{},"pages_viewed":{"type":"integer","nullable":true},"last_page_url":{"type":"string","nullable":true},"time_on_site_seconds":{"type":"integer","nullable":true},"visits_count":{"type":"integer","nullable":true},"last_visit_started_at":{"type":"string","nullable":true},"last_visit_pages_viewed":{"type":"integer","nullable":true},"last_visit_time_on_site_seconds":{"type":"integer","nullable":true},"source":{"type":"string","nullable":true},"referrer":{"type":"string","nullable":true},"utm_params":{"type":"object","nullable":true},"device_type":{"type":"string","nullable":true},"lead_score":{"type":"integer","nullable":true},"classification":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"first_seen_at":{"type":"string","nullable":true},"last_seen_at":{"type":"string","nullable":true},"identity_trail":{"type":"string","nullable":true,"description":"Honest evidence line when the identity-judgment verdict flag is on; never a vendor name or company identity."}},"required":["kind","id","website_id","visitor_id","geo","pages_viewed","last_page_url","time_on_site_seconds","visits_count","last_visit_started_at","last_visit_pages_viewed","last_visit_time_on_site_seconds","source","referrer","utm_params","device_type","lead_score","classification","conversation_id","first_seen_at","last_seen_at","identity_trail"]},"SessionRow":{"type":"object","properties":{"id":{"type":"string"},"website_id":{"type":"string"},"visitor_id":{"type":"string"},"company_id":{"type":"string","nullable":true},"company_locked":{"type":"boolean"},"geo":{},"pages_viewed":{"type":"integer","nullable":true},"last_page_url":{"type":"string","nullable":true},"time_on_site_seconds":{"type":"integer","nullable":true},"visits_count":{"type":"integer","nullable":true},"last_visit_started_at":{"type":"string","nullable":true},"last_visit_pages_viewed":{"type":"integer","nullable":true},"last_visit_time_on_site_seconds":{"type":"integer","nullable":true},"source":{"type":"string","nullable":true,"description":"Null when company_locked is true (§4.1 — a referrer/utm can carry a locked company's identity). network_context is NEVER returned by this endpoint."},"referrer":{"type":"string","nullable":true},"utm_params":{"type":"object","nullable":true},"device_type":{"type":"string","nullable":true},"lead_score":{"type":"integer","nullable":true},"classification":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"first_seen_at":{"type":"string","nullable":true},"last_seen_at":{"type":"string","nullable":true}},"required":["id","website_id","visitor_id","company_id","company_locked","geo","pages_viewed","last_page_url","time_on_site_seconds","visits_count","last_visit_started_at","last_visit_pages_viewed","last_visit_time_on_site_seconds","source","referrer","utm_params","device_type","lead_score","classification","conversation_id","first_seen_at","last_seen_at"]},"ConversationRow":{"type":"object","properties":{"id":{"type":"string"},"website_id":{"type":"string"},"visitor_id":{"type":"string"},"status":{"type":"string"},"lead_score":{"type":"integer"},"lead_status":{"type":"string"},"source_url":{"type":"string","nullable":true},"referrer":{"type":"string","nullable":true},"utm_params":{"type":"object","nullable":true},"device_type":{"type":"string","nullable":true},"trigger_type":{"type":"string","nullable":true},"company_id":{"type":"string","nullable":true},"company_locked":{"type":"boolean"},"message_count":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","website_id","visitor_id","status","lead_score","lead_status","source_url","referrer","utm_params","device_type","trigger_type","company_id","company_locked","message_count","created_at","updated_at"]},"ConversationDetail":{"allOf":[{"type":"object","properties":{"id":{"type":"string"},"website_id":{"type":"string"},"visitor_id":{"type":"string"},"status":{"type":"string"},"lead_score":{"type":"integer"},"lead_status":{"type":"string"},"source_url":{"type":"string","nullable":true},"referrer":{"type":"string","nullable":true},"utm_params":{"type":"object","nullable":true},"device_type":{"type":"string","nullable":true},"trigger_type":{"type":"string","nullable":true},"company_id":{"type":"string","nullable":true},"company_locked":{"type":"boolean"},"message_count":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","website_id","visitor_id","status","lead_score","lead_status","source_url","referrer","utm_params","device_type","trigger_type","company_id","company_locked","message_count","created_at","updated_at"]},{"type":"object","properties":{"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string","enum":["visitor","assistant","system","human_agent"]},"content":{"type":"string"},"sender_name":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"}},"required":["id","role","content","sender_name","created_at"]}}},"required":["messages"]}]},"MessageRow":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string","enum":["visitor","assistant","system","human_agent"]},"content":{"type":"string"},"sender_name":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"}},"required":["id","role","content","sender_name","created_at"]}}}}