End-to-end setup instructions for Hosted Flow and Advanced API integration.
Before you start
Public docs intentionally avoid workspace-specific secrets and identifiers. Create a workspace first, then use /dashboard/docs to access your actual workspaceKey and Signing Secret.
Hosted helper API POST /api/v1/cancel-link is available on Core and Advanced. Session diagnostics (GET /api/v1/cancel-sessions/:id) and custom cancellation ingestion/update APIs require Advanced.
Choose integration model
Call the RetentBase API at https://api.retentbase.com. If you use the hosted cancellation flow, redirect customers to the cancel host at https://cancel.retentbase.com.
Workspace is read-only due to expired subscription access.
403
Advanced plan required or demo workspace blocked.
415
Content-Type must be application/json.
429
Rate limit exceeded.
PATCH/api/v1/cancellations/{eventId}
Updates final business outcome for an existing cancellation event.
Notes
Use the same environment as the original POST request.
PATCH only sets the final billing outcome; it does not change the reason or offer data.
Availability
Advanced plan only
Auth
Authorization: Bearer <Workspace API Key> or x-api-key
Content-Type
application/json
Path Parameters
Field
Type
Required
Description
eventId
string
Yes
The eventId from the original POST request.
JSON Body
Field
Type
Required
Description
environment
"prod" | "sandbox"
No
Environment for the update.
outcome
"churned" | "recovered"
Yes
Final billing outcome.
effectiveAt
string(ISO datetime)
No
Optional timestamp for the effective outcome.
metadata
object
No
Optional flat object recorded with the outcome update.
Success Responses
Status
Meaning
200
Outcome updated.
Error Responses
Status
Meaning
400
Invalid body or path parameter.
401
Missing or invalid API key.
403
Advanced plan required or demo workspace blocked.
404
Event not found in selected environment.
409
Event exists but in the other environment.
415
Content-Type must be application/json.
429
Rate limit exceeded.
Implementation checklist
Store workspace API keys and any result-token verification helpers only in server-side code.
Use stable `eventId` values to guarantee idempotent retries.
Use sandbox mode (`environment: "sandbox"`) before enabling production traffic.
Sandbox traffic stays isolated from retention health, weekly issue detection, and scheduled report emails.
Set Stripe webhook to `POST /api/stripe/webhook` and include `checkout.session.completed`, `customer.subscription.*`, `invoice.paid`, and `invoice.payment_failed`.
Use the dashboard billing surface for checkout and Stripe portal access instead of hard-coding plan changes.
Monitor `GET /api/health?deep=1` (authorized) for Stripe, notifications, and webhook pipeline health.
Log non-2xx responses with status + body to speed up integration debugging.