Managing subscriptions
/subscriptions is where you subscribe an organization to a product and manage what it holds. A subscription joins one organization to one catalog product; an organization holds at most one subscription per product. This guide covers the full lifecycle: create, list, read and delete. There is no update: to change what an organization holds, delete the subscription and create another.
Provisioning happens on the platform side. You never see or choose the system that provisions a product; the product's catalog entry decides that, and the API answers the same way for every product type.
Before you start
You need a valid access token. Get one as an API client. Listing and reading need the api:full:read scope; creating and deleting need api:full:write. See Access scopes.
You also need two ids:
orgId: the organization's canonical id, a UUID.productId: the catalog product's canonical id, also a UUID.
You can act for your own organization and for any organization below it in your hierarchy. An orgId outside that scope answers 404; the API does not distinguish "does not exist" from "not yours".
Pin apiVersion on every call to protect your integration from future changes. Omitting it selects the current default, 1.0.
Create a subscription
POST to /subscriptions with the organization and the product:
curl -sS -X POST "https://api.cybersentriq.com/subscriptions?apiVersion=1.0" \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"orgId":"<ORG_ID>","productId":"<PRODUCT_ID>"}'
const res = await fetch("https://api.cybersentriq.com/subscriptions?apiVersion=1.0", {
method: "POST",
headers: {
Authorization: `Bearer ${accessToken}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ orgId, productId }),
});
const subscription = await res.json();
Trials cannot be provisioned: the platform is paid-only, and the request body carries no trial field.
A 201 means the subscription is provisioned and active:
{
"id": "3b1f2c9e-7d4a-4e8b-9c1d-2f6a8e5b7c30",
"productId": "9e7a1c2b-4f3d-8004-8000-89bc36816ce4",
"productName": "Email Security",
"active": true
}
Which organizations can hold a product
Where a product can be provisioned depends on what kind of product it is.
- Data protection products (backup and archive) can only be provisioned for Customer organizations. A request for any other organization, such as an MSP, answers
422with the typeorg-type-not-supported. Nothing is created; send the request again for the customer organization that should hold the product. - Security products (email and web security, phishing simulation, security awareness training) must be provisioned for the MSP before they can be provisioned for its customers. A request for a customer whose MSP does not hold the product yet answers
422with the typenot-supported-for-productand the detailProduct <productId> is not available to this organization.Provision the product for the MSP first, then for the customer.
{
"type": "https://api.cybersentriq.com/problems/org-type-not-supported",
"title": "Organization type not supported",
"status": 422,
"detail": "Data protection products can only be provisioned for customer organizations."
}
When creation takes longer: the 202 flow
Some products take longer to provision than one request can wait. In that case the create answers 202.
Usually the 202 carries a Location header and the subscription in the body with "active": false. Poll the Location URL:
activebecomestruewhen provisioning completes.404means provisioning failed and the subscription was removed. You can create it again.
Sometimes the platform accepts the work before the subscription has an id. Then the 202 has no Location header and no body at all. Read the header rather than assuming it is there:
const location = res.headers.get("Location");
if (location) {
// poll it until active is true, or until it 404s
} else {
// no id yet: list the organization's subscriptions until the new one appears
}
Repeating the POST while provisioning is still running answers 409, not a second subscription.
List an organization's subscriptions
GET /subscriptions requires orgId and returns a page:
curl -sS "https://api.cybersentriq.com/subscriptions?orgId=<ORG_ID>&apiVersion=1.0" \
-H "Authorization: Bearer <ACCESS_TOKEN>"
The response is { "total", "items", "nextPageToken" }. Pass nextPageToken back as pageToken for the next page; it is always present, and null on the last page, so test its value, not whether the field is there. maxResults takes 1 to 200 and defaults to 50. Omitting orgId is a 400.
total is an upper bound, not a row count: a subscription that is still settling is counted but not listed. Page until nextPageToken is null. Do not loop until a running count reaches total: on an organization holding a settling subscription, it never will.
Read one subscription
curl -sS "https://api.cybersentriq.com/subscriptions/<SUBSCRIPTION_ID>?apiVersion=1.0" \
-H "Authorization: Bearer <ACCESS_TOKEN>"
Answers 200 with the subscription, or 404 when no subscription with that id is visible to you. A 503 means the provisioning system behind the product could not be asked right now; retry later rather than treating it as gone.
Delete a subscription
curl -sS -X DELETE "https://api.cybersentriq.com/subscriptions/<SUBSCRIPTION_ID>?apiVersion=1.0" \
-H "Authorization: Bearer <ACCESS_TOKEN>"
Deletion is asynchronous: the call answers 202, and the subscription keeps answering GET until removal completes. Poll it until it returns 404; that is the completion signal. Deletion is terminal. Subscribing the organization to the same product again creates a new subscription with a new id.
Deleting a subscription destroys data. For backup products, removal also deletes the organization's accounts for that product and everything they hold. Nothing in the request changes this, there is no confirmation step, and there is no undo. Re-subscribing gives the organization a new, empty subscription; it does not bring the accounts or their data back.
A subscription something else still depends on is refused with a 409 (subscription-in-use) and is not removed. The detail says what has to go first, most often a child organization that still holds the same product. Remove those, then remove this one.
A person deleting from the API reference is first asked to verify their identity again; see Step-up verification in the API reference. API clients are never asked.
Versioning
apiVersion is a query parameter in major.minor form. Omit it and you get the current default, 1.0. Send an unsupported version and the call answers 400 with an api-supported-versions response header listing the versions you can use. Every response carries that header, so you can always see what is available.
Pin apiVersion in production clients so a new default cannot change your integration's behavior underneath it.
When it fails
Every error is application/problem+json with a stable type URI of the form https://api.cybersentriq.com/problems/<slug>:
{
"type": "https://api.cybersentriq.com/problems/subscription-exists",
"title": "Subscription already exists",
"status": 409,
"detail": "The organization already has a provisioning or active subscription to this product."
}
Match on type or the status code, never on title or detail.
| Status | type |
Meaning |
|---|---|---|
| 400 | invalid-request, bad-request, invalid-api-version, invalid-request-body |
The request is malformed, orgId is missing from a listing, or the apiVersion value is not supported. Fix it; retrying unchanged will not help. |
| 401 | unauthorized |
The access token is missing, invalid or expired. Request a new token and retry once. |
| 401 | step-up-required |
A signed-in person must verify their identity again before this delete. API clients never receive it. |
| 403 | insufficient-scope |
The token lacks the scope the method needs. See Access scopes. |
| 403 | forbidden |
The caller is not permitted to do this. Retrying will not help. |
| 404 | org-not-found |
The orgId is unknown or outside your scope. |
| 404 | subscription-not-found |
No such subscription. After a 202, this also means provisioning failed and you may create again. |
| 405 | method-not-allowed |
The resource does not serve this method. The Allow header lists the ones it does. |
| 406, 415 | not-supported |
Send Content-Type: application/json, and accept application/json. |
| 409 | subscription-exists |
The organization already holds this product. |
| 409 | subscription-in-use |
The subscription was not removed because something still depends on it. The detail says what to remove first. |
| 413 | request-body-too-large |
The body is larger than the API accepts. |
| 422 | unknown-product, not-supported-for-product |
The request does not fit the product. For a security product, the customer's MSP may not hold it yet; see Which organizations can hold a product. |
| 422 | org-type-not-supported |
The organization cannot hold this product. Data protection products can only be provisioned for Customer organizations. |
| 429 | too-many-requests |
You have hit the rate allowance. Wait for Retry-After seconds, then retry. |
| 500 | provisioning-failed |
The platform reported a definite failure. Not safe to retry blindly: read the subscription to see where it landed. |
| 502 | upstream-error |
The service that owns subscriptions could not be reached. Nothing changed; retry after a delay. |
| 503 | engine-unavailable, upstream-unavailable |
The request could not be served right now. Nothing changed; retry after a delay. |
Every response listed above is problem+json, including the 404 on an unknown subpath under /subscriptions and the 405 on a method this API does not serve. What is not guaranteed is a response produced on the network before your request reaches the API, such as a timeout. So parse a body as a problem only after checking that the Content-Type says application/problem+json.
Next
- Find a product to subscribe to: Browsing the product catalog.
- Create the organization first: Managing organizations.
- Every response per operation: the API reference.