User APIhttps://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

OK.

{
  "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
}

The request is malformed: message maps each invalid field to its problem, or is a sentence when the body cannot be read at all.

{
  "error": "string",
  "message": "string",
  "meta": {}
}

The API key is missing, invalid, expired or revoked.

{
  "error": "string",
  "message": "string",
  "meta": {}
}

The key lacks the scope named in meta.required (or the level in meta.required_level), is used from an IP it does not allow, or the account is suspended.

{
  "error": "string",
  "message": "string",
  "meta": {}
}

Too many requests for this key; retry after the Retry-After seconds.

{
  "error": "string",
  "message": "string",
  "meta": {}
}

Something failed on our side and was logged; read the resource again before retrying a change.

{
  "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
subscription REQUIRED
string
The subscription's id.
Request body
enabled REQUIRED
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

OK.

{
  "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"
  }
}

The request is malformed: message maps each invalid field to its problem, or is a sentence when the body cannot be read at all.

{
  "error": "string",
  "message": "string",
  "meta": {}
}

The API key is missing, invalid, expired or revoked.

{
  "error": "string",
  "message": "string",
  "meta": {}
}

The key lacks the scope named in meta.required (or the level in meta.required_level), is used from an IP it does not allow, or the account is suspended.

{
  "error": "string",
  "message": "string",
  "meta": {}
}

No such resource, or it does not belong to the key's owner.

{
  "error": "string",
  "message": "string",
  "meta": {}
}

The request conflicts with the resource's current state; error names why.

{
  "error": "string",
  "message": "string",
  "meta": {}
}

Too many requests for this key; retry after the Retry-After seconds.

{
  "error": "string",
  "message": "string",
  "meta": {}
}

Something failed on our side and was logged; read the resource again before retrying a change.

{
  "error": "string",
  "message": "string",
  "meta": {}
}