{"components":{"securitySchemes":{"bearerAuth":{"scheme":"bearer","type":"http"}}},"info":{"title":"ReviveAI Contacts and Conversation Sync","version":"1.3.0"},"openapi":"3.0.3","paths":{"/v1/changes":{"get":{"parameters":[{"in":"query","name":"after","schema":{"default":0,"minimum":0,"type":"integer"}},{"in":"query","name":"limit","schema":{"default":50,"maximum":200,"minimum":1,"type":"integer"}},{"in":"query","name":"stream_id","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"JSON result; see README for the change-feed contract"},"400":{"description":"Invalid query or stream ID"},"401":{"description":"Missing or invalid key"}},"summary":"Replayable complete-snapshot change feed"}},"/v1/contact-changes":{"get":{"parameters":[{"in":"query","name":"after","schema":{"default":0,"minimum":0,"type":"integer"}},{"in":"query","name":"limit","schema":{"default":50,"maximum":200,"minimum":1,"type":"integer"}},{"in":"query","name":"stream_id","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"JSON result; see README for the change-feed contract"},"400":{"description":"Invalid query or stream ID"},"401":{"description":"Missing or invalid key"}},"summary":"Replayable contact snapshots; independent cursor from conversation changes"}},"/v1/contacts":{"get":{"parameters":[{"in":"query","name":"q","required":false,"schema":{"type":"string"}},{"in":"query","name":"status","required":false,"schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"default":50,"maximum":200,"minimum":1,"type":"integer"}},{"in":"query","name":"offset","schema":{"default":0,"minimum":0,"type":"integer"}}],"responses":{"200":{"description":"JSON result; see README for the change-feed contract"},"400":{"description":"Invalid query or stream ID"},"401":{"description":"Missing or invalid key"}},"summary":"List Contacts with phone, email and original status"}},"/v1/contacts/{contact_id}":{"get":{"parameters":[{"in":"path","name":"contact_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"JSON result; see README for the change-feed contract"},"400":{"description":"Invalid query or stream ID"},"401":{"description":"Missing or invalid key"}},"summary":"Full contact and explicitly qualified conversation matches"}},"/v1/conversations":{"get":{"parameters":[{"in":"query","name":"q","required":false,"schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"default":50,"maximum":200,"minimum":1,"type":"integer"}},{"in":"query","name":"offset","schema":{"default":0,"minimum":0,"type":"integer"}}],"responses":{"200":{"description":"JSON result; see README for the change-feed contract"},"400":{"description":"Invalid query or stream ID"},"401":{"description":"Missing or invalid key"}},"summary":"List conversations by source update time, newest first; unknown times last"}},"/v1/conversations/{sid}":{"get":{"parameters":[{"in":"path","name":"sid","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"JSON result; see README for the change-feed contract"},"400":{"description":"Invalid query or stream ID"},"401":{"description":"Missing or invalid key"}},"summary":"Complete current conversation"}},"/v1/messages/search":{"get":{"parameters":[{"in":"query","name":"q","required":true,"schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"default":50,"maximum":200,"minimum":1,"type":"integer"}},{"in":"query","name":"offset","schema":{"default":0,"minimum":0,"type":"integer"}}],"responses":{"200":{"description":"JSON result; see README for the change-feed contract"},"400":{"description":"Invalid query or stream ID"},"401":{"description":"Missing or invalid key"}},"summary":"Search all current message bodies"}},"/v1/source/forget":{"post":{"description":"Requires Bearer authorization and the configured exact HTTPS Origin. Credentials are held in process memory only.","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{},"type":"object"}}},"required":true},"responses":{"200":{"description":"Redacted source status"},"401":{"description":"Invalid local API key"},"403":{"description":"Origin or Host rejected"},"409":{"description":"Sync or login already running"},"422":{"description":"Source authentication could not be verified"}},"summary":"Forget in-memory credentials and pause account sync"}},"/v1/source/login":{"post":{"description":"Requires Bearer authorization and the configured exact HTTPS Origin. Credentials are held in process memory only.","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"email":{"maxLength":320,"minLength":1,"type":"string"},"password":{"format":"password","maxLength":4096,"minLength":1,"type":"string","writeOnly":true}},"required":["email","password"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Redacted source status"},"401":{"description":"Invalid local API key"},"403":{"description":"Origin or Host rejected"},"409":{"description":"Sync or login already running"},"422":{"description":"Source authentication could not be verified"}},"summary":"Log in to ReviveAI, verify protected page and request a sync"}},"/v1/source/status":{"get":{"parameters":[],"responses":{"200":{"description":"JSON result; see README for the change-feed contract"},"400":{"description":"Invalid query or stream ID"},"401":{"description":"Missing or invalid key"}},"summary":"ReviveAI account-session status; never returns credentials"}},"/v1/source/sync":{"post":{"description":"Requires Bearer authorization and the configured exact HTTPS Origin. Credentials are held in process memory only.","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{},"type":"object"}}},"required":true},"responses":{"200":{"description":"Redacted source status"},"401":{"description":"Invalid local API key"},"403":{"description":"Origin or Host rejected"},"409":{"description":"Sync or login already running"},"422":{"description":"Source authentication could not be verified"}},"summary":"Request an immediate sync round"}},"/v1/stats":{"get":{"parameters":[],"responses":{"200":{"description":"JSON result; see README for the change-feed contract"},"400":{"description":"Invalid query or stream ID"},"401":{"description":"Missing or invalid key"}},"summary":"Synchronization status and counts"}}},"security":[{"bearerAuth":[]}],"servers":[{"url":"/"}]}