The subscription object provides access to subscription information for a workspace or user. This object contains details about the subscription status, usage, and related information.

Availability

The subscription object is available within the workspace or user.workspace objects.

Properties

The subscription object contains the following properties:

id
string
required

A unique identifier for the subscription.

trial_period_days
integer|null
required

The number of days in the trial period. This can be null if there is no trial period.

usage_count
number
required

The amount of usage consumed in the current subscription period.

usage_percentage
string
required

The percentage of usage consumed, represented as a string with two decimal places.

credit_count
number
required

The remaining credit available in the current subscription period.

credit_percentage
string
required

The percentage of credit remaining, represented as a string with two decimal places.

created_at
integer
required

The Unix timestamp representing when the subscription was created.

updated_at
integer|null
required

The Unix timestamp representing when the subscription was last updated.

canceled_at
integer|null
required

The Unix timestamp representing when the subscription was canceled. This can be null if the subscription has not been canceled.

cancel_at
integer|null
required

The Unix timestamp representing when the subscription is scheduled to be canceled. This can be null if no cancellation is scheduled.

renew_at
integer
required

The Unix timestamp representing when the subscription is scheduled to renew.

plan
PlanSnapshot
required

A link to the PlanSnapshot object associated with this subscription. See Plan Snapshot Object for more details on the properties of this object.

currency
Currency|null
required

A link to the Currency object associated with this subscription. See Currency Object for more details on the properties of this object.