Subscription¶
List Subscriptions¶
| Description | Endpoint | Notes |
|---|---|---|
| Find All Subscriptions | GET /api/admin/subscriptions |
|
| Filter By User or Status | GET /api/admin/(users/{user_id})/subscriptions/(filter/{filter}) |
Filter can be one of active or inactive. |
Schema
subscriptions: Arrayid: Integerlabel: Stringexternal_id: Stringactive: Booleanuser: Objectid: Integerfull_name: Stringemail: Stringexternal_id: Stringlabels: Object
View Subscription¶
GET /api/admin/subscription/{id}
Schema
subscription: Objectid: Integerlabel: Stringexternal_id: Stringactive: Booleanrun_rate: Decimalsubscription_products: Arrayid: Integerexternal_id: Stringactive: Booleanstart_on: DateTimephase_type: Stringcreated_at: DateTimeupdated_at: DateTimeproduct: Objectid: Integerlabel: Stringresource_kind: Stringunit: Stringunit_type: Stringexternal_id: Stringcreated_at: DateTimeupdated_at: DateTimepackage: Objectid: Integercpu: Decimalmemory: Integerstorage: Integerbandwidth: Integerlocal_disk: Integermemory_swap: Integermemory_swappiness: Integerbackup: Integer
billing_resource: Objectid: Integerbilling_plan_id: Integerexternal_id: String
container: Objectid: Integername: Stringreq_state: Stringcurrent_state: Stringstats:Object<cpu: decimal, memory: decimal>local_ip: Stringpublic_ip: Stringproject_id: Integercontainer_service_idproject_id: Integercreated_at: DateTimeupdated_at: DateTimelinks: Objectcontainer_service: Stringlogs: Stringproject: String
region: Objectid: Integername: String
node: Objectid: Integerlabel: Stringhostname: Stringprimary_ip: Stringpublic_ip: String
user: Objectid: Integeremail: Stringexternal_id: Stringlabels: Object
Update Subscription¶
PATCH /api/admin/subscriptions/:id
Use this to upgrade or downgrade an existing service.
Will return a HTTP 200 if was successful, otherwise you will have a HTTP 40x code and a {"errors": []} response.
Schema
-
container_service: Objectproduct_id: The new product idqty: The total amount of containers you want. For example, if you have 1 container and you want 2, you would set this value to 2.
-
Example: Upgrade a product
-
Example: Scale a service up or down
Suspension¶
For integrations that rely on the subscription as their internal reference, we offer a helper api endpoint to suspend a user via their subscription.
This will suspend the user, not just the subscription.
Suspend¶
POST /api/admin/subscriptions/{subscription_id}/suspension
Unsuspend¶
DELETE /api/admin/subscriptions/{subscription_id}/suspension