> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open-metadata.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a Messaging Service

> Create a new messaging service connection

# Create a Messaging Service

Create a new messaging service connection to a platform such as Kafka, Redpanda, or Kinesis.

## Body Parameters

**name** `string` *required*

Name of the messaging service. Must be unique across all messaging services.

**serviceType** `string` *required*

Type of messaging service, for example `Kafka`, `Redpanda`, `Kinesis`, `CustomMessaging`.

**description** `string`

Description of the messaging service in Markdown format.

**displayName** `string`

Human-readable display name for the messaging service.

**connection** `object` *required*

Connection configuration specific to the service type.

**properties**

**config** `object`

Service-specific connection configuration, for example bootstrapServers, securityProtocol for Kafka.

**owners** `array`

Array of owner references (users or teams) to assign to the service.

**properties**

**id** `string`

UUID of the owner entity.

**type** `string`

Type of owner entity, for example `user`, `team`.

**name** `string`

Name of the owner entity.

**domains** `array`

Fully qualified names of the domains to assign for governance purposes.

**tags** `array`

Array of classification tags to apply to the messaging service.

**properties**

**tagFQN** `string` *required*

Fully qualified name of the tag.

**labelType** `string`

Type of label, for example `Manual`, `Derived`, `Propagated`.

**state** `string`

State of the tag, for example `Suggested`, `Confirmed`.

```python POST /v1/services/messagingServices theme={null}
import requests

base_url = "https://your-company.open-metadata.org/api"
headers = {
    "Authorization": "Bearer your-jwt-token",
    "Content-Type": "application/json"
}

payload = {
    "name": "sample_kafka",
    "displayName": "Sample Kafka",
    "serviceType": "Kafka",
    "description": "Production Kafka messaging service",
    "connection": {
        "config": {
            "type": "Kafka",
            "bootstrapServers": "localhost:9092",
            "securityProtocol": "PLAINTEXT",
            "saslMechanism": "PLAIN",
            "schemaRegistryTopicSuffixName": "-value",
            "supportsMetadataExtraction": True
        }
    }
}

response = requests.post(
    f"{base_url}/v1/services/messagingServices",
    json=payload,
    headers=headers
)
service = response.json()
print(f"Created: {service['fullyQualifiedName']}")
```

```java POST /v1/services/messagingServices theme={null}
import org.openmetadata.schema.api.services.CreateMessagingService;
import org.openmetadata.schema.api.services.CreateMessagingService.MessagingServiceType;
import org.openmetadata.schema.entity.services.MessagingService;
import org.openmetadata.schema.services.connections.messaging.KafkaConnection;
import org.openmetadata.schema.type.MessagingConnection;
import org.openmetadata.sdk.fluent.MessagingServices;

CreateMessagingService request = new CreateMessagingService()
    .withName("sample_kafka")
    .withServiceType(MessagingServiceType.Kafka)
    .withConnection(new MessagingConnection().withConfig(
        new KafkaConnection()
            .withBootstrapServers("localhost:9092")
            .withSecurityProtocol(KafkaConnection.SecurityProtocol.PLAINTEXT)));

MessagingService service = MessagingServices.create(request);
```

```bash POST /v1/services/messagingServices theme={null}
curl -X POST "{base_url}/api/v1/services/messagingServices" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "sample_kafka",
    "serviceType": "Kafka",
    "description": "Production Kafka messaging service",
    "connection": {
      "config": {
        "type": "Kafka",
        "bootstrapServers": "localhost:9092",
        "securityProtocol": "PLAINTEXT",
        "saslMechanism": "PLAIN",
        "schemaRegistryTopicSuffixName": "-value",
        "supportsMetadataExtraction": true
      }
    }
  }'
```

```json Response theme={null}
{
  "id": "469ef25e-9bdf-4d5f-8553-eb0ce8581f30",
  "name": "sample_kafka",
  "fullyQualifiedName": "sample_kafka",
  "serviceType": "Kafka",
  "connection": {
    "config": {
      "type": "Kafka",
      "bootstrapServers": "localhost:9092",
      "securityProtocol": "PLAINTEXT",
      "saslMechanism": "PLAIN",
      "schemaRegistryTopicSuffixName": "-value",
      "supportsMetadataExtraction": true
    }
  },
  "tags": [],
  "version": 0.1,
  "updatedAt": 1769982621031,
  "updatedBy": "admin",
  "href": "http://localhost:8585/api/v1/services/messagingServices/469ef25e-9bdf-4d5f-8553-eb0ce8581f30",
  "deleted": false,
  "owners": [],
  "domains": []
}
```

***

## Returns

Returns the created messaging service object with all specified properties and system-generated fields.

## Response

**id** `string`

Unique identifier for the messaging service (UUID format).

**name** `string`

Messaging service name.

**fullyQualifiedName** `string`

Fully qualified name of the service.

**displayName** `string`

Human-readable display name.

**description** `string`

Description of the messaging service in Markdown format.

**serviceType** `string`

Type of messaging service, for example Kafka, Redpanda, Kinesis.

**connection** `object`

Connection configuration for the service.

**properties**

**config** `object`

Service-specific connection configuration.

**owners** `array`

List of owners assigned to the messaging service.

**properties**

**id** `string`

UUID of the owner entity.

**type** `string`

Type of owner entity, for example `user`, `team`.

**name** `string`

Name of the owner entity.

**domains** `array`

Fully qualified name of the assigned domain.

**tags** `array`

Classification tags applied to the messaging service.

**properties**

**tagFQN** `string`

Fully qualified name of the tag.

**labelType** `string`

Type of label, for example `Manual`, `Derived`, `Propagated`.

**state** `string`

State of the tag, for example `Suggested`, `Confirmed`.

**version** `number`

Version number for the entity (starts at 0.1).

***

## Create or Update (PUT)

Use `PUT /v1/services/messagingServices` instead of `POST` to perform an upsert. If a messaging service with the same `fullyQualifiedName` already exists, it will be updated; otherwise, a new service is created. The request body is the same as `POST`.

```bash theme={null}
curl -X PUT "{base_url}/api/v1/services/messagingServices" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{ ... same body as POST ... }'
```

> [!NOTE]
>
> `PUT` will not return a `409` conflict error if the entity already exists -- it will update the existing entity instead.

***

## Bulk Create or Update (PUT)

Use `PUT /v1/services/messagingServices/bulk` to create or update multiple messaging services in a single request. The request body is an array of create request objects.

```bash theme={null}
curl -X PUT "{base_url}/api/v1/services/messagingServices/bulk" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '[
    { "name": "kafka_prod", "serviceType": "Kafka", "connection": { "config": {} } },
    { "name": "redpanda_staging", "serviceType": "Redpanda", "connection": { "config": {} } }
  ]'
```

***

## Error Handling

| Code | Error Type | Description |
| - | - | - |
| `400` | `BAD_REQUEST` | Invalid request body or missing required fields |
| `401` | `UNAUTHORIZED` | Invalid or missing authentication token |
| `403` | `FORBIDDEN` | User lacks permission to create messaging services |
| `409` | `ENTITY_ALREADY_EXISTS` | Messaging service with same name already exists (POST only) |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.