> ## Documentation Index
> Fetch the complete documentation index at: https://relevanceai-docs-tsp-1447.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Confluent Cloud

> Connect your Confluent Cloud Kafka clusters to Relevance AI agents to manage topics, produce records, and monitor consumer groups.

Confluent Cloud is a fully managed Apache Kafka service. The Relevance AI integration lets your agents connect to Confluent Cloud clusters to manage topics, produce records, and monitor consumer groups — enabling event-driven automation and real-time data workflows.

## Connect the integration

Connecting Confluent Cloud requires four values: an API key and secret scoped to your cluster, the cluster's REST endpoint URL, and the cluster ID.

<Warning>
  Your API key must be cluster-scoped. Organization-level or Cloud API keys target the control plane and will return 401 errors when calling the Kafka REST API. Create a cluster-scoped API key from the Confluent Cloud console under **Cluster Overview → API Keys**.
</Warning>

### API key credentials

| Field          | Description                                                       |
| -------------- | ----------------------------------------------------------------- |
| **API Key**    | The key ID from your cluster-scoped Confluent Cloud API key pair. |
| **API Secret** | The secret from the same API key pair.                            |

### Cluster details

| Field                 | Description                                                                                                                                                                                                      |
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **REST Endpoint URL** | The per-cluster REST Proxy endpoint (not the control plane URL). Find this under **Cluster Overview → Cluster Settings → Endpoints**. It follows the format `https://<cluster-id>.<region>.confluent.cloud:443`. |
| **Cluster ID**        | The unique identifier for your cluster, visible in **Cluster Overview → Cluster Settings**. It looks like `lkc-xxxxxx`.                                                                                          |

### Steps to connect

1. Go to the **Integrations & API Keys** page in the sidebar of your Relevance AI dashboard.
2. Click on **Confluent Cloud** from the available integrations.
3. Click **Add Integration**.
4. Enter your API Key and API Secret.
5. Enter your REST Endpoint URL and Cluster ID.
6. Click **Save** to complete the connection.

## Getting your credentials from Confluent Cloud

<Steps>
  <Step title="Find the REST endpoint URL">
    In the Confluent Cloud console, open your cluster and go to **Cluster Overview → Cluster Settings**. The REST endpoint is listed under **Endpoints**. Copy the full URL including the port (`:443`).
  </Step>

  <Step title="Find the cluster ID">
    On the same **Cluster Settings** page, the cluster ID is displayed at the top. It starts with `lkc-`.
  </Step>

  <Step title="Create a cluster-scoped API key">
    Go to **Cluster Overview → API Keys** and click **Create key**. Select **Granular access** and scope the key to the cluster (not to the organization or cloud). Download or copy the key and secret — the secret is only shown once.
  </Step>
</Steps>

## Available tool steps

The Confluent Cloud integration provides the following tool steps for use in your agents and tools.

<CardGroup cols={2}>
  <Card title="Generic Confluent Cloud API call" icon="bolt">
    Makes any authenticated request to the Confluent Cloud Kafka REST API. Automatically substitutes the cluster ID into path placeholders, so you can write `{cluster_id}` in the path without hardcoding the value. Use this for operations not covered by the purpose-built steps below.
  </Card>

  <Card title="List topics" icon="list">
    Retrieves all topics on the connected cluster, including their configuration and partition details.
  </Card>

  <Card title="Create topic" icon="plus">
    Creates a new topic on the cluster. You can specify the topic name, number of partitions, and replication factor.
  </Card>

  <Card title="Delete topic" icon="trash">
    Deletes a topic from the cluster by name. This action is irreversible — unconsumed records in the topic are lost.
  </Card>

  <Card title="Produce a record to a topic" icon="arrow-up-from-bracket">
    Publishes a record to a specified topic. You can set the record key, value, and optional headers.
  </Card>

  <Card title="List consumer groups" icon="users">
    Lists all consumer groups on the cluster along with their state, making it possible to monitor consumer lag and group activity.
  </Card>
</CardGroup>

## Example use cases

* Trigger agent actions in response to Kafka topic data, or produce records that drive downstream systems.
* Automate topic creation and cleanup as part of environment provisioning workflows.
* Use agents to produce enriched or transformed records to Kafka topics from external data sources.
* Regularly list consumer groups and alert when groups fall behind, enabling proactive incident response.

## Frequently asked questions (FAQs)

<AccordionGroup>
  <Accordion title="Why am I getting 401 errors?">
    The most common cause is using an organization-level or Cloud API key instead of a cluster-scoped key. Organization and Cloud API keys target the Confluent control plane, not the Kafka REST API. Create a new cluster-scoped API key from **Cluster Overview → API Keys** and update your integration credentials.
  </Accordion>

  <Accordion title="Where do I find the REST endpoint URL?">
    In the Confluent Cloud console, go to your cluster and open **Cluster Overview → Cluster Settings**. The REST endpoint is listed under **Endpoints**. It is specific to your cluster — do not use the control plane URL (`api.confluent.cloud`).
  </Accordion>

  <Accordion title="Can I use the generic API call step to access topics across multiple clusters?">
    The generic API call step is scoped to the single cluster configured in your integration credentials. To work with multiple clusters, set up a separate Confluent Cloud integration for each cluster.
  </Accordion>

  <Accordion title="Is the API secret stored securely?">
    Yes. Relevance AI encrypts all integration credentials at rest. The API secret is never returned in plaintext after the initial save.
  </Accordion>
</AccordionGroup>
