User API
https://api.datafuel.ai
Help centerOpenAPI spec

Subscriptions

The subscriptions that renew plans.

GET/api/v1/subscriptionsscope: api.<service>.read

List subscriptions

The subscriptions that renew your plans, for the services this key may read.

Requires the read level on at least one service.

Query
limit
integer
How many results to return, 1–100. Default: 50.
offset
integer
How many results to skip. Default: 0.
Request
cURL
curl https://api.datafuel.ai/api/v1/subscriptions \
  --header 'Authorization: Bearer df_live_your_key_here'
Response
{
  "results": [
    {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "service": "static",
      "product": "isp",
      "plan_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "status": "pending",
      "auto_renew": false,
      "period_ends_at": "2026-01-01T00:00:00Z",
      "period_days": 0,
      "price": 0,
      "currency": "usd",
      "payment": {
        "method": "balance",
        "card_id": "string"
      }
    }
  ],
  "count": 0,
  "limit": 0,
  "offset": 0
}
{
  "error": "string",
  "message": "string",
  "meta": {}
}
{
  "error": "string",
  "message": "string",
  "meta": {}
}
{
  "error": "string",
  "message": "string",
  "meta": {}
}
{
  "error": "string",
  "message": "string",
  "meta": {}
}
{
  "error": "string",
  "message": "string",
  "meta": {}
}
PUT/api/v1/subscriptions/{subscription}/auto-renewscope: api.<service>.manage

Turn auto-renew on or off

Needs manage on the subscription's service. Turning it off keeps the plan until period_ends_at; turning it on again before then resumes renewals. Asking for the state the subscription is already in changes nothing and answers it. For a subscription paid by card, card_id switches the card renewals are charged to. 409 subscription_ended once it has expired, no_saved_card when a card subscription has no card left to resume on.

Requires the manage level on at least one service.

Path
subscriptionREQUIRED
string
The subscription's id.
Request body
enabledREQUIRED
boolean
card_id
string
Only with enabled true, for a subscription paid by card: the saved card renewals are charged to from now on. Omitted, a running subscription keeps its card and a cancelled one resumes on its previous card, or the default card when that one is gone.
Request
cURL
curl https://api.datafuel.ai/api/v1/subscriptions/{subscription}/auto-renew \
  --request PUT \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer df_live_your_key_here' \
  --data '{
    "enabled": false,
    "card_id": "string"
  }'
Response
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "service": "static",
  "product": "isp",
  "plan_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "status": "pending",
  "auto_renew": false,
  "period_ends_at": "2026-01-01T00:00:00Z",
  "period_days": 0,
  "price": 0,
  "currency": "usd",
  "payment": {
    "method": "balance",
    "card_id": "string"
  }
}
{
  "error": "string",
  "message": "string",
  "meta": {}
}
{
  "error": "string",
  "message": "string",
  "meta": {}
}
{
  "error": "string",
  "message": "string",
  "meta": {}
}
{
  "error": "string",
  "message": "string",
  "meta": {}
}
{
  "error": "string",
  "message": "string",
  "meta": {}
}
{
  "error": "string",
  "message": "string",
  "meta": {}
}
{
  "error": "string",
  "message": "string",
  "meta": {}
}