Managing organizations
/organizations is where you create, list, read and delete the organizations under your own. Every account and subscription on the platform hangs off an organization, so this is usually the first resource a partner integration touches: create a customer organization, then subscribe it to products.
Organizations form a tree. Yours sits somewhere in it, and the API shows you your own organization and everything below it: nothing above, nothing beside. An organization outside that scope answers 404; the API does not distinguish "does not exist" from "not yours".
There are two organization types. An MSP can hold child organizations; a Customer cannot. New organizations are always created under an MSP.
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.
Pin apiVersion on every call to protect your integration from future changes. Omitting it selects the current default, 1.0.
List organizations
GET /organizations lists your own organization's children:
curl -sS "https://api.cybersentriq.com/organizations?apiVersion=1.0" \
-H "Authorization: Bearer <ACCESS_TOKEN>"
{
"total": 2,
"items": [
{
"id": "3b1f2c9e-7d4a-4e8b-9c1d-2f6a8e5b7c30",
"name": "Contoso Managed Services",
"orgType": "MSP",
"enabled": true,
"parentOrgId": "6d2a4f1e-0b3c-4d5e-8f7a-9b1c2d3e4f50"
}
],
"nextPageToken": null
}
Shape the listing with query parameters:
parentOrgId=<uuid>: list another organization's children instead of your own's.includeDescendants=true: the whole subtree rather than direct children.root=true: start from your own organization itself instead of its children.orgName=<text>: filter by name (contains, case-insensitive).orgType=MSP: filter by type; repeat the key to pass several.maxResultsandpageToken: paging. FollownextPageTokenuntil it isnull; it is always present, so test its value, never whether the property is there.
Read one organization
curl -sS "https://api.cybersentriq.com/organizations/<ORG_ID>?apiVersion=1.0" \
-H "Authorization: Bearer <ACCESS_TOKEN>"
Returns the same shape as one list item. 404 means unknown, deleted, or not yours.
Create an organization
POST to /organizations with a name, a type and the MSP to create it under:
curl -sS -X POST "https://api.cybersentriq.com/organizations?apiVersion=1.0" \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"name":"Fabrikam Ltd","orgType":"Customer","parentOrgId":"<MSP_ORG_ID>"}'
The create takes nothing but these three fields. There is no admin contact and no invitation: once the organization exists, invite its users from the CyberSentriq app. Everything else about the new organization is inherited from its parent — there is no field for platform placement or configuration.
A 201 returns the new organization, with a Location header naming its URL. A 409 means a sibling organization already has this name; a 422 means the parent cannot hold this organization (parentOrgId is not an MSP), the parent has not been migrated (organizations are only created under migrated parents), the organization would be a direct partner (which the API does not create), the platform could not place it under this parent, or the platform refused the name. The problem type tells the five apart.
Delete an organization
Deletion is guarded and asynchronous.
curl -sS -X DELETE "https://api.cybersentriq.com/organizations/<ORG_ID>?apiVersion=1.0" \
-H "Authorization: Bearer <ACCESS_TOKEN>" -i
A 202 means removal is under way, with a Location header naming the organization to poll. Poll it until it answers 404; only the 404 confirms the organization is gone:
curl -sS -o /dev/null -w "%{http_code}\n" "https://api.cybersentriq.com/organizations/<ORG_ID>?apiVersion=1.0" \
-H "Authorization: Bearer <ACCESS_TOKEN>"
The guards, in the order you will meet them:
403: the organization is your own, or it has no parent you can see (the top of your granted tree). Neither can be deleted through the API.409: the organization still has child organizations. Delete the children first, then retry.404: unknown, already deleted, or not yours.
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/org-has-children",
"title": "Organization has children",
"status": 409,
"detail": "The organization still has child organizations. Delete the children first, then retry."
}
Match on type or the status code, never on title or detail.
| Status | type |
Meaning |
|---|---|---|
| 400 | bad-request, invalid-api-version |
The request is malformed, a query parameter is invalid, 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, or the organization cannot be deleted through the API. Retrying will not help. |
| 404 | org-not-found |
The organization is unknown, deleted, or outside your scope. |
| 405 | method-not-allowed |
The resource does not serve this method. The Allow header lists the ones it does. |
| 406 | not-supported |
Accept application/json. |
| 409 | duplicate-org-name |
A sibling organization already has this name. |
| 409 | org-has-children |
The organization still has child organizations. Delete them first. |
| 413 | request-body-too-large |
The body is larger than the API accepts. |
| 422 | type-not-allowed-under-parent, parent-not-migrated, direct-partner-not-allowed, org-placement-refused, refused-by-platform |
The parent cannot hold this organization type, the parent has not been migrated (pick a migrated parent), the organization would be a direct partner (which the API does not create), the platform could not place it under this parent (retry later or contact support), or the platform refused the name. |
| 429 | too-many-requests |
You have hit the rate allowance. Wait for Retry-After seconds, then retry. |
| 500, 502, 503 | internal-error, upstream-error, upstream-unavailable |
The call could not be served. Nothing changed on a 502 or 503; retry after a delay. |
Next
- Subscribe the organization to a product: Managing subscriptions.
- Give it an API client of its own: Managing API clients.