/api/v1/cancel-linkCreates a hosted-flow URL with a short-lived token and a session_id for diagnostics.
Notes
- Use user_id as your stable customer reference.
- Use context only for analytics enrichment; the hosted flow works without MRR or tenure.
Availability
Core and Advanced plans
Auth
Authorization: Bearer <Workspace API Key> or x-api-key
Content-Type
application/json
JSON Body
| Field | Type | Required | Description |
|---|---|---|---|
| userId | string | Yes | Your stable user identifier. |
| returnUrl | string(url) | No | Override callback URL. Must be allowlisted. |
| environment | "prod" | "sandbox" | No | Environment for the hosted session. |
| context.plan | string | No | Customer plan label for analytics context. |
| context.mrr | number | No | Optional (Advanced): monthly recurring revenue for segmentation cohorts. |
| context.tenureDays | integer | No | Optional (Advanced): customer tenure in days for lifecycle cohorts. |
| metadata | object | No | Optional flat object (string/number/boolean/null values). |
Success Responses
| Status | Meaning |
|---|---|
| 200 | Returns hosted URL, expires_at, environment and session_id. |
Error Responses
| Status | Meaning |
|---|---|
| 400 | Invalid body or return_url not allowlisted. |
| 401 | Missing/invalid API key. |
| 402 | Workspace is read-only due to expired subscription access. |
| 403 | Forbidden: this endpoint is unavailable for the current workspace or plan. |
| 409 | Default return URL is not configured. |
| 415 | Content-Type must be application/json. |
| 429 | Rate limit exceeded. |