Skip to content
Join our SlackContact usGet started

List Subscriptions

client.Subscriptions.List(ctx, query) (*SubscriptionListResponse, error)
get/subscriptions

List Subscriptions

ParametersExpand Collapse
query SubscriptionListParams
Limit param.Field[int64]optional
maximum100
minimum1
Offset param.Field[int64]optional
minimum0
RateCardID param.Field[string]optional

The ID of the rate card to list subscriptions for. Cannot be used with subject_id.

SubjectID param.Field[string]optional

The ID or external ID of the subject to list subscriptions for. Cannot be used with rate_card_id.

ReturnsExpand Collapse
type SubscriptionListResponse struct{…}
HasMore bool
Subscriptions []SubscriptionResource
ID string

The ID of the subscription.

CancelsAtEndOfCycle bool

Whether the subscription will be cancelled at the end of the current cycle.

CurrentPeriod SubscriptionResourceCurrentPeriod

The current period of the subscription if it is active.

End Time
formatdate-time
Start Time
formatdate-time
InclusiveEnd booloptional
InclusiveStart booloptional
CyclesNextAt Time

The date and time the next cycle of the subscription will start.

formatdate-time
EffectiveAt Time

The date and time the subscription became effective.

formatdate-time
Metadata map[string, string]
RateCardID string

The ID of the rate card of the subscription.

Status SubscriptionResourceStatus

The status of the subscription.

Accepts one of the following:
const SubscriptionResourceStatusActive SubscriptionResourceStatus = "active"
const SubscriptionResourceStatusCancelled SubscriptionResourceStatus = "cancelled"
const SubscriptionResourceStatusPaused SubscriptionResourceStatus = "paused"
SubjectID string

The ID of the subject that the subscription is for.

List Subscriptions
package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/-go"
  "github.com/stainless-sdks/-go/option"
)

func main() {
  client := lark.NewClient(
    option.WithAPIKey("My API Key"),
  )
  subscriptions, err := client.Subscriptions.List(context.TODO(), lark.SubscriptionListParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", subscriptions.HasMore)
}
{
  "has_more": true,
  "subscriptions": [
    {
      "id": "rc_sub_PuLvkNSP3IBCvjayBD3TXNQ6",
      "cancels_at_end_of_cycle": false,
      "current_period": {
        "end": "2025-11-01T00:00:00Z",
        "start": "2025-10-01T00:00:00Z",
        "inclusive_end": false,
        "inclusive_start": true
      },
      "cycles_next_at": "2025-11-01T00:00:00Z",
      "effective_at": "2025-10-01T00:00:00Z",
      "metadata": {},
      "rate_card_id": "rc_jQK2n0wutCj6bBcAIrL6o07g",
      "status": "active",
      "subject_id": "subj_VyX6Q96h5avMho8O7QWlKeXE"
    }
  ]
}
Returns Examples
{
  "has_more": true,
  "subscriptions": [
    {
      "id": "rc_sub_PuLvkNSP3IBCvjayBD3TXNQ6",
      "cancels_at_end_of_cycle": false,
      "current_period": {
        "end": "2025-11-01T00:00:00Z",
        "start": "2025-10-01T00:00:00Z",
        "inclusive_end": false,
        "inclusive_start": true
      },
      "cycles_next_at": "2025-11-01T00:00:00Z",
      "effective_at": "2025-10-01T00:00:00Z",
      "metadata": {},
      "rate_card_id": "rc_jQK2n0wutCj6bBcAIrL6o07g",
      "status": "active",
      "subject_id": "subj_VyX6Q96h5avMho8O7QWlKeXE"
    }
  ]
}