{"components":{"schemas":{"auth.GenerateMagicLinkRequest":{"properties":{"email":{"type":"string"},"tenant_id":{"type":"string"}},"required":["email","tenant_id"],"type":"object"},"auth.MagicLinkResponse":{"properties":{"token":{"type":"string"}},"type":"object"},"auth.UserResponse":{"properties":{"created_at":{"type":"string"},"email":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"}},"type":"object"},"auth.VerifyMagicLinkRequest":{"properties":{"token":{"type":"string"}},"required":["token"],"type":"object"},"auth.VerifyResponse":{"properties":{"email":{"type":"string"},"tenant_id":{"type":"string"}},"type":"object"},"domains.AddDomainRequest":{"properties":{"domain":{"type":"string"}},"required":["domain"],"type":"object"},"domains.DomainResponse":{"properties":{"created_at":{"type":"string"},"domain":{"type":"string"},"id":{"type":"string"},"ssl_status":{"type":"string"},"status":{"type":"string"},"tenant_id":{"type":"string"},"updated_at":{"type":"string"},"verified":{"type":"boolean"}},"type":"object"},"domains.DomainStatusResponse":{"properties":{"dns_target":{"type":"string"},"domain":{"type":"string"},"errors":{"items":{"type":"string"},"type":"array"},"instructions":{"type":"string"},"ssl_status":{"type":"string"},"status":{"type":"string"},"verified":{"type":"boolean"}},"type":"object"},"signup.ResendResponse":{"properties":{"resent":{"type":"boolean"},"status":{"type":"string"}},"type":"object"},"signup.StartRequest":{"properties":{"app":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"subdomain":{"type":"string"}},"required":["app","subdomain","name","email"],"type":"object"},"signup.StartResult":{"properties":{"code_expires_at":{"format":"date-time","type":"string"},"next":{"type":"string"},"status":{"type":"string"},"subdomain":{"type":"string"},"tenant_id":{"type":"string"}},"type":"object"},"signup.StatusResponse":{"properties":{"status":{"type":"string"},"tenant_id":{"type":"string"}},"type":"object"},"signup.VerifyRequest":{"properties":{"code":{"type":"string"}},"required":["code"],"type":"object"},"signup.VerifyResult":{"properties":{"admin_url":{"type":"string"},"api_key":{"type":"string"},"site_url":{"type":"string"},"status":{"type":"string"},"tenant_id":{"type":"string"}},"type":"object"},"tenants.AccountOwnerResponse":{"properties":{"added_at":{"type":"string"},"added_by":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"}},"type":"object"},"tenants.AccountResponse":{"properties":{"billing_cycle":{"type":"string"},"created_at":{"type":"string"},"id":{"type":"string"},"plan":{"type":"string"},"updated_at":{"type":"string"}},"type":"object"},"tenants.AddAccountOwnerRequest":{"properties":{"added_by":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"}},"type":"object"},"tenants.CreateTenantRequest":{"properties":{"app_type":{"type":"string"},"owner_email":{"type":"string"},"owner_name":{"type":"string"},"plan":{"type":"string"},"subdomain":{"type":"string"}},"required":["subdomain","app_type","owner_email"],"type":"object"},"tenants.TenantResponse":{"properties":{"account_id":{"type":"string"},"app_type":{"type":"string"},"created_at":{"type":"string"},"id":{"type":"string"},"plan":{"type":"string"},"status":{"type":"string"},"subdomain":{"type":"string"},"updated_at":{"type":"string"}},"type":"object"},"tenants.TerminateTenantRequest":{"properties":{"terminated_by":{"type":"string"}},"type":"object"}},"securitySchemes":{"apiKeyAuth":{"in":"header","name":"X-API-Key","type":"apiKey"},"bearerAuth":{"scheme":"bearer","type":"http"}}},"info":{"title":"Simplest1 Platform API","version":"1.0.0"},"openapi":"3.0.3","paths":{"/api/v1/accounts/{id}":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/tenants.AccountResponse"},"meta":{"type":"object"},"ok":{"type":"boolean"}},"type":"object"}}},"description":"Envelope: ok, data, meta"},"4XX":{"description":"Envelope: ok=false, error{code, message, details}"}},"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"summary":"Get account details","tags":["Accounts"]}},"/api/v1/accounts/{id}/owners":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/tenants.AccountOwnerResponse"},"type":"array"},"meta":{"type":"object"},"ok":{"type":"boolean"}},"type":"object"}}},"description":"Envelope: ok, data, meta"},"4XX":{"description":"Envelope: ok=false, error{code, message, details}"}},"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"summary":"List account owners","tags":["Accounts"]},"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/tenants.AddAccountOwnerRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"type":"object"},"meta":{"type":"object"},"ok":{"type":"boolean"}},"type":"object"}}},"description":"Envelope: ok, data, meta"},"4XX":{"description":"Envelope: ok=false, error{code, message, details}"}},"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"summary":"Add an account owner","tags":["Accounts"]}},"/api/v1/accounts/{id}/owners/{email}":{"delete":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"type":"object"},"meta":{"type":"object"},"ok":{"type":"boolean"}},"type":"object"}}},"description":"Envelope: ok, data, meta"},"4XX":{"description":"Envelope: ok=false, error{code, message, details}"}},"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"summary":"Remove an account owner","tags":["Accounts"]}},"/api/v1/auth/magic-link":{"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/auth.GenerateMagicLinkRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/auth.MagicLinkResponse"},"meta":{"type":"object"},"ok":{"type":"boolean"}},"type":"object"}}},"description":"Envelope: ok, data, meta"},"4XX":{"description":"Envelope: ok=false, error{code, message, details}"}},"summary":"Request a magic link","tags":["Authentication"]}},"/api/v1/auth/me":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/auth.UserResponse"},"meta":{"type":"object"},"ok":{"type":"boolean"}},"type":"object"}}},"description":"Envelope: ok, data, meta"},"4XX":{"description":"Envelope: ok=false, error{code, message, details}"}},"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"summary":"Get current user","tags":["Authentication"]}},"/api/v1/auth/verify":{"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/auth.VerifyMagicLinkRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/auth.VerifyResponse"},"meta":{"type":"object"},"ok":{"type":"boolean"}},"type":"object"}}},"description":"Envelope: ok, data, meta"},"4XX":{"description":"Envelope: ok=false, error{code, message, details}"}},"summary":"Verify a magic link token","tags":["Authentication"]}},"/api/v1/domains":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/domains.DomainResponse"},"type":"array"},"meta":{"type":"object"},"ok":{"type":"boolean"}},"type":"object"}}},"description":"Envelope: ok, data, meta"},"4XX":{"description":"Envelope: ok=false, error{code, message, details}"}},"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"summary":"List domains","tags":["Domains"]},"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/domains.AddDomainRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/domains.DomainResponse"},"meta":{"type":"object"},"ok":{"type":"boolean"}},"type":"object"}}},"description":"Envelope: ok, data, meta"},"4XX":{"description":"Envelope: ok=false, error{code, message, details}"}},"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"summary":"Add a custom domain","tags":["Domains"]}},"/api/v1/domains/{id}":{"delete":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"type":"object"},"meta":{"type":"object"},"ok":{"type":"boolean"}},"type":"object"}}},"description":"Envelope: ok, data, meta"},"4XX":{"description":"Envelope: ok=false, error{code, message, details}"}},"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"summary":"Remove a domain","tags":["Domains"]},"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/domains.DomainResponse"},"meta":{"type":"object"},"ok":{"type":"boolean"}},"type":"object"}}},"description":"Envelope: ok, data, meta"},"4XX":{"description":"Envelope: ok=false, error{code, message, details}"}},"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"summary":"Get domain details","tags":["Domains"]}},"/api/v1/domains/{id}/verify":{"post":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/domains.DomainStatusResponse"},"meta":{"type":"object"},"ok":{"type":"boolean"}},"type":"object"}}},"description":"Envelope: ok, data, meta"},"4XX":{"description":"Envelope: ok=false, error{code, message, details}"}},"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"summary":"Verify domain DNS","tags":["Domains"]}},"/api/v1/signup":{"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/signup.StartRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/signup.StartResult"},"meta":{"type":"object"},"ok":{"type":"boolean"}},"type":"object"}}},"description":"Envelope: ok, data, meta"},"4XX":{"description":"Envelope: ok=false, error{code, message, details}"}},"summary":"Create a pending app and email the owner a code","tags":["Signup"]}},"/api/v1/signup/{id}":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/signup.StatusResponse"},"meta":{"type":"object"},"ok":{"type":"boolean"}},"type":"object"}}},"description":"Envelope: ok, data, meta"},"4XX":{"description":"Envelope: ok=false, error{code, message, details}"}},"summary":"Signup status: pending | active | expired","tags":["Signup"]}},"/api/v1/signup/{id}/resend":{"post":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/signup.ResendResponse"},"meta":{"type":"object"},"ok":{"type":"boolean"}},"type":"object"}}},"description":"Envelope: ok, data, meta"},"4XX":{"description":"Envelope: ok=false, error{code, message, details}"}},"summary":"Send a fresh code","tags":["Signup"]}},"/api/v1/signup/{id}/verify":{"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/signup.VerifyRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/signup.VerifyResult"},"meta":{"type":"object"},"ok":{"type":"boolean"}},"type":"object"}}},"description":"Envelope: ok, data, meta"},"4XX":{"description":"Envelope: ok=false, error{code, message, details}"}},"summary":"Submit the code; activates the app and returns an API key","tags":["Signup"]}},"/api/v1/tenants":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/tenants.TenantResponse"},"type":"array"},"meta":{"type":"object"},"ok":{"type":"boolean"}},"type":"object"}}},"description":"Envelope: ok, data, meta"},"4XX":{"description":"Envelope: ok=false, error{code, message, details}"}},"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"summary":"List tenants","tags":["Tenants"]},"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/tenants.CreateTenantRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/tenants.TenantResponse"},"meta":{"type":"object"},"ok":{"type":"boolean"}},"type":"object"}}},"description":"Envelope: ok, data, meta"},"4XX":{"description":"Envelope: ok=false, error{code, message, details}"}},"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"summary":"Create a tenant","tags":["Tenants"]}},"/api/v1/tenants/{id}":{"get":{"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/tenants.TenantResponse"},"meta":{"type":"object"},"ok":{"type":"boolean"}},"type":"object"}}},"description":"Envelope: ok, data, meta"},"4XX":{"description":"Envelope: ok=false, error{code, message, details}"}},"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"summary":"Get tenant details","tags":["Tenants"]}},"/api/v1/tenants/{id}/terminate":{"post":{"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/tenants.TerminateTenantRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"type":"object"},"meta":{"type":"object"},"ok":{"type":"boolean"}},"type":"object"}}},"description":"Envelope: ok, data, meta"},"4XX":{"description":"Envelope: ok=false, error{code, message, details}"}},"security":[{"bearerAuth":[]},{"apiKeyAuth":[]}],"summary":"Terminate a tenant","tags":["Tenants"]}}},"servers":[{"url":"/api/v1"}],"tags":[{"description":"Account and owner management","name":"Accounts"},{"description":"Magic link authentication and session management","name":"Authentication"},{"description":"Custom domain management and verification","name":"Domains"},{"description":"Create an app for someone via API; they receive a one-time code by email, the client hands it back and receives an API key","name":"Signup"},{"description":"Tenant lifecycle management","name":"Tenants"}]}
