{"version":"0.1.0","routes":{"ai":{"models":{"path":"/ai/models","methods":["POST"],"description":"Query AI models compatible with the requesting device (send device capabilities in body)"}},"channels":{"list":{"path":"/channels","methods":["GET"],"description":"List channels for a connection (requires ?connection_id=UUID)"},"detail":{"path":"/channels/{id}","methods":["GET","PATCH"],"description":"Get or update a specific channel"},"discover":{"path":"/channels/discover","methods":["POST"],"description":"Discover and create channels for a connection"}},"sources":{"get":{"path":"/sources/{id}","methods":["GET"],"description":"Get a specific source with embedded capabilities and categories"},"list":{"path":"/sources","methods":["GET"],"description":"List all sources with embedded capabilities and categories"}},"capabilities":{"list":{"path":"/capabilities","methods":["GET"],"description":"List all available capabilities"}},"devices":{"key-response":{"path":"/account/devices/{device_id}/key-response","methods":["POST"],"description":"Existing device posts wrapped master key for requesting device"},"key-transfer":{"path":"/account/devices/{device_id}/key-transfer","methods":["GET"],"description":"New device retrieves and consumes the wrapped master key"},"key-rotation":{"path":"/account/devices/key-rotation","methods":["POST"],"description":"Notify all devices that a key rotation has occurred"},"list":{"path":"/account/devices","methods":["GET","POST"],"description":"List and register devices"},"push-token":{"path":"/account/devices/{device_id}/push-token","methods":["POST"],"description":"Register or clear push notification token for a device"},"key-request":{"path":"/account/devices/{device_id}/key-request","methods":["GET","POST"],"description":"Key exchange: POST public key (new device) or GET pending public key (existing device)"},"pairing-code":{"path":"/account/devices/{device_id}/pairing-code","methods":["POST"],"description":"Generate a 6-digit pairing code for QR-based device setup"},"detail":{"path":"/account/devices/{device_id}","methods":["GET","PUT","DELETE"],"description":"Get, update, or delete a specific device"}},"webhooks":{"webhook":{"path":"/webhooks/{mode}/{source}/{capability}","methods":["POST"],"description":"Webhook relay - receives notifications from providers, sends push to clients"}},"general":{"index":{"path":"/","methods":["GET"],"description":"API index and documentation"},"health":{"path":"/health","methods":["GET"],"description":"Health check endpoint"}},"categories":{"list":{"path":"/categories","methods":["GET"],"description":"List all available categories"}},"account":{"profiles-key":{"path":"/account/profiles/key","methods":["GET","POST","PUT"],"description":"Manage encrypted sync key for primary profile (GET: retrieve, POST: create, PUT: update)"},"refresh":{"path":"/account/refresh","methods":["POST"],"description":"Refresh access token using a valid refresh token (body or HttpOnly cookie)"},"me":{"path":"/account/me","methods":["GET","PATCH"],"description":"Get and update current user information"},"logout":{"path":"/account/logout","methods":["POST"],"description":"Clear session cookies for browser clients"},"profiles":{"path":"/account/profiles","methods":["GET"],"description":"List user authentication profiles"},"profiles-key-source":{"path":"/account/profiles/{source}/key","methods":["GET"],"description":"Get encrypted sync key for a specific source profile"},"connect":{"path":"/account/connect","methods":["POST"],"description":"Unified authentication - handles discovery, password auth, OAuth initiation, and OAuth callback all in one endpoint"}},"keys":{"list":{"path":"/account/keys","methods":["GET"],"description":"List unlock methods (recovery_code, passphrase) — metadata only"},"kind":{"path":"/account/keys/{kind}","methods":["GET","PUT","DELETE"],"description":"Fetch, upsert, or remove a wrapped master-key blob"}},"connections":{"get":{"path":"/connections/{id}","methods":["GET","PATCH","DELETE"],"description":"Get, update, or delete a connection"},"list":{"path":"/connections","methods":["GET","POST"],"description":"List and create connections"},"exchange":{"path":"/connections/exchange","methods":["POST"],"description":"Exchange OAuth code for tokens - returns tokens to client without storing on server"},"initiate":{"path":"/connections/initiate","methods":["POST"],"description":"Initiate OAuth flow - returns OAuth URL for client to open"},"tokens":{"path":"/connections/{id}/tokens","methods":["GET","PUT"],"description":"Get or store client-encrypted OAuth tokens for portable access"},"refresh":{"path":"/connections/{id}/refresh","methods":["POST"],"description":"Refresh OAuth tokens - uses server credentials but returns tokens to client without storing"}}}}