{"openapi":"3.1.0","info":{"title":"AIOS API","version":"0.1.0","description":"The external AIOS API: lead capture, the embeddable agent widget, and CRM OAuth connect. Programmatic API-key access is on the roadmap and not yet live. Operators automate AIOS through the aios CLI and MCP server.","contact":{"email":"support@aios.supply"}},"servers":[{"url":"https://aios.supply"}],"paths":{"/api/lead":{"post":{"summary":"Capture a lead","description":"Submit a lead (name, email, phone, message) into the connected CRM or AIOS native capture. Rate limited per IP.","responses":{"200":{"description":"Success","content":{"application/json":{"example":{"ok":true}}}}},"requestBody":{"required":true,"content":{"application/json":{"example":{"name":"Jane Roe","email":"jane@example.com","phone":"+15555550123","message":"Interested in a demo"}}}}}},"/api/embed/agent":{"post":{"summary":"Send a message to an embedded agent","description":"Backend for the embeddable chat widget. Sends a visitor message to the tenant's published agent and returns the reply. CORS-gated to the AIOS-served widget.","responses":{"200":{"description":"Success","content":{"application/json":{"example":{"reply":"Yes, we have Saturday slots. Want me to book one?"}}}}},"requestBody":{"required":true,"content":{"application/json":{"example":{"tenant":"your-tenant","messages":[{"role":"user","content":"Do you do weekend appointments?"}]}}}}}},"/api/connect/{provider}/start":{"get":{"summary":"Begin a CRM OAuth connection","description":"Starts the one-click OAuth handshake for a connectable CRM. Redirects the signed-in user to the provider to approve AIOS. {provider} is the connector slug.","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"redirect":"https://<provider>/oauth/authorize?..."}}}}}}},"/api/connect/{provider}/callback":{"get":{"summary":"Complete a CRM OAuth connection","description":"OAuth redirect target. Exchanges the auth code, stores the connection credential in the vault (by reference, never plaintext), and binds it to the tenant.","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"ok":true}}}}}}}},"x-generated":{"at":"2026-06-28T20:09:16.012Z","routesDiscovered":35,"published":4}}