# Use the Control Plane API with Serverless

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [cloud-data-platform-full.txt](https://docs.redpanda.com/cloud-data-platform-full.txt)

---
title: Use the Control Plane API with Serverless
latest-operator-version: v26.1.4
latest-console-tag: v3.7.3
latest-connect-version: 4.93.0
latest-redpanda-tag: v26.1.9
docname: api/cloud-serverless-controlplane-api
page-component-name: cloud-data-platform
page-version: master
page-component-version: master
page-component-title: Cloud
page-relative-src-path: api/cloud-serverless-controlplane-api.adoc
page-edit-url: https://github.com/redpanda-data/cloud-docs/edit/main/modules/manage/pages/api/cloud-serverless-controlplane-api.adoc
description: Use the Control Plane API to manage resources in your Redpanda Serverless environment.
page-git-created-date: "2024-08-01"
page-git-modified-date: "2025-03-20"
---

<!-- Source: https://docs.redpanda.com/cloud-data-platform/manage/api/cloud-serverless-controlplane-api.md -->

The Redpanda Cloud API is a collection of REST APIs that allow you to interact with different parts of Redpanda Cloud. The Control Plane API enables you to programmatically manage your organization’s Redpanda infrastructure outside of the Cloud UI. You can call the API endpoints directly, or use tools like Terraform or Python scripts to automate cluster management.

See [Control Plane API](https://docs.redpanda.com/api/doc/cloud-controlplane/) for the full API reference documentation.

## [](#control-plane-api)Control Plane API

The Control Plane API is one central API that allows you to provision clusters, networks, and resource groups.

The Control Plane API consists of the following endpoint groups:

-   [Operations](https://docs.redpanda.com/api/doc/cloud-controlplane/group/endpoint-operations)

-   [Resource Groups](https://docs.redpanda.com/api/doc/cloud-controlplane/group/endpoint-resource-groups)

-   [Serverless Clusters](https://docs.redpanda.com/api/doc/cloud-controlplane/group/endpoint-serverless-clusters)

-   [Serverless Regions](https://docs.redpanda.com/api/doc/cloud-controlplane/group/endpoint-serverless-regions)

-   [Control Plane Role Bindings](https://docs.redpanda.com/api/doc/cloud-controlplane/group/endpoint-control-plane-role-bindings)

-   [Control Plane Users](https://docs.redpanda.com/api/doc/cloud-controlplane/group/endpoint-control-plane-users)

-   [Control Plane Service Accounts](https://docs.redpanda.com/api/doc/cloud-controlplane/group/endpoint-control-plane-service-accounts)


## [](#create-a-cluster)Create a cluster

To create a new serverless cluster, you can use the default resource group, or create a new resource group if you like. You need to choose a region where your cluster is hosted.

### [](#create-a-resource-group)Create a resource group

> 📝 **NOTE**
>
> This step is optional. Serverless includes a default resource group. To retrieve the default resource group ID, make a GET request to the [`/v1/resource-groups`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-resourcegroupservice_listresourcegroups) endpoint:
>
> ```bash
> curl -H "Authorization: Bearer <token>" https://api.redpanda.com/v1/resource-groups
> ```

Create a resource group by making a POST request to the [`/v1/resource-groups`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-resourcegroupservice_createresourcegroup) endpoint. Pass a name for your resource group in the request body.

```bash
curl -H 'Content-Type: application/json' \
-H "Authorization: Bearer <token>" \
-d '{
  "name": "<serverless-resource-group-name>"
}' -X POST https://api.redpanda.com/v1/resource-groups
```

A resource group ID is returned. Pass this ID later when you call the Create Serverless Cluster endpoint.

### [](#choose-a-region)Choose a region

To see the available regions for Redpanda Serverless, make a GET request to the [`/v1/serverless/regions`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-serverlessregionservice_listserverlessregions) endpoint. You can specify a cloud provider in your request. Serverless currently only supports AWS.

```bash
curl -H "Authorization: Bearer <token>" 'https://api.redpanda.com/v1/serverless/regions?cloud_provider=CLOUD_PROVIDER_AWS'
```

> 💡 **TIP**
>
> When using a shell substitution variable for the token, use double quotes to wrap the header value.

```json
{
    "serverless_regions": [
        {
            "name": "eu-central-1",
            "display_name": "eu-central-1",
            "default_timezone": {
                "id": "Europe/Berlin",
                "version": ""
            },
            "cloud_provider": "CLOUD_PROVIDER_AWS",
            "available": true
        },
        ...
    ],
    "next_page_token": ""
}
```

You can also see a list of supported regions in [Serverless regions](https://docs.redpanda.com/cloud-data-platform/reference/tiers/serverless-regions/).

### [](#create-a-new-serverless-cluster)Create a new serverless cluster

Create a Serverless cluster by making a request to [`POST /v1/serverless/clusters`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-serverlessclusterservice_createserverlesscluster) with the resource group ID and serverless region name in the request body.

```bash
curl -H 'Content-Type: application/json' \
-H "Authorization: Bearer <token>" \
-d '{
  "serverless_cluster": {
    "name": "<serverless-cluster-name>",
    "resource_group_id": "<resource-group-id>",
    "serverless_region": "us-east-1"
  }
}' -X POST https://api.redpanda.com/v1/serverless/clusters
```

The Create Serverless Cluster endpoint returns a [long-running operation](#lro-serverless). When the operation completes, you can retrieve cluster details by calling [`GET /v1/serverless/clusters/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-serverlessclusterservice_getserverlesscluster), and passing the cluster ID as a parameter.

## [](#update-cluster-configuration)Update cluster configuration

To update your cluster configuration properties, make a request to the [`PATCH /v1/clusters/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-clusterservice_updatecluster) endpoint, passing the cluster ID as a parameter. Include the properties to update in the request body.

```bash
curl -H "Authorization: Bearer <token>"  \
 -H 'accept: application/json'\
 -H 'content-type: application/json' \
 -d '{
      "cluster_configuration": {
        "custom_properties": {
          "audit_enabled":true
        }
      }
    }' -X PATCH "https://api.cloud.redpanda.com/v1/clusters/<cluster-id>"
```

The Update Cluster endpoint returns a [long-running operation](#lro). [Check the operation state](#check-operation-state) to verify that the update is complete.

## [](#delete-a-cluster)Delete a cluster

To delete a cluster, make a request to the [`DELETE /v1/serverless/clusters/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-serverlessclusterservice_getserverlesscluster) endpoint, passing the cluster ID as a parameter. This is a [long-running operation](#lro-serverless).

```bash
curl -H "Authorization: Bearer <token>" -X DELETE https://api.redpanda.com/v1/serverless/clusters/<cluster-id>
```

Optional: When the cluster is deleted, the delete operation’s state changes to `STATE_COMPLETED`. At this point, you may make a DELETE request to the [`/v1/resource-groups/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-resourcegroupservice_deleteresourcegroup) endpoint to delete the resource group.

## [](#lro-serverless)Long-running operations

Some endpoints do not directly return the resource itself, but instead return an operation. The following is an example response of [`POST /serverless/clusters`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-serverlessclusterservice_createserverlesscluster):

```bash
{
    "operation": {
        "id": "cqaramrndjr40k3qei50",
        "metadata": null,
        "state": "STATE_IN_PROGRESS",
        "started_at": {
            "seconds": "1721087323",
            "nanos": 888601218
        },
        "finished_at": null,
        "type": "TYPE_CREATE_SERVERLESS_CLUSTER"
    }
}
```

The response object represents the long-running operation of creating a cluster. Cluster creation is an example of an operation that can take a longer period of time to complete.

### [](#check-operation-state)Check operation state

To check the progress of an operation, make a request to the [`GET /operations/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-operationservice_getoperation) endpoint using the operation ID as a parameter:

```bash
curl -H "Authorization: Bearer <token>" https://api.redpanda.com/v1/operations/<operation-id>
```

The response contains the current state of the operation: `IN_PROGRESS`, `COMPLETED`, or `FAILED`.

## [](#manage-rbac)Manage RBAC

You can also use the Control Plane API to manage [RBAC configurations](https://docs.redpanda.com/cloud-data-platform/security/authorization/rbac/rbac/).

### [](#list-role-bindings)List role bindings

To see role assignments for IAM user and service accounts, make a GET request to the [`/v1/role-bindings`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-rolebindingservice_listrolebindings) endpoint.

```bash
curl https://api.redpanda.com/v1/role-bindings?filter.role_name=<role-name>&filter.scope.resource_type=SCOPE_RESOURCE_TYPE_CLUSTER \
     -H "Authorization: Bearer <token>" \
     -H "Content-Type: application/json"
```

### [](#get-role-binding)Get role binding

To see roles assignments for a specific IAM account, make a GET request to the [`/v1/role-bindings/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-rolebindingservice_getrolebinding) endpoint, passing the role binding ID as a parameter.

```bash
curl "https://api.redpanda.com/v1/role-bindings/<role-binding-id> \
     -H "Authorization: Bearer <token>" \
     -H "Content-Type: application/json"
```

### [](#get-user)Get user

To see details of an IAM user account, make a GET request to the [`/v1/users/{id}`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-userservice_getuser) endpoint, passing the user account ID as a parameter.

```bash
curl "https://api.redpanda.com/v1/users/<user-account-id> \
     -H "Authorization: Bearer <token>" \
     -H "Content-Type: application/json"
```

### [](#create-role-binding)Create role binding

To assign a role to an IAM user or service account, make a POST request to the [`/v1/role-bindings`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-rolebindingservice_createrolebinding) endpoint. Specify the role and scope, which includes the specific resource ID and an optional resource type, in the request body.

```bash
curl -X POST "https://api.redpanda.com/v1/role-bindings" \
     -H "Authorization: Bearer <token>" \
     -H "Content-Type: application/json" \
     -d '{
           "role_name": "<role-name>",
           "account_id": "<user-or-service-account-id>",
           "scope": {
             "resource_type": "SCOPE_RESOURCE_TYPE_CLUSTER",
             "resource_id": "<resource-id>"
           }
         }'
```

For `<role-name>`, use one of roles listed in [Predefined roles](https://docs.redpanda.com/cloud-data-platform/security/authorization/rbac/rbac/#predefined-roles) (`Reader`, `Writer`, `Admin`).

### [](#create-service-account)Create service account

> 📝 **NOTE**
>
> Service accounts are assigned the Admin role for all resources in the organization.

To create a new service account, make a POST request to the [`/v1/service-accounts`](https://docs.redpanda.com/api/doc/cloud-controlplane/operation/operation-serviceaccountservice_createserviceaccount) endpoint, with a service account name and optional description in the request body.

```bash
curl -X POST "https://api.redpanda.com/v1/service-accounts" \
     -H "Authorization: Bearer <token>" \
     -H "Content-Type: application/json" \
     -d '{
           "service_account": {
              "name": "<service-account-name>",
              "description": "<service-account-description>"
           }
         }'
```

## [](#next-steps)Next steps

-   [Use the Data Plane APIs](https://docs.redpanda.com/cloud-data-platform/manage/api/cloud-dataplane-api/)