# Confluent Cloud Custom SMT APIs for Managed Connectors

The Custom SMT API is a part of the Confluent Cloud APIs and focuses on managing the Custom SMT configurations.

<a id="ccloud-custom-smt-prerequisites"></a>

## Prerequisites

- Authorized access to a [Confluent Cloud](https://www.confluent.io/confluent-cloud/)
  cluster on Amazon Web Services (AWS), Microsoft Azure (Azure), or Google Cloud (GCP).
- The Confluent CLI installed and configured for the cluster.
  For information on how to install the CLI, see the [CLI documentation](https://docs.confluent.io/confluent-cli/current/install.html).
- cURL and jq installed to use the API request examples in this document.
- A Confluent Cloud API key to authenticate with the Confluent Cloud API. Every API request must include the resource key and secret encoded as Base64. For information about how to create a Confluent Cloud API key, see
  [Manage API Keys](../../security/authenticate/workload-identities/service-accounts/api-keys/manage-api-keys.md#cloud-cloud-api-keys).
- The EnvironmentAdmin role to upload custom artifact file. If you do not have the appropriate role, reach out to your EnvironmentAdmin.

## Manage Custom SMTs

Using requests to the Custom SMT API, you can perform the following actions:

- [List Custom SMTs](#cc-custom-smt-list)
- [Create a Custom SMT](#cc-create-custom-smt)
- [Describe a Custom SMT](#cc-custom-smt-describe)
- [Delete a Custom SMT artifact file](#cc-custom-smt-delete)

Before you run any cURL requests, be sure to complete the [prerequisites](#ccloud-custom-smt-prerequisites).

<a id="cc-custom-smt-list"></a>

### List Custom SMTs

Use the following API request to list Custom SMT artifacts. Valid values for `spec.cloud` are `AWS`, `AZURE`, or `GCP`.

```none
curl --request GET \
  --url 'https://api.confluent.cloud/cam/v1/connect-artifacts?environment=<Env_ID>&spec.cloud=<Cloud_Provider>' \
  --header 'accept: application/json' \
  --header 'authorization: Basic <Replace_Basic_Auth>' \
  --header 'content-type: application/json' | jq
```

Example request:

```none
curl --request GET \
  --url 'https://api.confluent.cloud/cam/v1/connect-artifacts?environment=env-stgcznox3d&spec.cloud=AWS' \
  --header 'accept: application/json' \
  --header 'authorization: Basic <base64-encoded-key-and-secret>' \
  --header 'content-type: application/json' | jq
```

Example response:

```none
{
  "api_version": "cam/v1",
  "data": [
    {
      "api_version": "cam/v1",
      "id": "cca-stgcyoj9dj",
      "kind": "ConnectArtifact",
      "metadata": {
          "created_at": "2025-04-14T05:35:19.544012Z",
          "resource_name": "crn://confluent.cloud/organization=31d218ba-d8e8-49a5-9ad1-f93327d3b4b7/environment=env-stgcznox3d/connect-artifact=cca-stgcyoj9dj",
          "self": "https://confluent.cloud/cam/v1/connect-artifacts/cca-stgcyoj9dj",
          "updated_at": "2025-04-14T05:35:20.002593Z"
        },
      "spec": {
          "cloud": "aws",
          "content_format": "ZIP",
          "description": "Confluent Custom SMT Example",
          "display_name": "Confluent_Custom_SMT",
          "environment": "env-stgcznox3d",
          "usages": []
        },
      "status": {
          "phase": "READY"
        }
    }
    ],
      "kind": "ConnectArtifactList",
      "metadata": {
          "first": "https://confluent.cloud/cam/v1/connect-artifacts",
          "next": "",
          "total_size": 1
        }
}
```

<a id="cc-create-custom-smt"></a>

### Create a Custom SMT

Use the following API request to create a custom connector SMT. The following are required configuration properties:

- `display_name`: A meaningful Custom SMT name to be displayed in the UI and CLI.
- `upload_source`: For this property, you use the values `PRESIGNED_URL_LOCATION` and the upload ID.
- `description` (Optional): A meaningful description for the plugin.

```none
curl --request POST \
    --url 'https://api.confluent.cloud/cam/v1/connect-artifacts?environment=<Env_ID>&spec.cloud=<Cloud_Provider>' \
    --header 'accept: application/json' \
    --header 'authorization: Basic <Replace_Basic_Auth>' \
    --header 'content-type: application/json' \
    --data '{
    "spec": {
      "display_name": "<Custom_SMT_Name>",
      "description": "<Description>",
      "upload_source": {
          "location": "<Presigned_URL_Location>",
          "upload_id": "<Upload_ID>"
        }
    }
}'
```

Example Request:

```none
curl --request POST \
    --url 'https://api.confluent.cloud/cam/v1/connect-artifacts?environment=<Env_ID>&spec.cloud=<Cloud_Provider>' \
    --header 'accept: application/json' \
    --header 'authorization: Basic <base64-encoded-key-and-secret>' \
    --header 'content-type: application/json' \
    --data '{
    "spec": {
      "display_name": "Confluent_Custom_SMT",
      "description": "Confluent Custom SMT Example",
      "upload_source": {
          "location": "PRESIGNED_URL_LOCATION",
          "upload_id": "748d7b70-a885-46ed-a02e-4d32836957ca"
        }
    }
}'
```

Example Response:

```none
{
  "api_version": "cam/v1",
  "id": "cca-stgcyoj9dj",
  "kind": "ConnectArtifact",
  "metadata": {
     "created_at": "2025-04-14T05:35:19.544012Z",
     "resource_name": "crn://confluent.cloud/organization=31d218ba-d8e8-49a5-9ad1-f93327d3b4b7/environment=env-stgcznox3d/connect-artifact=cca-stgcyoj9dj",
     "self": "https://confluent.cloud/cam/v1/connect-artifacts/cca-stgcyoj9dj",
     "updated_at": "2025-04-14T05:35:19.544012Z"
    },
  "spec": {
     "cloud": "aws",
     "content_format": "ZIP",
     "description": "Confluent Custom SMT Example",
     "display_name": "Confluent_Custom_SMT",
     "environment": "env-stgcznox3d",
     "usages": []
    },
  "status": {
     "phase": "READY"
    }
}
```

<a id="cc-custom-smt-describe"></a>

### Describe a Custom SMT

Get the details about an artifact in your environment by sending a `GET` request to the read artifact endpoint.

```none
curl --request GET \
  --url 'https://api.confluent.cloud/cam/v1/connect-artifacts/<Custom_SMT_Artifact_ID>?environment=<Env_ID>&spec.cloud=<Cloud_Provider>' \
  --header 'accept: application/json' \
  --header 'authorization: <Replace_Basic_Auth>' \
  --header 'content-type: application/json' | jq
```

Example request:

```none
curl --request GET \
  --url 'https://api.confluent.cloud/cam/v1/connect-artifacts/cca-stgcyoj9dj?environment=env-stgcznox3d&spec.cloud=AWS' \
  --header 'accept: application/json' \
  --header 'authorization: Basic <base64-encoded-key-and-secret>' \
  --header 'content-type: application/json' | jq
```

Example response:

```none
{
  "api_version": "cam/v1",
  "id": "cca-stgcyoj9dj",
  "kind": "ConnectArtifact",
  "metadata": {
      "created_at": "2025-04-14T05:35:19.544012Z",
      "resource_name": "crn://confluent.cloud/organization=31d218ba-d8e8-49a5-9ad1-f93327d3b4b7/environment=env-stgcznox3d/connect-artifact=cca-stgcyoj9dj",
      "self": "https://confluent.cloud/cam/v1/connect-artifacts/cca-stgcyoj9dj",
      "updated_at": "2025-04-14T05:35:20.002593Z"
    },
  "spec": {
      "cloud": "aws",
      "content_format": "ZIP",
      "description": "Confluent Custom SMT Example",
      "display_name": "Confluent_Custom_SMT",
      "environment": "env-stgcznox3d",
      "usages": []
    },
  "status": {
      "phase": "READY"
    }
}
```

<a id="cc-custom-smt-delete"></a>

### Delete a Custom SMT artifact file

Delete a Custom SMT artifact in your environment by sending a DELETE request to the Delete artifact endpoint:

```none
curl --request DELETE \
  --url 'https://api.confluent.cloud/cam/v1/connect-artifacts/<Custom_SMT_artifact_ID>?spec.cloud=<Cloud_Provider>&environment=<Env_ID>' \
  --header 'accept: application/json' \
  --header 'authorization: Basic <Replace_Basic_Auth>' \
  --header 'content-type: application/json' | jq
```

Example request:

```none
curl --request DELETE \
  --url 'https://api.confluent.cloud/cam/v1/connect-artifacts/cca-stgcyoj9dj?spec.cloud=aws&environment=env-stgcznox3d' \
  --header 'accept: application/json' \
  --header 'authorization: Basic <base64-encoded-key-and-secret>' \
  --header 'content-type: application/json' | jq
```
