{"openapi":"3.0.3","info":{"title":"AutoCount Cloud API","version":"0.1.0","description":"Cloud API for AutoCount Accounting 2.2 via the local Windows connector."},"servers":[{"url":"https://api.autocount.cloud"}],"paths":{"/health":{"get":{"summary":"Cloud health check","responses":{"200":{"description":"Cloud API is running"}}}},"/":{"get":{"summary":"Render product introduction page","responses":{"200":{"description":"Public AutoCount Cloud introduction HTML page"}}}},"/pricing":{"get":{"summary":"Render pricing page","responses":{"200":{"description":"Pricing HTML page"}}}},"/signup":{"get":{"summary":"Render signup page","responses":{"200":{"description":"Signup HTML page"}}},"post":{"summary":"Create customer trial account","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["companyName","email","password"],"properties":{"companyName":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"password":{"type":"string"},"plan":{"type":"string"}}}}}},"responses":{"200":{"description":"Tenant, connector, and login session created"}}}},"/login":{"get":{"summary":"Render login page","responses":{"200":{"description":"Login HTML page"}}},"post":{"summary":"Create customer session","responses":{"200":{"description":"Authenticated user"},"401":{"description":"Invalid login"}}}},"/portal":{"get":{"summary":"Customer dashboard","responses":{"200":{"description":"Authenticated dashboard HTML"},"302":{"description":"Redirects to login"}}}},"/app/state":{"get":{"summary":"Customer dashboard JSON state","responses":{"200":{"description":"Tenant, connector, and account book state"},"401":{"description":"Login required"}}}},"/app/commands":{"get":{"summary":"Customer command history","responses":{"200":{"description":"Recent tenant-scoped command summaries"},"401":{"description":"Login required"}}}},"/app/notifications":{"get":{"summary":"Customer retention notifications","responses":{"200":{"description":"Open tenant notifications and retention alerts"},"401":{"description":"Login required"}}}},"/app/api-keys":{"get":{"summary":"List customer app API keys","responses":{"200":{"description":"Named customer API keys without secret values"},"401":{"description":"Login required"}}},"post":{"summary":"Create customer app API key","responses":{"200":{"description":"New named API key. Secret is shown once."},"401":{"description":"Login required"}}}},"/app/api-keys/{keyId}/revoke":{"post":{"summary":"Revoke customer app API key","responses":{"200":{"description":"API key revoked"},"401":{"description":"Login required"},"404":{"description":"Unknown key"}}}},"/app/connector-config.json":{"get":{"summary":"Download connector cloud config","responses":{"200":{"description":"Connector ID, connector key, and cloud URL"},"401":{"description":"Login required"}}}},"/app/rotate-tenant-api-key":{"post":{"summary":"Rotate tenant API key","responses":{"200":{"description":"New tenant API key"},"401":{"description":"Login required"}}}},"/downloads/AutoCountConnectorSetup.exe":{"get":{"summary":"Download Installer","responses":{"200":{"description":"Windows connector setup executable"},"404":{"description":"Installer not uploaded"}}}},"/v1/commands":{"post":{"summary":"Queue command for local AutoCount connector","parameters":[{"name":"authorization","in":"header","required":true,"schema":{"type":"string"},"description":"Bearer token."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["commandId","connectorId","companyId","type"],"properties":{"commandId":{"type":"string","description":"Caller-generated unique ID for idempotency and audit."},"connectorId":{"type":"string"},"companyId":{"type":"string","description":"Configured local account book company ID."},"type":{"type":"string","examples":["sales.invoice.count","sales.invoice.list","stock.item.list"]},"payload":{"type":"object","additionalProperties":true}}}}}},"responses":{"202":{"description":"Command queued"},"401":{"description":"Invalid tenant API key"},"402":{"description":"Subscription inactive"}}}},"/v1/commands/{commandId}":{"get":{"summary":"Get command status and result","parameters":[{"name":"authorization","in":"header","required":true,"schema":{"type":"string"},"description":"Bearer token."},{"name":"commandId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Command status and result"},"404":{"description":"Unknown command"}}}},"/connectors/{connectorId}/commands/next":{"get":{"summary":"Connector polls for next command","parameters":[{"name":"authorization","in":"header","required":true,"schema":{"type":"string"},"description":"Bearer token."},{"name":"connectorId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Next command or empty queue response"}}}},"/connectors/{connectorId}/commands/{commandId}/result":{"post":{"summary":"Connector posts command result","parameters":[{"name":"authorization","in":"header","required":true,"schema":{"type":"string"},"description":"Bearer token."},{"name":"connectorId","in":"path","required":true,"schema":{"type":"string"}},{"name":"commandId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Result accepted"}}}},"/connectors/{connectorId}/companies":{"get":{"summary":"List connector account books","responses":{"200":{"description":"Configured account books"}}},"post":{"summary":"Connector reports account books","parameters":[{"name":"authorization","in":"header","required":true,"schema":{"type":"string"},"description":"Bearer token."}],"responses":{"200":{"description":"Account books saved"}}}},"/connectors/{connectorId}/heartbeat":{"post":{"summary":"Connector heartbeat","parameters":[{"name":"authorization","in":"header","required":true,"schema":{"type":"string"},"description":"Bearer token."}],"responses":{"200":{"description":"Heartbeat accepted"}}}},"/admin/retention/run":{"post":{"summary":"Run retention automation checks","parameters":[{"name":"authorization","in":"header","required":true,"schema":{"type":"string"},"description":"Bearer token."}],"responses":{"200":{"description":"Retention notifications created or updated"},"401":{"description":"Admin key required"}}}}}}