Kafka Connection
General Information
Connection Type
kafka
UI Documentation
Endpoints
List Connections
GET /apiops/projects/{projectName}/connections/?type=kafka
Get Connection
GET /apiops/projects/{projectName}/connections/{connectionName}/
Create Connection
POST /apiops/projects/{projectName}/connections/{connectionName}/
Update Connection
PUT /apiops/projects/{projectName}/connections/{connectionName}/
Delete Connection
DELETE /apiops/projects/{projectName}/connections/{connectionName}/
List Connections
Endpoint
GET /apiops/projects/{projectName}/connections/?type=kafka
Request
Headers
| Header | Value |
|---|---|
| Authorization | Bearer {token} |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
Note: The type query parameter is required to filter connections by type.
cURL Example
curl -X GET \
"https://demo.apinizer.com/apiops/projects/MyProject/connections/" \
-H "Authorization: Bearer YOUR_TOKEN"
Get Connection
Endpoint
GET /apiops/projects/{projectName}/connections/{connectionName}/
Request
Headers
| Header | Value |
|---|---|
| Authorization | Bearer {token} |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| connectionName | string | Yes | Connection name |
Response
Success Response (200 OK)
{
"success": true,
"resultList": [
{
"type": "kafka",
"name": "my-kafka-connection",
"description": "Kafka connection for event streaming",
"deployToWorker": true,
"enabled": true,
"topicName": "events",
"propertiesMap": {
"bootstrap.servers": {
"value": "localhost:9092",
"valueType": "STRING"
},
"key.serializer": {
"value": "org.apache.kafka.common.serialization.StringSerializer",
"valueType": "STRING"
},
"value.serializer": {
"value": "org.apache.kafka.common.serialization.StringSerializer",
"valueType": "STRING"
},
"max.block.ms": {
"value": "3000",
"valueType": "INTEGER"
}
},
"enableSecure": false,
"protocolTypes": [],
"keyStoreId": null,
"trustStoreId": null
}
],
"resultCount": 1
}
cURL Example
curl -X GET \
"https://demo.apinizer.com/apiops/projects/MyProject/connections/my-kafka-connection/" \
-H "Authorization: Bearer YOUR_TOKEN"
Create Connection
Endpoint
POST /apiops/projects/{projectName}/connections/{connectionName}/
Request
Headers
| Header | Value |
|---|---|
| Authorization | Bearer {token} |
| Content-Type | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| connectionName | string | Yes | Connection name (must match name in body) |
Request Body
Full JSON Body Example
{
"type": "kafka",
"name": "my-kafka-connection",
"description": "Kafka connection for event streaming",
"deployToWorker": true,
"enabled": true,
"topicName": "events",
"propertiesMap": {
"bootstrap.servers": {
"value": "localhost:9092",
"valueType": "STRING"
},
"key.serializer": {
"value": "org.apache.kafka.common.serialization.StringSerializer",
"valueType": "STRING"
},
"value.serializer": {
"value": "org.apache.kafka.common.serialization.StringSerializer",
"valueType": "STRING"
},
"max.block.ms": {
"value": "3000",
"valueType": "INTEGER"
},
"acks": {
"value": "all",
"valueType": "STRING"
},
"retries": {
"value": "3",
"valueType": "INTEGER"
}
},
"enableSecure": false,
"protocolTypes": [],
"keyStoreName": null,
"trustStoreName": null
}
Request Body Fields
Common Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| type | string | Yes | - | Connection type discriminator field. Identifies the connection type in API requests/responses. |
| name | string | Yes | - | Connection name (must match path parameter) |
| description | string | No | - | Connection description |
| deployToWorker | boolean | No | true | Whether to deploy to worker |
| enabled | boolean | No | true | Whether connection is enabled |
Kafka-Specific Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| topicName | string | Yes | - | Kafka topic name |
| propertiesMap | object | Yes | - | Kafka producer properties map |
| enableSecure | boolean | No | false | Enable SSL/TLS encryption |
| protocolTypes | array | No* | [] | SSL/TLS protocol types (required if enableSecure=true) |
| keyStoreName | string | No* | - | KeyStore name (required if enableSecure=true) |
| trustStoreName | string | No | - | TrustStore name (optional, for server certificate validation) |
propertiesMap Structure
Each property in propertiesMap is a MapValue object with:
value(string) - Property valuevalueType(string) - Value type
MapValueType
STRING- String valueBOOLEAN- Boolean valueINTEGER- Integer valueLONG- Long valueDOUBLE- Double valueFLOAT- Float valueSTRING_LIST- Comma-separated string listURI- URI value
Common Kafka Properties
bootstrap.servers(STRING) - Kafka broker addresses (e.g., "localhost:9092" or "broker1:9092,broker2:9092")key.serializer(STRING) - Key serializer class (e.g., "org.apache.kafka.common.serialization.StringSerializer")value.serializer(STRING) - Value serializer class (e.g., "org.apache.kafka.common.serialization.StringSerializer")max.block.ms(INTEGER) - Maximum time to block when sending (default: 3000)acks(STRING) - Acknowledgment mode: "0", "1", or "all"retries(INTEGER) - Number of retries on failurebatch.size(INTEGER) - Batch size in byteslinger.ms(INTEGER) - Time to wait before sending batch
EnumSSLContextProtocolType
TLS_1_3- TLS 1.3TLS_1_2- TLS 1.2TLS_1_1- TLS 1.1TLS_1_0- TLS 1.0SSL_3_0- SSL 3.0 (deprecated)
Note
propertiesMapmust contain at leastbootstrap.servers,key.serializer, andvalue.serializer- If
enableSecure: true,protocolTypesandkeyStoreNameare required keyStoreNameandtrustStoreNamerefer to KeyStore names (not IDs) - they are converted to IDs internally
Response
Success Response (200 OK)
{
"success": true,
"deploymentResult": {
"success": true,
"deploymentResults": [
{
"environmentName": "production",
"success": true,
"message": "Deployment successful"
}
]
}
}
cURL Example
curl -X POST \
"https://demo.apinizer.com/apiops/projects/MyProject/connections/my-kafka-connection/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type": "kafka",
"name": "my-kafka-connection",
"description": "Kafka connection for event streaming",
"deployToWorker": true,
"enabled": true,
"topicName": "events",
"propertiesMap": {
"bootstrap.servers": {
"value": "localhost:9092",
"valueType": "STRING"
},
"key.serializer": {
"value": "org.apache.kafka.common.serialization.StringSerializer",
"valueType": "STRING"
},
"value.serializer": {
"value": "org.apache.kafka.common.serialization.StringSerializer",
"valueType": "STRING"
},
"max.block.ms": {
"value": "3000",
"valueType": "INTEGER"
}
},
"enableSecure": false
}'
Update Connection
Endpoint
PUT /apiops/projects/{projectName}/connections/{connectionName}/
Request
Headers
| Header | Value |
|---|---|
| Authorization | Bearer {token} |
| Content-Type | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| connectionName | string | Yes | Connection name (must match name in body) |
Request Body
Full JSON Body Example
{
"type": "kafka",
"name": "my-kafka-connection",
"description": "Updated Kafka connection description",
"deployToWorker": true,
"enabled": true,
"topicName": "updated-events",
"propertiesMap": {
"bootstrap.servers": {
"value": "broker1:9092,broker2:9092",
"valueType": "STRING"
},
"key.serializer": {
"value": "org.apache.kafka.common.serialization.StringSerializer",
"valueType": "STRING"
},
"value.serializer": {
"value": "org.apache.kafka.common.serialization.StringSerializer",
"valueType": "STRING"
},
"max.block.ms": {
"value": "5000",
"valueType": "INTEGER"
}
},
"enableSecure": true,
"protocolTypes": ["TLS_1_2", "TLS_1_3"],
"keyStoreName": "kafka-client-keystore",
"trustStoreName": "kafka-truststore"
}
Note: Request body structure is the same as Create Connection.
Response
Success Response (200 OK)
{
"success": true,
"deploymentResult": {
"success": true,
"deploymentResults": [...]
}
}
cURL Example
curl -X PUT \
"https://demo.apinizer.com/apiops/projects/MyProject/connections/my-kafka-connection/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type": "kafka",
"name": "my-kafka-connection",
"description": "Updated Kafka connection description",
"deployToWorker": true,
"enabled": true,
"topicName": "updated-events",
"propertiesMap": {
"bootstrap.servers": {
"value": "broker1:9092,broker2:9092",
"valueType": "STRING"
},
"key.serializer": {
"value": "org.apache.kafka.common.serialization.StringSerializer",
"valueType": "STRING"
},
"value.serializer": {
"value": "org.apache.kafka.common.serialization.StringSerializer",
"valueType": "STRING"
}
},
"enableSecure": true,
"protocolTypes": ["TLS_1_2"],
"keyStoreName": "kafka-client-keystore"
}'
Delete Connection
Endpoint
DELETE /apiops/projects/{projectName}/connections/{connectionName}/
Request
Headers
| Header | Value |
|---|---|
| Authorization | Bearer {token} |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| connectionName | string | Yes | Connection name |
Response
Success Response (200 OK)
{
"success": true,
"deploymentResult": {
"success": true,
"deploymentResults": [...]
}
}
cURL Example
curl -X DELETE \
"https://demo.apinizer.com/apiops/projects/MyProject/connections/my-kafka-connection/" \
-H "Authorization: Bearer YOUR_TOKEN"
Notes and Warnings
-
Required Properties:
propertiesMapmust contain at least:bootstrap.servers- Kafka broker addresseskey.serializer- Key serializer classvalue.serializer- Value serializer class
-
SSL/TLS: When
enableSecure: true:protocolTypesmust be provided (at least one protocol)keyStoreNameis required (KeyStore must exist)trustStoreNameis optional (for server certificate validation)
-
KeyStore/TrustStore: Use KeyStore names (not IDs). They are converted to IDs internally.
-
Property Types: Use correct
valueTypefor each property:- Numbers:
INTEGER,LONG,DOUBLE,FLOAT - Booleans:
BOOLEAN - Strings:
STRING - Lists:
STRING_LIST(comma-separated)
- Numbers:
-
Bootstrap Servers: Can be a single broker or comma-separated list (e.g., "broker1:9092,broker2:9092")
-
Serializers: Common serializers:
org.apache.kafka.common.serialization.StringSerializer- Stringorg.apache.kafka.common.serialization.ByteArraySerializer- Byte arrayorg.apache.kafka.common.serialization.IntegerSerializer- Integer
-
Deployment: If
deployToWorker: true, connection is automatically deployed to workers -
Name Matching: Path parameter
connectionNamemust match thenamefield in the request body
Related Documentation
- List Connections - List all connections
- Get Connection - Get connection details
- Create Connection - General connection creation guide
- Update Connection - General connection update guide
- Delete Connection - General connection deletion guide