Skip to main content
GET
/
v1
/
billing
/
subscription
Subscription
curl --request GET \
  --url https://api.example.com/v1/billing/subscription \
  --header 'Authorization: <authorization>'

Overview

Returns the current subscription for your tenant, including the active plan, billing cycle, and quota usage for the current period. Required role: admin

Request headers

Authorization
string
required
JWT Bearer token. Format: Bearer <your-jwt>.

Response

Returns 200 OK.
{
  "subscriptionId": "sub_01HX9VTPQR3KF8MZWBYD5N6JCE",
  "planId": "plan_pro",
  "planName": "Pro",
  "status": "active",
  "currentPeriodStart": "2024-04-01T00:00:00Z",
  "currentPeriodEnd": "2024-05-01T00:00:00Z",
  "cancelAtPeriodEnd": false,
  "usage": {
    "investigationsUsed": 142,
    "investigationsLimit": 500,
    "eventsUsed": 8420,
    "eventsLimit": 10000
  },
  "paymentMethod": {
    "type": "card",
    "last4": "4242",
    "brand": "visa"
  }
}
FieldTypeDescription
subscriptionIdstringUnique subscription identifier
planIdstringActive plan ID
statusstringOne of: active, past_due, canceled, trialing
currentPeriodStartstringStart of the current billing period
currentPeriodEndstringEnd of the current billing period
cancelAtPeriodEndbooleantrue if subscription will not renew
usage.investigationsUsedintegerInvestigations consumed this period
usage.investigationsLimitintegerMonthly investigation quota

Change plan

To change plans, send a PATCH to /v1/billing/subscription:
{ "planId": "plan_business" }
Upgrades take effect immediately. Downgrades take effect at the end of the current period.

Error responses

StatusError codeDescription
401unauthorizedMissing or invalid JWT
403forbiddenCaller lacks admin role
404no_subscriptionTenant has no active subscription

Examples

# Get subscription
curl https://api.causeflow.ai/v1/billing/subscription \
  -H "Authorization: Bearer eyJhbGc..."

# Upgrade plan
curl https://api.causeflow.ai/v1/billing/subscription \
  -X PATCH \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "Content-Type: application/json" \
  -d '{ "planId": "plan_business" }'

Usage

View detailed usage breakdown

Credits

View your credit balance