Skip to content

Retrieve subscription history

Method

GET https://papi.afi.ai/api/v1/orgs/{org_id}/licensing/subscriptions/history

Description

Returns historical usage for the organization’s subscriptions over the requested period. If the licensed quantity changes during the requested time window, multiple records are returned for the same subscription.

Only post-pay subscriptions are included in the response.

Path params
org_id string required

ID of the organization to list subscriptions for.

Query params
start date-time

Start of the reporting window (RFC 3339). The window must span 1–40 days.

end date-time

End of the reporting window (RFC 3339). Must be at least one hour in the past from now.

curl -X GET \
    -H 'Authorization: {api-key}' \
    https://papi.afi.ai/api/v1/orgs/{org_id}/licensing/subscriptions/history

Successful response (200) schema
object

SubscriptionHistoryResult is the response to a subscription history request.

items array of objects
object

SubscriptionHistoryItem represents a time span during which the licensed subscription item quantity stays constant.

sub_id string

ID of the subscription.

tenant_id string

Tenant ID that the subscription is assigned to.

kind string

Subscription item kind (resource, storage, node, virtual machine, database, etc.).

qty int64

Number of licensed units of the item kind, e.g. 10 resources or 5 additional storage licences, each granting 100 GB of quota.

start date-time

Start of the period (RFC 3339).

end date-time

End of the period (RFC 3339).

Response example
{
  "items": [
    {
      "sub_id": "string",
      "tenant_id": "string",
      "kind": "string",
      "qty": "int64-as-string",
      "start": "2025-05-30T03:36:39.926865Z",
      "end": "2025-05-30T03:36:39.926866Z"
    }
  ]
}