---
type: api
title: Create output
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/kibana/v8/operation/operation-post-outputs
resource: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/kibana/v8/operation/operation-post-outputs
products:
  - Kibana
---

# Create output

Authentication: required

- Server: `https://{kibana_url}`

## Paths

- `POST` `/api/fleet/outputs`
- `POST` `/s/{space_id}/api/fleet/outputs`

#### Path parameters

- `space_id` (string) — optional
  An identifier for the space. If `space_id` is not provided in the URL, the default space is used. Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

## Request body

`application/json`

One of:
- **elasticsearch** (`type: elasticsearch`)
  - `type` (enum) — optional
    Values: `elasticsearch`
  - `ca_sha256` (string) — optional
  - `ca_trusted_fingerprint` (string) — optional
  - `config` (object) — optional
  - `config_yaml` (string) — optional
  - `hosts` (string[]) — optional
  - `id` (string) — optional
  - `is_default` (boolean) — optional
  - `is_default_monitoring` (boolean) — optional
  - `is_internal` (boolean) — optional
  - `name` (string) — required
  - `preset` (enum) — optional
    Values: `balanced`, `custom`, `throughput`, `scale`, `latency`
  - `proxy_id` (string) — optional
  - `shipper` (object) — optional
    - `compression_level` (number) — optional
    - `disk_queue_compression_enabled` (boolean) — optional
    - `disk_queue_enabled` (boolean) — optional
    - `disk_queue_encryption_enabled` (boolean) — optional
    - `disk_queue_max_size` (number) — optional
    - `disk_queue_path` (string) — optional
    - `loadbalance` (boolean) — optional
  - `ssl` (object) — optional
    - `certificate` (string) — optional
    - `certificate_authorities` (string[]) — optional
    - `key` (string) — optional
- **kafka** (`type: kafka`)
  - `type` (enum) — required
    Values: `kafka`
  - `auth_type` (string) — required
  - `broker_timeout` (number) — optional
  - `ca_sha256` (string) — optional
  - `ca_trusted_fingerprint` (string) — optional
  - `client_id` (string) — optional
  - `compression` (string) — optional
  - `compression_level` (number) — optional
  - `config` (object) — optional
  - `config_yaml` (string) — optional
  - `connection_type` (enum) — optional
    Values: `plaintext`, `encryption`
  - `headers` (object[]) — optional
    - `key` (string) — optional
    - `value` (string) — optional
  - `hosts` (string[]) — required
  - `id` (string) — optional
  - `is_default` (boolean) — optional
  - `is_default_monitoring` (boolean) — optional
  - `is_internal` (boolean) — optional
  - `key` (string) — optional
  - `name` (string) — required
  - `partition` (string) — optional
  - `password` (string) — optional
  - `proxy_id` (string) — optional
  - `random` (object) — optional
    - `group_events` (number) — optional
  - `required_acks` (number) — optional
  - `round_robin` (object) — optional
    - `group_events` (number) — optional
  - `sasl` (object) — optional
    - `mechanism` (string) — optional
  - `secrets` (object) — optional
    - `password` (string) — optional
    - `ssl` (object) — optional
      - `key` (string) — optional
  - `shipper` (object) — optional
    - `compression_level` (number) — optional
    - `disk_queue_compression_enabled` (boolean) — optional
    - `disk_queue_enabled` (boolean) — optional
    - `disk_queue_encryption_enabled` (boolean) — optional
    - `disk_queue_max_size` (number) — optional
    - `disk_queue_path` (string) — optional
    - `loadbalance` (boolean) — optional
  - `ssl` (object) — optional
    - `certificate` (string) — optional
    - `certificate_authorities` (string[]) — optional
    - `key` (string) — optional
    - `verification_mode` (enum) — optional
      Values: `none`, `full`, `certificate`, `strict`
  - `timeout` (number) — optional
  - `topic` (string) — optional
  - `topics` (object[]) — required — deprecated
    Use topic instead.
    - `topic` (string) — optional
    - `when` (object) — optional — deprecated
      Deprecated, kafka output do not support conditionnal topics anymore.
      - `condition` (string) — optional
      - `type` (string) — optional
  - `username` (string) — optional
  - `version` (string) — optional
- **logstash** (`type: logstash`)
  - `type` (enum) — required
    Values: `logstash`
  - `ca_sha256` (string) — optional
  - `ca_trusted_fingerprint` (string) — optional
  - `config` (object) — optional
  - `config_yaml` (string) — optional
  - `hosts` (string[]) — required
  - `id` (string) — optional
  - `is_default` (boolean) — optional
  - `is_default_monitoring` (boolean) — optional
  - `is_internal` (boolean) — optional
  - `name` (string) — required
  - `proxy_id` (string) — optional
  - `secrets` (object) — optional
    - `ssl` (object) — optional
      - `key` (string) — optional
  - `shipper` (object) — optional
    - `compression_level` (number) — optional
    - `disk_queue_compression_enabled` (boolean) — optional
    - `disk_queue_enabled` (boolean) — optional
    - `disk_queue_encryption_enabled` (boolean) — optional
    - `disk_queue_max_size` (number) — optional
    - `disk_queue_path` (string) — optional
    - `loadbalance` (boolean) — optional
  - `ssl` (object) — optional
    - `certificate` (string) — optional
    - `certificate_authorities` (string[]) — optional
    - `key` (string) — optional
- **remote_elasticsearch** (`type: remote_elasticsearch`)
  - `type` (enum) — optional
    Values: `remote_elasticsearch`
  - `hosts` (string[]) — optional
  - `id` (string) — optional
  - `is_default` (boolean) — optional
  - `is_default_monitoring` (boolean) — optional
  - `is_internal` (boolean) — optional
  - `name` (string) — required
  - `secrets` (object) — optional
    - `service_token` (string) — optional
  - `service_token` (string) — optional

## Responses

#### `200`

OK

`application/json`

- `item` (union oneOf)
  - **elasticsearch** (`type: elasticsearch`)
    - `type` (enum)
      Values: `elasticsearch`
    - `ca_sha256` (string)
    - `ca_trusted_fingerprint` (string)
    - `config` (object)
    - `config_yaml` (string)
    - `hosts` (string[])
    - `id` (string)
    - `is_default` (boolean)
    - `is_default_monitoring` (boolean)
    - `is_internal` (boolean)
    - `name` (string)
    - `preset` (enum)
      Values: `balanced`, `custom`, `throughput`, `scale`, `latency`
    - `proxy_id` (string)
    - `shipper` (object)
      - `compression_level` (number)
      - `disk_queue_compression_enabled` (boolean)
      - `disk_queue_enabled` (boolean)
      - `disk_queue_encryption_enabled` (boolean)
      - `disk_queue_max_size` (number)
      - `disk_queue_path` (string)
      - `loadbalance` (boolean)
    - `ssl` (object)
      - `certificate` (string)
      - `certificate_authorities` (string[])
      - `key` (string)
  - **kafka** (`type: kafka`)
    - `type` (enum)
      Values: `kafka`
    - `auth_type` (string)
    - `broker_timeout` (number)
    - `ca_sha256` (string)
    - `ca_trusted_fingerprint` (string)
    - `client_id` (string)
    - `compression` (string)
    - `compression_level` (number)
    - `config` (object)
    - `config_yaml` (string)
    - `connection_type` (enum)
      Values: `plaintext`, `encryption`
    - `headers` (object[])
      - `key` (string)
      - `value` (string)
    - `hosts` (string[])
    - `id` (string)
    - `is_default` (boolean)
    - `is_default_monitoring` (boolean)
    - `is_internal` (boolean)
    - `key` (string)
    - `name` (string)
    - `partition` (string)
    - `password` (string)
    - `proxy_id` (string)
    - `random` (object)
      - `group_events` (number)
    - `required_acks` (number)
    - `round_robin` (object)
      - `group_events` (number)
    - `sasl` (object)
      - `mechanism` (string)
    - `secrets` (object)
      - `password` (string)
      - `ssl` (object)
        - `key` (string)
    - `shipper` (object)
      - `compression_level` (number)
      - `disk_queue_compression_enabled` (boolean)
      - `disk_queue_enabled` (boolean)
      - `disk_queue_encryption_enabled` (boolean)
      - `disk_queue_max_size` (number)
      - `disk_queue_path` (string)
      - `loadbalance` (boolean)
    - `ssl` (object)
      - `certificate` (string)
      - `certificate_authorities` (string[])
      - `key` (string)
      - `verification_mode` (enum)
        Values: `none`, `full`, `certificate`, `strict`
    - `timeout` (number)
    - `topic` (string)
    - `topics` (object[]) — deprecated
      Use topic instead.
      - `topic` (string)
      - `when` (object) — deprecated
        Deprecated, kafka output do not support conditionnal topics anymore.
        - `condition` (string)
        - `type` (string)
    - `username` (string)
    - `version` (string)
  - **logstash** (`type: logstash`)
    - `type` (enum)
      Values: `logstash`
    - `ca_sha256` (string)
    - `ca_trusted_fingerprint` (string)
    - `config` (object)
    - `config_yaml` (string)
    - `hosts` (string[])
    - `id` (string)
    - `is_default` (boolean)
    - `is_default_monitoring` (boolean)
    - `is_internal` (boolean)
    - `name` (string)
    - `proxy_id` (string)
    - `secrets` (object)
      - `ssl` (object)
        - `key` (string)
    - `shipper` (object)
      - `compression_level` (number)
      - `disk_queue_compression_enabled` (boolean)
      - `disk_queue_enabled` (boolean)
      - `disk_queue_encryption_enabled` (boolean)
      - `disk_queue_max_size` (number)
      - `disk_queue_path` (string)
      - `loadbalance` (boolean)
    - `ssl` (object)
      - `certificate` (string)
      - `certificate_authorities` (string[])
      - `key` (string)
  - **remote_elasticsearch** (`type: remote_elasticsearch`)
    - `type` (enum)
      Values: `remote_elasticsearch`
    - `hosts` (string[])
    - `id` (string)
    - `is_default` (boolean)
    - `is_default_monitoring` (boolean)
    - `is_internal` (boolean)
    - `name` (string)
    - `secrets` (object)
      - `service_token` (string)
    - `service_token` (string)
#### `400`

Generic Error

`application/json`

- `error` (string)
- `message` (string)
- `statusCode` (number)
## Code examples

#### Console

```console
POST kbn:/api/fleet/outputs
{
  "name": "string"
}
```

#### curl

```curl
curl -X POST "${KIBANA_URL}/api/fleet/outputs" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "string"
  }'
```

## Response examples

#### 200

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "item": {
    "ca_sha256": "string",
    "ca_trusted_fingerprint": "string",
    "config": {},
    "config_yaml": "string",
    "hosts": [
      "string"
    ],
    "id": "string",
    "is_default": false,
    "is_default_monitoring": false,
    "is_internal": false,
    "name": "string",
    "preset": "balanced",
    "proxy_id": "string",
    "shipper": {
      "compression_level": 0,
      "disk_queue_compression_enabled": false,
      "disk_queue_enabled": false,
      "disk_queue_encryption_enabled": false,
      "disk_queue_max_size": 0,
      "disk_queue_path": "string",
      "loadbalance": false
    },
    "ssl": {
      "certificate": "string",
      "certificate_authorities": [
        "string"
      ],
      "key": "string"
    },
    "type": "elasticsearch"
  }
}
```

#### 400

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "error": "string",
  "message": "string",
  "statusCode": 0
}
```

