HTTP API

Subscription

POST/api/v1/subscriptions/check
POST
/api/v1/subscriptions/check

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/subscriptions/check" \  -H "Content-Type: application/json" \  -d '{}'
{  "allowed": true,  "expires_at": "2019-08-24T14:15:22Z",  "lease_id": "string",  "plan_id": "string",  "reason": "string",  "status": null,  "subscription_id": "string"}
POST/api/v1/subscriptions/grants
POST
/api/v1/subscriptions/grants

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/subscriptions/grants" \  -H "Content-Type: application/json" \  -d '{    "plan_id": "string"  }'
{  "expires_at": "2019-08-24T14:15:22Z",  "grace_ends_at": "2019-08-24T14:15:22Z",  "starts_at": "2019-08-24T14:15:22Z",  "status": "trialing",  "subscription_id": "string"}
POST/api/v1/subscriptions/grants/batch
POST
/api/v1/subscriptions/grants/batch

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

A batch of subscription grants. Each grant is authorized per-entry by the handler and applied independently and fail-fast; the server enforces a cap.

Response Body

application/json

curl -X POST "https://example.com/api/v1/subscriptions/grants/batch" \  -H "Content-Type: application/json" \  -d '{    "grants": [      {        "plan_id": "string"      }    ]  }'
{  "count": 0,  "results": [    {      "expires_at": "2019-08-24T14:15:22Z",      "grace_ends_at": "2019-08-24T14:15:22Z",      "starts_at": "2019-08-24T14:15:22Z",      "status": "trialing",      "subscription_id": "string"    }  ]}
GET/api/v1/subscriptions/lapses/due
GET
/api/v1/subscriptions/lapses/due

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X GET "https://example.com/api/v1/subscriptions/lapses/due"
{  "count": 0,  "subscriptions": [    {      "due_at": "2019-08-24T14:15:22Z",      "subscription_id": "string"    }  ]}
POST/api/v1/subscriptions/lapses/run
POST
/api/v1/subscriptions/lapses/run

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X POST "https://example.com/api/v1/subscriptions/lapses/run"
{  "leases": [    {      "id": "string",      "outcome": "string"    }  ],  "leases_processed": 0,  "subscriptions": [    {      "id": "string",      "outcome": "string"    }  ],  "subscriptions_processed": 0}
GET/api/v1/subscriptions/plans
GET
/api/v1/subscriptions/plans

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Query Parameters

q?string

Full-text search query applied to plan name

page?integer

1-indexed page number

Formatint64
Range0 <= value
page_size?integer

Page size

Formatint64
Range0 <= value
sort_by?string

Sort field (created_at, name)

sort_order?string

Sort order (asc or desc)

Value in

  • "asc"
  • "desc"

Response Body

application/json

curl -X GET "https://example.com/api/v1/subscriptions/plans"
{  "pagination": {    "has_more": true,    "page": 0,    "page_size": 0,    "total": 0  },  "plans": [    {      "access_window": {        "allow_fixed_end": true,        "allow_fixed_start": true,        "default_duration_days": 0      },      "agent_seat_leasing": {        "allowed_scopes": [          "string"        ],        "enabled": true,        "max_active_leases": 0,        "max_lease_minutes": 0      },      "created_at": "2019-08-24T14:15:22Z",      "created_by": "string",      "features": [        "string"      ],      "grace_period": {        "access_level": "limited",        "duration_days": 0,        "enabled": true      },      "grandfathering": {        "benefit_snapshot_on_grant": true,        "enabled": true      },      "group_policy": {        "enabled": true,        "max_seats": 0,        "seat_transfer_cooldown_days": 0      },      "name": "string",      "pause_policy": {        "enabled": true,        "extend_expiry_by_pause": true,        "max_pause_days_per_year": 0      },      "plan_id": "string",      "status": "active",      "trial": {        "duration_days": 0,        "enabled": true,        "one_trial_per_user": true,        "requires_payment_method": true      },      "updated_at": "2019-08-24T14:15:22Z",      "upgrade_policy": {        "co_terming_allowed": true,        "proration_mode": "time_credit"      },      "usage_capped_time": {        "enabled": true,        "included_minutes": 0,        "reset_period": "subscription_window"      }    }  ]}
POST/api/v1/subscriptions/plans
POST
/api/v1/subscriptions/plans

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/subscriptions/plans" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{  "access_window": {    "allow_fixed_end": true,    "allow_fixed_start": true,    "default_duration_days": 0  },  "agent_seat_leasing": {    "allowed_scopes": [      "string"    ],    "enabled": true,    "max_active_leases": 0,    "max_lease_minutes": 0  },  "created_at": "2019-08-24T14:15:22Z",  "created_by": "string",  "features": [    "string"  ],  "grace_period": {    "access_level": "limited",    "duration_days": 0,    "enabled": true  },  "grandfathering": {    "benefit_snapshot_on_grant": true,    "enabled": true  },  "group_policy": {    "enabled": true,    "max_seats": 0,    "seat_transfer_cooldown_days": 0  },  "name": "string",  "pause_policy": {    "enabled": true,    "extend_expiry_by_pause": true,    "max_pause_days_per_year": 0  },  "plan_id": "string",  "status": "active",  "trial": {    "duration_days": 0,    "enabled": true,    "one_trial_per_user": true,    "requires_payment_method": true  },  "updated_at": "2019-08-24T14:15:22Z",  "upgrade_policy": {    "co_terming_allowed": true,    "proration_mode": "time_credit"  },  "usage_capped_time": {    "enabled": true,    "included_minutes": 0,    "reset_period": "subscription_window"  }}
GET/api/v1/subscriptions/plans/{plan_id}
GET
/api/v1/subscriptions/plans/{plan_id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

plan_id*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/subscriptions/plans/string"
{  "access_window": {    "allow_fixed_end": true,    "allow_fixed_start": true,    "default_duration_days": 0  },  "agent_seat_leasing": {    "allowed_scopes": [      "string"    ],    "enabled": true,    "max_active_leases": 0,    "max_lease_minutes": 0  },  "created_at": "2019-08-24T14:15:22Z",  "created_by": "string",  "features": [    "string"  ],  "grace_period": {    "access_level": "limited",    "duration_days": 0,    "enabled": true  },  "grandfathering": {    "benefit_snapshot_on_grant": true,    "enabled": true  },  "group_policy": {    "enabled": true,    "max_seats": 0,    "seat_transfer_cooldown_days": 0  },  "name": "string",  "pause_policy": {    "enabled": true,    "extend_expiry_by_pause": true,    "max_pause_days_per_year": 0  },  "plan_id": "string",  "status": "active",  "trial": {    "duration_days": 0,    "enabled": true,    "one_trial_per_user": true,    "requires_payment_method": true  },  "updated_at": "2019-08-24T14:15:22Z",  "upgrade_policy": {    "co_terming_allowed": true,    "proration_mode": "time_credit"  },  "usage_capped_time": {    "enabled": true,    "included_minutes": 0,    "reset_period": "subscription_window"  }}
PUT/api/v1/subscriptions/plans/{plan_id}
PUT
/api/v1/subscriptions/plans/{plan_id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

plan_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X PUT "https://example.com/api/v1/subscriptions/plans/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "access_window": {    "allow_fixed_end": true,    "allow_fixed_start": true,    "default_duration_days": 0  },  "agent_seat_leasing": {    "allowed_scopes": [      "string"    ],    "enabled": true,    "max_active_leases": 0,    "max_lease_minutes": 0  },  "created_at": "2019-08-24T14:15:22Z",  "created_by": "string",  "features": [    "string"  ],  "grace_period": {    "access_level": "limited",    "duration_days": 0,    "enabled": true  },  "grandfathering": {    "benefit_snapshot_on_grant": true,    "enabled": true  },  "group_policy": {    "enabled": true,    "max_seats": 0,    "seat_transfer_cooldown_days": 0  },  "name": "string",  "pause_policy": {    "enabled": true,    "extend_expiry_by_pause": true,    "max_pause_days_per_year": 0  },  "plan_id": "string",  "status": "active",  "trial": {    "duration_days": 0,    "enabled": true,    "one_trial_per_user": true,    "requires_payment_method": true  },  "updated_at": "2019-08-24T14:15:22Z",  "upgrade_policy": {    "co_terming_allowed": true,    "proration_mode": "time_credit"  },  "usage_capped_time": {    "enabled": true,    "included_minutes": 0,    "reset_period": "subscription_window"  }}
GET/api/v1/subscriptions/users/{user_id}
GET
/api/v1/subscriptions/users/{user_id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

user_id*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/subscriptions/users/string"
{  "count": 0,  "subscriptions": [    {      "access": {        "current_period_end": "2019-08-24T14:15:22Z",        "current_period_start": "2019-08-24T14:15:22Z",        "expires_at": "2019-08-24T14:15:22Z",        "grace_ends_at": "2019-08-24T14:15:22Z",        "starts_at": "2019-08-24T14:15:22Z"      },      "created_at": "2019-08-24T14:15:22Z",      "created_by": "string",      "grandfathered_features": [        "string"      ],      "group_id": "string",      "pause": {        "pause_year_started_at": "2019-08-24T14:15:22Z",        "paused": true,        "paused_at": "2019-08-24T14:15:22Z",        "paused_seconds_this_year": 0,        "total_paused_seconds": 0      },      "plan_id": "string",      "seats": {        "active_agent_leases": [          "string"        ],        "members": [          "string"        ],        "owner_user_id": "string",        "seat_transfer_log": {          "property1": 0,          "property2": 0        }      },      "status": "trialing",      "subscription_id": "string",      "trial": {        "active": true,        "ends_at": "2019-08-24T14:15:22Z",        "started_at": "2019-08-24T14:15:22Z"      },      "updated_at": "2019-08-24T14:15:22Z",      "usage": {        "consumed_minutes": 0,        "included_minutes": 0,        "window_resets_at": "2019-08-24T14:15:22Z"      },      "user_id": "string"    }  ]}
DELETE/api/v1/subscriptions/{subscription_id}
DELETE
/api/v1/subscriptions/{subscription_id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

subscription_id*string

Response Body

application/json

curl -X DELETE "https://example.com/api/v1/subscriptions/string"
{  "access": {    "current_period_end": "2019-08-24T14:15:22Z",    "current_period_start": "2019-08-24T14:15:22Z",    "expires_at": "2019-08-24T14:15:22Z",    "grace_ends_at": "2019-08-24T14:15:22Z",    "starts_at": "2019-08-24T14:15:22Z"  },  "created_at": "2019-08-24T14:15:22Z",  "created_by": "string",  "grandfathered_features": [    "string"  ],  "group_id": "string",  "pause": {    "pause_year_started_at": "2019-08-24T14:15:22Z",    "paused": true,    "paused_at": "2019-08-24T14:15:22Z",    "paused_seconds_this_year": 0,    "total_paused_seconds": 0  },  "plan_id": "string",  "seats": {    "active_agent_leases": [      "string"    ],    "members": [      "string"    ],    "owner_user_id": "string",    "seat_transfer_log": {      "property1": 0,      "property2": 0    }  },  "status": "trialing",  "subscription_id": "string",  "trial": {    "active": true,    "ends_at": "2019-08-24T14:15:22Z",    "started_at": "2019-08-24T14:15:22Z"  },  "updated_at": "2019-08-24T14:15:22Z",  "usage": {    "consumed_minutes": 0,    "included_minutes": 0,    "window_resets_at": "2019-08-24T14:15:22Z"  },  "user_id": "string"}
POST/api/v1/subscriptions/{subscription_id}/group/members
POST
/api/v1/subscriptions/{subscription_id}/group/members

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

subscription_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/subscriptions/string/group/members" \  -H "Content-Type: application/json" \  -d '{    "user_id": "string"  }'
{  "access": {    "current_period_end": "2019-08-24T14:15:22Z",    "current_period_start": "2019-08-24T14:15:22Z",    "expires_at": "2019-08-24T14:15:22Z",    "grace_ends_at": "2019-08-24T14:15:22Z",    "starts_at": "2019-08-24T14:15:22Z"  },  "created_at": "2019-08-24T14:15:22Z",  "created_by": "string",  "grandfathered_features": [    "string"  ],  "group_id": "string",  "pause": {    "pause_year_started_at": "2019-08-24T14:15:22Z",    "paused": true,    "paused_at": "2019-08-24T14:15:22Z",    "paused_seconds_this_year": 0,    "total_paused_seconds": 0  },  "plan_id": "string",  "seats": {    "active_agent_leases": [      "string"    ],    "members": [      "string"    ],    "owner_user_id": "string",    "seat_transfer_log": {      "property1": 0,      "property2": 0    }  },  "status": "trialing",  "subscription_id": "string",  "trial": {    "active": true,    "ends_at": "2019-08-24T14:15:22Z",    "started_at": "2019-08-24T14:15:22Z"  },  "updated_at": "2019-08-24T14:15:22Z",  "usage": {    "consumed_minutes": 0,    "included_minutes": 0,    "window_resets_at": "2019-08-24T14:15:22Z"  },  "user_id": "string"}
DELETE/api/v1/subscriptions/{subscription_id}/group/members/{user_id}
DELETE
/api/v1/subscriptions/{subscription_id}/group/members/{user_id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

subscription_id*string
user_id*string

Response Body

application/json

curl -X DELETE "https://example.com/api/v1/subscriptions/string/group/members/string"
{  "message": "string"}
POST/api/v1/subscriptions/{subscription_id}/leases
POST
/api/v1/subscriptions/{subscription_id}/leases

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

subscription_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/subscriptions/string/leases" \  -H "Content-Type: application/json" \  -d '{    "leased_to_agent_id": "string",    "minutes": 0,    "scopes": [      "string"    ]  }'
{  "created_at": "2019-08-24T14:15:22Z",  "expires_at": "2019-08-24T14:15:22Z",  "lease_id": "string",  "leased_to_agent_id": "string",  "parent_agent_id": "string",  "scopes": [    "string"  ],  "starts_at": "2019-08-24T14:15:22Z",  "status": "active",  "subscription_id": "string"}
DELETE/api/v1/subscriptions/{subscription_id}/leases/{lease_id}
DELETE
/api/v1/subscriptions/{subscription_id}/leases/{lease_id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

subscription_id*string
lease_id*string

Response Body

application/json

curl -X DELETE "https://example.com/api/v1/subscriptions/string/leases/string"
{  "lease_id": "string",  "message": "string"}
POST/api/v1/subscriptions/{subscription_id}/pause
POST
/api/v1/subscriptions/{subscription_id}/pause

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

subscription_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/subscriptions/string/pause" \  -H "Content-Type: application/json" \  -d '{}'
{  "access": {    "current_period_end": "2019-08-24T14:15:22Z",    "current_period_start": "2019-08-24T14:15:22Z",    "expires_at": "2019-08-24T14:15:22Z",    "grace_ends_at": "2019-08-24T14:15:22Z",    "starts_at": "2019-08-24T14:15:22Z"  },  "created_at": "2019-08-24T14:15:22Z",  "created_by": "string",  "grandfathered_features": [    "string"  ],  "group_id": "string",  "pause": {    "pause_year_started_at": "2019-08-24T14:15:22Z",    "paused": true,    "paused_at": "2019-08-24T14:15:22Z",    "paused_seconds_this_year": 0,    "total_paused_seconds": 0  },  "plan_id": "string",  "seats": {    "active_agent_leases": [      "string"    ],    "members": [      "string"    ],    "owner_user_id": "string",    "seat_transfer_log": {      "property1": 0,      "property2": 0    }  },  "status": "trialing",  "subscription_id": "string",  "trial": {    "active": true,    "ends_at": "2019-08-24T14:15:22Z",    "started_at": "2019-08-24T14:15:22Z"  },  "updated_at": "2019-08-24T14:15:22Z",  "usage": {    "consumed_minutes": 0,    "included_minutes": 0,    "window_resets_at": "2019-08-24T14:15:22Z"  },  "user_id": "string"}
POST/api/v1/subscriptions/{subscription_id}/resume
POST
/api/v1/subscriptions/{subscription_id}/resume

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

subscription_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/subscriptions/string/resume" \  -H "Content-Type: application/json" \  -d '{}'
{  "access": {    "current_period_end": "2019-08-24T14:15:22Z",    "current_period_start": "2019-08-24T14:15:22Z",    "expires_at": "2019-08-24T14:15:22Z",    "grace_ends_at": "2019-08-24T14:15:22Z",    "starts_at": "2019-08-24T14:15:22Z"  },  "created_at": "2019-08-24T14:15:22Z",  "created_by": "string",  "grandfathered_features": [    "string"  ],  "group_id": "string",  "pause": {    "pause_year_started_at": "2019-08-24T14:15:22Z",    "paused": true,    "paused_at": "2019-08-24T14:15:22Z",    "paused_seconds_this_year": 0,    "total_paused_seconds": 0  },  "plan_id": "string",  "seats": {    "active_agent_leases": [      "string"    ],    "members": [      "string"    ],    "owner_user_id": "string",    "seat_transfer_log": {      "property1": 0,      "property2": 0    }  },  "status": "trialing",  "subscription_id": "string",  "trial": {    "active": true,    "ends_at": "2019-08-24T14:15:22Z",    "started_at": "2019-08-24T14:15:22Z"  },  "updated_at": "2019-08-24T14:15:22Z",  "usage": {    "consumed_minutes": 0,    "included_minutes": 0,    "window_resets_at": "2019-08-24T14:15:22Z"  },  "user_id": "string"}
POST/api/v1/subscriptions/{subscription_id}/trial/start
POST
/api/v1/subscriptions/{subscription_id}/trial/start

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

subscription_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/subscriptions/string/trial/start" \  -H "Content-Type: application/json" \  -d '{}'
{  "access": {    "current_period_end": "2019-08-24T14:15:22Z",    "current_period_start": "2019-08-24T14:15:22Z",    "expires_at": "2019-08-24T14:15:22Z",    "grace_ends_at": "2019-08-24T14:15:22Z",    "starts_at": "2019-08-24T14:15:22Z"  },  "created_at": "2019-08-24T14:15:22Z",  "created_by": "string",  "grandfathered_features": [    "string"  ],  "group_id": "string",  "pause": {    "pause_year_started_at": "2019-08-24T14:15:22Z",    "paused": true,    "paused_at": "2019-08-24T14:15:22Z",    "paused_seconds_this_year": 0,    "total_paused_seconds": 0  },  "plan_id": "string",  "seats": {    "active_agent_leases": [      "string"    ],    "members": [      "string"    ],    "owner_user_id": "string",    "seat_transfer_log": {      "property1": 0,      "property2": 0    }  },  "status": "trialing",  "subscription_id": "string",  "trial": {    "active": true,    "ends_at": "2019-08-24T14:15:22Z",    "started_at": "2019-08-24T14:15:22Z"  },  "updated_at": "2019-08-24T14:15:22Z",  "usage": {    "consumed_minutes": 0,    "included_minutes": 0,    "window_resets_at": "2019-08-24T14:15:22Z"  },  "user_id": "string"}
POST/api/v1/subscriptions/{subscription_id}/upgrade
POST
/api/v1/subscriptions/{subscription_id}/upgrade

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

subscription_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/subscriptions/string/upgrade" \  -H "Content-Type: application/json" \  -d '{    "plan_id": "string"  }'
{  "access": {    "current_period_end": "2019-08-24T14:15:22Z",    "current_period_start": "2019-08-24T14:15:22Z",    "expires_at": "2019-08-24T14:15:22Z",    "grace_ends_at": "2019-08-24T14:15:22Z",    "starts_at": "2019-08-24T14:15:22Z"  },  "created_at": "2019-08-24T14:15:22Z",  "created_by": "string",  "grandfathered_features": [    "string"  ],  "group_id": "string",  "pause": {    "pause_year_started_at": "2019-08-24T14:15:22Z",    "paused": true,    "paused_at": "2019-08-24T14:15:22Z",    "paused_seconds_this_year": 0,    "total_paused_seconds": 0  },  "plan_id": "string",  "seats": {    "active_agent_leases": [      "string"    ],    "members": [      "string"    ],    "owner_user_id": "string",    "seat_transfer_log": {      "property1": 0,      "property2": 0    }  },  "status": "trialing",  "subscription_id": "string",  "trial": {    "active": true,    "ends_at": "2019-08-24T14:15:22Z",    "started_at": "2019-08-24T14:15:22Z"  },  "updated_at": "2019-08-24T14:15:22Z",  "usage": {    "consumed_minutes": 0,    "included_minutes": 0,    "window_resets_at": "2019-08-24T14:15:22Z"  },  "user_id": "string"}
POST/api/v1/subscriptions/{subscription_id}/usage
POST
/api/v1/subscriptions/{subscription_id}/usage

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

subscription_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/subscriptions/string/usage" \  -H "Content-Type: application/json" \  -d '{    "minutes": 0  }'
{  "consumed_minutes": 0,  "exhausted": true,  "included_minutes": 0,  "remaining_minutes": 0,  "subscription_id": "string"}

On this page