{"name":"PayFlow Studio","description":"Subscription risk, recovery drafts and store agent-readiness over PayPal-shaped events. Demo data is synthetic. Agents may read, scan and propose; a person approves before anything is sent.","version":"1.0.0","baseUrl":"https://payflow.ameliorlabs.ca","authentication":"Optional. Without a key the API returns synthetic demo data. With a read-only key from Settings, sent as Authorization: Bearer pf_live_..., the lifecycle summary, high-risk and events tools return the owner's real data (header X-PayFlow-Data: live). Keys cannot send email.","humanApproval":"Required for every outbound message. The API cannot send email.","dataMode":"Lifecycle, playbook and Dev Studio responses are synthetic and carry the header X-PayFlow-Data: synthetic, except the three lifecycle read endpoints when called with a valid API key, which return live data and carry X-PayFlow-Data: live. The readiness scan fetches real public pages.","links":{"openapi":"https://payflow.ameliorlabs.ca/openapi.json","docs":"https://payflow.ameliorlabs.ca/docs","llms":"https://payflow.ameliorlabs.ca/llms.txt"},"tools":[{"name":"getLifecycleSummary","description":"Subscription health snapshot: active count, MRR, 30-day churn, high-risk count.","method":"GET","path":"/api/lifecycle/summary","parameters":[],"sideEffects":"none"},{"name":"listHighRiskSubscriptions","description":"Subscriptions that need attention, with a plain-language riskReason. Query: limit (default 50).","method":"GET","path":"/api/subscriptions/high-risk","parameters":[{"name":"limit","in":"query","required":false,"description":"Maximum rows, 1 to 200. Default 50."}],"sideEffects":"none"},{"name":"getSubscriptionEvents","description":"Normalized event history for one subscription.","method":"GET","path":"/api/subscriptions/{id}/events","parameters":[{"name":"id","in":"path","required":true}],"sideEffects":"none"},{"name":"draftRecoveryPlaybook","description":"Draft recovery emails for 1 to 25 subscriptions. Drafts only: a person approves before anything is sent. Runs the decision and writing steps for each subscription and stores the result as a playbook that awaits approval. It never sends anything. Jev decides tone and likely cause when configured, a rules baseline otherwise. An AI model writes the email when a key is configured, a template otherwise. `writtenBy` and `decision.source` say which.","method":"POST","path":"/api/playbooks/recover-failed-payments","parameters":[],"inputSchema":{"type":"object","required":["subscriptionIds"],"properties":{"subscriptionIds":{"type":"array","minItems":1,"maxItems":25,"items":{"type":"string","examples":["sub_001"]},"description":"Ids from /api/subscriptions/high-risk."}}},"exampleInput":{"subscriptionIds":["sub_001"]},"sideEffects":"Stores a draft in demo memory. Sends nothing."},{"name":"getPlaybook","description":"Status and drafted emails for a playbook. Demo playbooks are kept in server memory and are lost when the server restarts.","method":"GET","path":"/api/playbooks/{id}","parameters":[{"name":"id","in":"path","required":true}],"sideEffects":"none"},{"name":"scanStoreReadiness","description":"Scan a store for agent readiness: score, per-dimension scores, findings and fix snippets. Fetches the public store page, robots.txt, sitemap, llms.txt and common policy pages, then scores four dimensions. This is a live scan, not synthetic data.","method":"POST","path":"/api/readiness/scan","parameters":[],"inputSchema":{"type":"object","required":["storeUrl"],"properties":{"storeUrl":{"type":"string","examples":["https://example-store.com"],"description":"A public store address. A missing scheme is treated as https."}}},"exampleInput":{"storeUrl":"https://example.com"},"sideEffects":"none"},{"name":"listReadinessAudits","description":"Past readiness audits. Empty in demo mode. Demo mode keeps no audit history, so this returns an empty array.","method":"GET","path":"/api/readiness/audits","parameters":[],"sideEffects":"none"},{"name":"listScenarios","description":"Available sandbox scenarios with event counts.","method":"GET","path":"/api/dev/scenarios","parameters":[],"sideEffects":"none"},{"name":"getScenarioEvents","description":"Event timeline and agent decisions for a scenario.","method":"GET","path":"/api/dev/scenarios/{name}/events","parameters":[{"name":"name","in":"path","required":true}],"sideEffects":"none"}]}