docs-mintlify/api-reference/introduction.mdx
Programmatically manage your Cube Cloud account: work with deployments and the resources scoped to them (environments, folders, reports, workbooks, notifications, workspace items, and agents), manage account-level users, groups, policies, embedding, and AI settings over a REST API, and provision users and groups from your identity provider via SCIM 2.0.
The recommended way to call the Platform API from JavaScript or TypeScript is the
official client, @cube-dev/platform-client.
It wraps the OpenAPI spec on this site with end-to-end types for every endpoint,
request, and response, plus optional React Query
bindings.
npm install @cube-dev/platform-client
yarn add @cube-dev/platform-client
pnpm add @cube-dev/platform-client
Create a client with your tenant's base URL and an auth header (see
Authentication), then call any endpoint through
the fully-typed fetchClient:
import { createCubePlatformClient } from '@cube-dev/platform-client';
const client = createCubePlatformClient({
baseUrl: 'https://<tenant>.cubecloud.dev',
// Returned on every request — provide the Platform API auth header.
getHeaders: () => ({ Authorization: `Api-Key ${process.env.CUBE_API_KEY}` }),
});
const { data, error } = await client.fetchClient.GET('/api/v1/deployments/', {
params: { query: { first: 50 } },
});
for (const deployment of data?.items ?? []) {
console.log(deployment.id, deployment.name);
}
The @cube-dev/platform-client/react-query entry point adds a provider and typed
hooks built on @tanstack/react-query (a peer dependency alongside react):
import { createCubePlatformClient } from '@cube-dev/platform-client';
import {
CubePlatformApiProvider,
useCubePlatformApiQuery,
} from '@cube-dev/platform-client/react-query';
const client = createCubePlatformClient({ baseUrl, getHeaders });
function App() {
return (
<CubePlatformApiProvider client={client}>
<Deployments />
</CubePlatformApiProvider>
);
}
function Deployments() {
const { data } = useCubePlatformApiQuery('get', '/api/v1/deployments/');
return <ul>{data?.items.map((d) => <li key={d.id}>{d.name}</li>)}</ul>;
}
Both APIs are served from your Cube Cloud tenant host under /api:
https://<tenant>.cubecloud.dev/api
Endpoints live under two namespaces:
/api/v1/… — the REST management API (deployments and nested resources)/api/scim/v2/… — the SCIM 2.0 user and group provisioning APIOnly HTTPS calls are accepted. Authenticate every request — see Authentication.
| Entity | Resource | Version |
|---|---|---|
| Deployments | /v1/deployments | v1 |
| Environments | /v1/deployments/{deploymentId}/environments | v1 |
| Folders | /v1/deployments/{deploymentId}/folders | v1 |
| Reports | /v1/deployments/{deploymentId}/reports | v1 |
| Workbooks | /v1/deployments/{deploymentId}/workbooks | v1 |
| Notifications | /v1/deployments/{deploymentId}/notifications | v1 |
| Workspace | /v1/deployments/{deploymentId}/workspace | v1 |
| Agents | /v1/deployments/{deploymentId}/agents | v1 |
| Metadata | /v1/meta | v1 |
| Users | /v1/users | v1 |
| Groups | /v1/groups | v1 |
| User Groups | /v1/user-groups | v1 |
| User Attributes | /v1/user-attributes | v1 |
| Resource Policies | /v1/resource-policies | v1 |
| App Theme | /v1/app-theme | v1 |
| AI Engineer | /v1/ai-engineer | v1 |
| Embed | /v1/embed | v1 |
| Embed Tenants | /v1/embed-tenants | v1 |
| SCIM Users | /scim/v2/Users | SCIM 2.0 |
| SCIM Groups | /scim/v2/Groups | SCIM 2.0 |