List enrollments

GET/enrollments

Lists enrollments across all users in the account.

At least one of user_id, product_id, delivery_id, or updated_after must be supplied; requests without any of these filters are rejected with a validation error. When the credentials are restricted to specific products or users, only enrollments within that scope are returned. Revoked enrollments are excluded unless status=revoked or deleted=true is supplied.

Each item includes a links.self URL pointing to the enrollment under its user.

AuthorizationBearer <token>

Autonomous mode: the API credential secret, sent as a bearer token. Credential secrets are identified by a fixed prefix.

In: header

Query Parameters

limit?integer

Maximum number of items to return, from 1 to 200.

Range1 <= value <= 200
cursor?string

Cursor for the next page, taken from page.next_cursor of the previous response.

user_id?string

Only enrollments of the user with this public ID.

product_id?string

Only enrollments in the product with this public ID.

delivery_id?string

Only enrollments granted by the delivery with this public ID.

status?string

Only enrollments with this status.

Value in

  • "active"
  • "suspended"
  • "revoked"
origin?string

Only enrollments with this origin.

Value in

  • "manual"
  • "sale"
  • "subscription"
deleted?boolean

When true, returns only items in the trash. Items in the trash are excluded by default.

updated_after?string

Only items updated after this date and time (ISO 8601).

Formatdate-time

Header Parameters

X-Client-Request-Id?string

Optional client-generated identifier of the request, up to 64 characters from [A-Za-z0-9._-]. Echoed back in the response and recorded in the request log; it never replaces the server-generated X-Request-Id.

Lengthlength <= 64

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/enrollments"
{  "data": [    {      "created_at": "2019-08-24T14:15:22Z",      "deleted": true,      "delivery_id": "string",      "ends_at": "2019-08-24T14:15:22Z",      "id": "string",      "object": "enrollment",      "origin": {        "kind": "manual",        "sale_id": "string",        "subscription_id": "string"      },      "product_ids": [        "string"      ],      "revision": "string",      "status": "active",      "subscription_ends_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z",      "user_id": "string"    }  ],  "page": {    "limit": 1,    "next_cursor": "string",    "prev_cursor": "string"  }}