End-to-end setup instructions for the hosted cancellation flow, result verification, and Advanced API integration paths.
Before you start
Public docs intentionally avoid workspace-specific secrets and identifiers. Create a workspace first, then use /dashboard/docs for your workspaceKey and return-host setup, plus/dashboard/settings?tab=api for API keys and the outbound webhook 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.
Advanced outbound webhooks
RetentBase can push cancellation.created and cancellation.outcome_updated to your HTTPS endpoint after hosted-flow or custom API events.
Delivery rules: target URLs must use public HTTPS, localhost and private network addresses are rejected, requests time out after roughly 6 seconds, and non-2xx responses are retried with backoff.
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`.
When using outbound webhooks, reject stale timestamps, verify `x-retentbase-signature-sha256`, and deduplicate on `x-retentbase-delivery-id`.
Use the dashboard billing surface for checkout and Stripe portal access instead of hard-coding plan changes.
Monitor `GET /api/health` for liveness and send `Authorization: Bearer <health token>` when you need deep database and Stripe status.
Log non-2xx responses with status + body to speed up integration debugging.
Related implementation pages
Use these pages to move from the public API reference into implementation planning, retention workflow design, and vendor evaluation.
Run the retention workflow
These pages are for teams that already know churn matters and need a management cadence around review, ownership, and follow-through.