Share via


Organization - Create API Key

Creates API key for a schema registry Cluster ID or Kafka Cluster ID under a environment

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/environments/{environmentId}/clusters/{clusterId}/createAPIKey?api-version=2024-07-01

URI Parameters

Name In Required Type Description
clusterId
path True

string

Confluent kafka or schema registry cluster id

environmentId
path True

string

Confluent environment id

organizationName
path True

string

Organization resource name

resourceGroupName
path True

string

minLength: 1
maxLength: 90

The name of the resource group. The name is case insensitive.

subscriptionId
path True

string (uuid)

The ID of the target subscription. The value must be an UUID.

api-version
query True

string

minLength: 1

The API version to use for this operation.

Request Body

Name Type Description
description

string

Description of the API Key

name

string

Name of the API Key

Responses

Name Type Description
200 OK

APIKeyRecord

Azure operation completed successfully.

Other Status Codes

ResourceProviderDefaultErrorResponse

An unexpected error response.

Security

azure_auth

Azure Active Directory OAuth2 Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

Organization_CreateClusterAPIKey

Sample request

POST https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Confluent/organizations/myOrganization/environments/env-12132/clusters/clusterId-123/createAPIKey?api-version=2024-07-01

{
  "name": "CI kafka access key",
  "description": "This API key provides kafka access to cluster x"
}

Sample response

{
  "id": "JDCXTFUVFVQGF56J",
  "kind": "ApiKey",
  "properties": {
    "metadata": {
      "createdTimestamp": "2023-11-15T16:15:44.489498Z",
      "resourceName": "crn://api.stag.cpdev.cloud/organization=37d1220b-93a6-43e3-a114-dd8a20a94a31/service-account=sa-wwn7mm/api-key=JDCXTFUVFVQGF56J",
      "self": "https://api.stag.cpdev.cloud/iam/v2/api-keys/JDCXTFUVFVQGF56J",
      "updatedTimestamp": "2023-11-15T16:15:44.489498Z"
    },
    "spec": {
      "name": "CI kafka access key",
      "description": "This API key provides kafka access to cluster x",
      "owner": {
        "id": "sa-wwn7mm",
        "kind": "ServiceAccount",
        "related": "https://api.stag.cpdev.cloud/iam/v2/service-accounts/sa-wwn7mm",
        "resourceName": "crn://api.stag.cpdev.cloud/organization=37d1220b-93a6-43e3-a114-dd8a20a94a31/service-account=sa-wwn7mm"
      },
      "resource": {
        "id": "lsrc-stgc1yrzz3",
        "kind": "SchemaRegistry",
        "related": "https://api.stag.cpdev.cloud/srcm/v2/schema-registries/lsrc-stgc1yrzz3",
        "resourceName": "crn://api.stag.cpdev.cloud/organization=37d1220b-93a6-43e3-a114-dd8a20a94a31/schema-registry=lsrc-stgc1yrzz3"
      },
      "secret": ""
    }
  }
}

Definitions

Name Description
APIKeyOwnerEntity

API Key Owner details which can be a user or service account

APIKeyRecord

Details API key

APIKeyResourceEntity

API Key Resource details which can be kafka cluster or schema registry cluster

APIKeySpecEntity

Spec of the API Key record

CreateAPIKeyModel

Create API Key model

ErrorResponseBody

Response body of Error

ResourceProviderDefaultErrorResponse

Default error response for resource provider

SCMetadataEntity

Metadata of the data record

APIKeyOwnerEntity

API Key Owner details which can be a user or service account

Name Type Description
id

string

API Key owner id

kind

string

Type of the owner service or user account

related

string

API URL for accessing or modifying the referred object

resourceName

string

CRN reference to the referred resource

APIKeyRecord

Details API key

Name Type Description
id

string

Id of the api key

kind

string

Type of api key

properties.metadata

SCMetadataEntity

Metadata of the record

properties.spec

APIKeySpecEntity

Specification of the API Key

APIKeyResourceEntity

API Key Resource details which can be kafka cluster or schema registry cluster

Name Type Description
environment

string

The environment of the api key

id

string

Id of the resource

kind

string

Type of the owner which can be service or user account

related

string

API URL for accessing or modifying the api key resource object

resourceName

string

CRN reference to the referred resource

APIKeySpecEntity

Spec of the API Key record

Name Type Description
description

string

The description of the API Key

name

string

The name of the API Key

owner

APIKeyOwnerEntity

Specification of the cluster

resource

APIKeyResourceEntity

Specification of the cluster

secret

string (password)

API Key Secret

CreateAPIKeyModel

Create API Key model

Name Type Description
description

string

Description of the API Key

name

string

Name of the API Key

ErrorResponseBody

Response body of Error

Name Type Description
code

string

Error code

details

ErrorResponseBody[]

Error detail

message

string

Error message

target

string

Error target

ResourceProviderDefaultErrorResponse

Default error response for resource provider

Name Type Description
error

ErrorResponseBody

Response body of Error

SCMetadataEntity

Metadata of the data record

Name Type Description
createdTimestamp

string

Created Date Time

deletedTimestamp

string

Deleted Date time

resourceName

string

Resource name of the record

self

string

Self lookup url

updatedTimestamp

string

Updated Date time