{
  "openapi": "3.0.3",
  "info": {
    "title": "Spaces API",
    "version": "1.0.0",
    "description": "Messaging API for Spaces. Keys start with spc_live_. Send them as Authorization: Bearer. Docs: https://www.spacesos.com/docs/agents"
  },
  "servers": [{ "url": "https://api.spacesos.com/v1" }],
  "components": {
    "securitySchemes": {
      "bearer": { "type": "http", "scheme": "bearer" }
    }
  },
  "security": [{ "bearer": [] }],
  "paths": {
    "/signup": {
      "post": {
        "operationId": "signup",
        "security": [],
        "summary": "Email a 6-digit code",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["email"], "properties": { "email": { "type": "string" } } } } } },
        "responses": { "201": { "description": "signup_id and expires_at" } }
      }
    },
    "/signup/verify": {
      "post": {
        "operationId": "signupVerify",
        "security": [],
        "summary": "Exchange the code for an API key",
        "responses": { "200": { "description": "api_key shown once" } }
      }
    },
    "/messaging/accounts": { "get": { "operationId": "listAccounts", "summary": "Connected accounts", "responses": { "200": { "description": "accounts" } } } },
    "/messaging/accounts/connect-link": { "post": { "operationId": "connectLink", "summary": "Link the person opens to connect an account", "responses": { "201": { "description": "url" } } } },
    "/messaging/billing": { "get": { "operationId": "getBilling", "summary": "Plan status", "responses": { "200": { "description": "billing" } } } },
    "/messaging/billing/checkout": { "post": { "operationId": "checkout", "summary": "Card checkout for a paid trial", "responses": { "201": { "description": "url" } } } },
    "/messaging/usage": { "get": { "operationId": "usage", "summary": "Send limits for each account", "responses": { "200": { "description": "usage" } } } }
  }
}
