> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloud.cdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Management API

> The Connect AI Management API provides programmatic control over enterprise platform administration. Use it to manage users, service accounts, roles, groups, workspaces, and virtual keys without manual UI operations.

The Management API base URL is `https://cloud.cdata.com/api/v1/admin`.

## Authentication

Management API requests can authenticate with either of the following methods:

* OAuth 2.0 client credentials of Client Id and Client Secret. OAuth 2.0 client credentials come from a service account, rather than a human user.
* Basic authentication with your email address and a personal access token (PAT).

### OAuth 2.0 Client Credentials

**Step 1: Request a bearer token**

```bash theme={null}
curl -X POST https://cloud-login.cdata.com/oauth/token \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=client_credentials&client_id=<ClientId>&client_secret=<ClientSecret>"
```

**Step 2: Call the Management API**

```bash theme={null}
curl https://cloud.cdata.com/api/v1/admin/users \
  -H "Authorization: Bearer <access_token>"
```

### Basic Authentication with a PAT

To authenticate with Basic authentication, pass the Base64-encoded login credentials of a registered user in the `Authorization` header of the request. Follow this guidance when passing the credentials:

* The username is the email address of the user, for example, `user@cdata.com`.
* The password is a Personal Access Token (PAT) that you generate from the [Personal Access Tokens](https://docs.cloud.cdata.com/en/Settings/Personal-Access-Tokens.md) tab of **Settings**.

The following is an example of a curl command that calls the Management API to list users:

```bash wrap theme={null}
curl https://cloud.cdata.com/api/v1/admin/users \
   --user "user@cdata.com:123456789abcdefghijklmnopqrstuvwxyz"
```

Since curl automatically Base64-encodes Basic authentication credentials, it is not necessary to manually perform this encoding before sending the request.

### Scopes

Each endpoint requires a specific scope when you authenticate with OAuth 2.0 client credentials. Request only the scopes your integration needs.

| Scope | Access |
| :- | :- |
| `management:users:read` | Read access to user resources. |
| `management:users:write` | Write access to user resources. |
| `management:service-accounts:read` | Read access to service account resources. |
| `management:service-accounts:write` | Write access to service account resources. |
| `management:roles:read` | Read access to role resources. |
| `management:roles:write` | Write access to role resources. |
| `management:groups:read` | Read access to group resources. |
| `management:groups:write` | Write access to group resources. |
| `management:workspaces:read` | Read access to workspace resources. |
| `management:workspaces:write` | Write access to workspace resources. |

## Pagination

Collection responses use cursor-based pagination. All collection responses share the same envelope:

```json theme={null}
{
  "items": [ ... ],
  "limit": 20,
  "next_cursor": "eyJpZCI6IjEyMyJ9"
}
```

| Field | Description |
| :- | :- |
| *items* | Array of result objects. |
| *limit* | The maximum number of items per page as requested. |
| *next\_cursor* | Pass this value as the `cursor` query parameter to retrieve the next page. `null` when no further pages exist. |

Total counts are not returned. Iterate using `next_cursor` until it is `null`.

## Errors

Error responses use a consistent structure:

```json theme={null}
{
  "error": {
    "code": "USER_NOT_FOUND",
    "message": "The specified user does not exist."
  }
}
```

The `code` field is a `SCREAMING_SNAKE_CASE` string suitable for programmatic handling. The `message` field is a human-readable description.

## Identities

The Management API manages two types of identities.

### Users

Human users are provisioned and lifecycle-managed by SCIM when your organization has SCIM configured. The Management API handles direct overrides (for example, contractors or break-glass accounts) and atomic deprovisioning. Users created directly via the API carry `scim_managed: false`.

### Service Accounts

Service accounts are machine identities for CI/CD pipelines, IaC tooling, and Terraform automation. Service accounts are not SCIM-owned and authenticate via OAuth 2.0 client credentials using the `client_id` returned on creation.

## Access Model

A *principal* is a user, a service account, or a group. Access is granted to principals.

A principal's effective access is the union of the following independent sources:

* **Direct role assignments**–assigned individually to a user or service account (via [Assign User Role](https://docs.cloud.cdata.com/en/API/Assign-User-Role.md) or the equivalent service account endpoint).
* **Workspace-scoped role assignments**–a system or custom access role assigned to a user, service account, or group within a specific workspace (via [Assign User Workspace Role](https://docs.cloud.cdata.com/en/API/Assign-User-Workspace-Role.md) or the equivalent service account or group endpoint).
* **Group-derived role assignments**–inherited through membership in a group that holds a workspace-scoped role (users only).
* **Direct permissions**–resource-level grants assigned individually (via [Assign User Permission](https://docs.cloud.cdata.com/en/API/Assign-User-Permission.md) or the equivalent service account endpoint).

### Roles

Two role types exist in Connect AI:

| Type | Description |
| :- | :- |
| `system_role` | Built-in, non-modifiable. Defines a fixed set of capabilities. |
| `access_role` | Custom role with explicit resource-level permissions. |

The account-wide `admin` system role is assigned via `POST /users/{id}/roles` or `POST /service-accounts/{id}/roles`.

Access roles are defined once for the account and assigned per workspace. Use the Roles endpoints to [create](https://docs.cloud.cdata.com/en/API/Create-Role.md), [update](https://docs.cloud.cdata.com/en/API/Update-Role.md), and [delete](https://docs.cloud.cdata.com/en/API/Delete-Role.md) access roles, and to [list the groups](https://docs.cloud.cdata.com/en/API/List-Role-Groups.md) that hold a role. System roles cannot be modified or deleted.

### Built-In System Roles

| Role | Scope | Description |
| :- | :- | :- |
| `admin` | Account-wide | Super user. Full access, including adding new users. |
| `workspace_admin` | Workspace | Full control over the connections and virtual schemas of a workspace. Can add existing users to the workspace and remove them. Cannot create or invite users. |
| `connection_admin` | Workspace | Manage connections within a workspace. |
| `user_admin` | Workspace | Create, invite, edit, and disable users. Cannot manage connections. |
| `query` | Workspace | Execute queries against connections in a workspace. This is the default role. It is scoped to the default workspace and assigned automatically to users created with [Create User](https://docs.cloud.cdata.com/en/API/Create-User.md). |
| `oem_admin` | Workspace | OEM administration within a workspace. |
| `oem_viewer` | Workspace | OEM read access within a workspace. |
| `service_user` | Workspace | Service-level access within a workspace. |

Assign the account-wide `admin` role with [Assign User Role](https://docs.cloud.cdata.com/en/API/Assign-User-Role.md) or [Assign Service Account Role](https://docs.cloud.cdata.com/en/API/Assign-Service-Account-Role.md). Assign the workspace-scoped system roles, and every custom access role, within a workspace with the workspace role endpoints for [users](https://docs.cloud.cdata.com/en/API/Assign-User-Workspace-Role.md), [service accounts](https://docs.cloud.cdata.com/en/API/Assign-Service-Account-Workspace-Role.md), and [groups](https://docs.cloud.cdata.com/en/API/Assign-Group-Workspace-Role.md). The `admin` role cannot be assigned to a group.

A principal can hold one workspace-scoped system role per workspace. The principal must be a member of the workspace before you assign a role in it.

## Groups

Groups confer roles to many members at once. The Management API exposes two kinds of groups, identified by the `source` field.

| Source | Description |
| :- | :- |
| `scim` | Synced from your identity provider (IdP). The IdP owns the name and membership. A SCIM group has `enabled` set to `false` until you enable it in the Connect AI UI. |
| `custom` | Managed through the Management API. |

Use [List Groups](https://docs.cloud.cdata.com/en/API/List-Groups.md) and [Get Group](https://docs.cloud.cdata.com/en/API/Get-Group.md) to read groups of either source, and use the group workspace role endpoints to [assign](https://docs.cloud.cdata.com/en/API/Assign-Group-Workspace-Role.md), [list](https://docs.cloud.cdata.com/en/API/List-Group-Workspace-Roles.md), and [remove](https://docs.cloud.cdata.com/en/API/Remove-Group-Workspace-Role.md) roles. Role assignment works the same way for both sources. To find which groups hold a role, use [List Role Groups](https://docs.cloud.cdata.com/en/API/List-Role-Groups.md).

> [!NOTE]
>
> Creating and managing custom groups and their members is not yet available in the Management API.

## Workspaces

Workspaces are isolation boundaries at the account level. Every account has one default workspace, which cannot be deleted. Use the Workspaces endpoints to create and manage workspaces and their membership.

* [Create Workspace](https://docs.cloud.cdata.com/en/API/Create-Workspace.md) accepts an optional `external_id`. A repeated request with the same `external_id` returns the existing workspace, so repeated applies from infrastructure-as-code tools are safe.
* [Add Workspace Member](https://docs.cloud.cdata.com/en/API/Add-Workspace-Member.md) adds a user, service account, or group. Adding a member does not grant a role.
* When you add a group, its members gain effective access to the workspace. [List Workspace Members](https://docs.cloud.cdata.com/en/API/List-Workspace-Members.md) returns these members with `grant_type` set to `group_derived`. Filter with `grant_type=direct` to see only direct members.
* [Remove Workspace Member](https://docs.cloud.cdata.com/en/API/Remove-Workspace-Member.md) removes a direct member and revokes the workspace-scoped roles that the member held in that workspace. Account-wide roles and roles in other workspaces are unaffected. When you remove a service account, its PATs scoped to the workspace are revoked. You cannot remove group-derived members with this endpoint.
* [List Workspace Connections](https://docs.cloud.cdata.com/en/API/List-Workspace-Connections.md), [Test Workspace Connection](https://docs.cloud.cdata.com/en/API/Test-Workspace-Connection.md), and [Delete Workspace Connection](https://docs.cloud.cdata.com/en/API/Delete-Workspace-Connection.md) manage the connections in a workspace. You create connections in the Connect AI UI. Deleting a connection permanently removes its stored credentials.
* [Delete Workspace](https://docs.cloud.cdata.com/en/API/Delete-Workspace.md) requires you to remove all members first. Deleting a workspace permanently deletes its connections and their stored credentials, and revokes all PATs scoped to the workspace.

## Projects

Projects belong to a workspace. Each virtual key is issued for one project.

* [List Projects](https://docs.cloud.cdata.com/en/API/List-Projects.md) returns the projects in a workspace. Use the `project_id` of a project when you create or list virtual keys for it.
* [List Project Virtual Keys](https://docs.cloud.cdata.com/en/API/List-Project-Virtual-Keys.md) returns the virtual keys issued for a project.
* You must be an Admin, or a Workspace Admin of the workspace, to call these endpoints.

## Virtual Keys

Virtual keys are the credentials a client sends to the LLM Gateway to authenticate. The Management API creates, lists, disables, re-enables, and revokes virtual keys for users and service accounts in a workspace, so you can script a large rollout.

* A virtual key is issued to one user or service account for one project. Each user or service account can hold one virtual key per project.
* The full virtual key is returned only in the response to [Create Virtual Key](https://docs.cloud.cdata.com/en/API/Create-Virtual-Key.md). It cannot be retrieved again, so store it securely.
* Use [Update Virtual Key](https://docs.cloud.cdata.com/en/API/Update-Virtual-Key.md) to rename, disable, or re-enable a key. Use [Revoke Virtual Key](https://docs.cloud.cdata.com/en/API/Revoke-Virtual-Key.md) to revoke it permanently. The record is kept for auditing.
* You must be an Admin, or a Workspace Admin of the workspace, to call these endpoints.
* Each account is limited to 600 Management API calls per minute. Revoking or disabling a key does not count against the limit.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.