---
type: api
title: Create a managed integration
description: Create a managed integration
url: https://www.elastic.co/elastic/docs-builder/docs/4922/api/doc/kibana/operation/operation-post-fleet-managed-integrations
resource: https://www.elastic.co/elastic/docs-builder/docs/4922/api/doc/kibana/operation/operation-post-fleet-managed-integrations
products:
  - Kibana
---

# Create a managed integration

Authentication: required

Availability: Experimental since 9.3

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

## Paths

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

#### 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.

## Description

Create a managed integration

## Header parameters

- `kbn-xsrf` (string) — required
  A required header to protect against CSRF attacks

## Request body

`application/json`

- `acknowledge_agent_version_incompatibility` (boolean) — optional
  When true, create or upgrade the package policy even though some active agents on its agent policies don't satisfy the package's agent version condition. Without it, the request is rejected, because those agents would stop collecting the integration's data. The `force` flag does not bypass this check.
- `additional_datastreams_permissions` (string[] · max items: 100) — optional — nullable
  Additional data stream permissions that will be added to the agent policy.
- `cloud_connector` (object) — optional — nullable
  - `cloud_connector_id` (string · max length: 256) — optional
    ID of an existing cloud connector to reuse. If not provided, a new connector is created. Requires `enabled: true` and cannot be combined with `name`.
  - `enabled` (boolean · default: false) — optional
    Set to `true` to attach a cloud connector to this policy. Must be `true` to set any of `cloud_connector_id`, `name`, or `target_csp`.
  - `name` (string · min length: 1 · max length: 255) — optional
    Name for a new cloud connector. If not provided, a name is generated automatically from the credentials. Requires `enabled: true` and only applies when creating a new connector (cannot be combined with `cloud_connector_id`).
  - `target_csp` (enum) — optional
    Target cloud service provider. If not provided, the provider is detected automatically from the inputs. Requires `enabled: true`.
    Values: `aws`, `azure`, `gcp`
- `create_dataset_templates` (boolean) — optional
  When true, install dedicated index templates for streams with a custom data_stream.dataset. Defaults to true for input packages, false for integration packages.
- `description` (string · max length: 2048) — optional
  Policy description.
- `force` (boolean) — optional
  Force package policy creation even if the package is not verified, or if the agent policy is managed.
- `global_data_tags` (object[] · max items: 100) — optional
  - `name` (string · max length: 1024) — required
    Name of the custom field. The name cannot contain spaces.
  - `value` (union string | number) — required
    Value of the custom field.
- `id` (string · max length: 255) — optional
  Policy unique identifier.
- `inputs` (map string to object) — optional
  Package policy inputs. Refer to the integration documentation to know which inputs are available.
  Map values (object)
  - `condition` (string · max length: 10000) — optional — nullable
    Agent condition expression to evaluate whether to apply this input.
  - `deprecated` (object) — optional
    - `description` (string · max length: 4096) — required
    - `replaced_by` (map string to string) — optional
      Map values (string · max length: 1024)
    - `since` (string · max length: 50) — optional
  - `enabled` (boolean) — optional
    Enable or disable that input. Defaults to `true` (enabled).
  - `streams` (map string to object) — optional
    Input streams. Refer to the integration documentation to know which streams are available.
    Map values (object)
    - `condition` (string · max length: 10000) — optional — nullable
      Agent condition expression to evaluate whether to apply this stream.
    - `deprecated` (object) — optional
      - `description` (string · max length: 4096) — required
      - `replaced_by` (map string to string) — optional
        Map values (string · max length: 1024)
      - `since` (string · max length: 50) — optional
    - `enabled` (boolean) — optional
      Enable or disable that stream. Defaults to `true` (enabled).
    - `var_group_selections` (map string to string) — optional
      Variable group selections. Maps var_group name to the selected option name within that group.
      Map values (string · max length: 1024)
    - `vars` (map string to anyOf) — optional
      Input/stream level variable. Refer to the integration documentation for more information.
      Map values (union anyOf · default: null)
      Any of:
      - **[]string**
      - **string**
      - **[]number**
      - **number**
      - **boolean**
      - **{ id, isSecretRef }**
        - `id` (string · max length: 255) — required
        - `isSecretRef` (boolean) — required
  - `vars` (map string to anyOf) — optional
    Input/stream level variable. Refer to the integration documentation for more information.
    Map values (union anyOf · default: null)
    Any of:
    - **[]string**
    - **string**
    - **[]number**
    - **number**
    - **boolean**
    - **{ id, isSecretRef }**
      - `id` (string · max length: 255) — required
      - `isSecretRef` (boolean) — required
- `name` (string · max length: 255) — required
  Unique name for the policy.
- `namespace` (string · max length: 100) — optional
  Policy namespace. When not specified, it inherits the agent policy namespace.
- `package` (object) — required
  - `experimental_data_stream_features` (object[] · max items: 100) — optional
    - `data_stream` (string · max length: 1024) — required
    - `features` (object) — required
      - `doc_value_only_numeric` (boolean) — optional
      - `doc_value_only_other` (boolean) — optional
      - `synthetic_source` (boolean) — optional
      - `tsdb` (boolean) — optional
  - `fips_compatible` (boolean) — optional
  - `name` (string · max length: 255) — required
    Package name
  - `requires_root` (boolean) — optional
  - `title` (string · max length: 255) — optional
  - `version` (string · max length: 50) — required
    Package version
- `policy_template` (string · max length: 256) — optional
  The policy template to use for the managed integration. If not provided, the default policy template is used.
- `var_group_selections` (map string to string) — optional
  Variable group selections. Maps var_group name to the selected option name within that group.
  Map values (string · max length: 1024)
- `vars` (map string to anyOf) — optional
  Input/stream level variable. Refer to the integration documentation for more information.
  Map values (union anyOf · default: null)
  Any of:
  - **[]string**
  - **string**
  - **[]number**
  - **number**
  - **boolean**
  - **{ id, isSecretRef }**
    - `id` (string · max length: 255) — required
    - `isSecretRef` (boolean) — required

## Responses

#### `200`

Indicates a successful response

`application/json`

- `item` (object)
  - `additional_datastreams_permissions` (string[] · max items: 1000)
    Additional data stream permissions granted to the managed integration.
  - `cloud_connector` (object)
    - `cloud_connector_id` (string · max length: 255)
      The ID of the cloud connector.
    - `enabled` (boolean)
      Whether the cloud connector is active for this policy.
  - `created_at` (string · max length: 64)
    Creation timestamp (ISO 8601).
  - `created_by` (string · max length: 1024)
    User who created the policy.
  - `description` (string · max length: 2048)
    Managed integration description.
  - `global_data_tags` (object[] · max items: 100)
    Custom data tags applied to all data produced by this policy.
    - `name` (string · max length: 1024)
      The name of the custom field.
    - `value` (union string | number)
      The value of the custom field.
  - `id` (string · max length: 255)
    Managed integration unique identifier.
  - `inputs` (map string to object)
    Package policy inputs. Refer to the integration documentation to know which inputs are available.
    Map values (object)
    - `condition` (string · max length: 10000) — nullable
      Agent condition expression to evaluate whether to apply this input.
    - `deprecated` (object)
      - `description` (string · max length: 4096)
      - `replaced_by` (map string to string)
        Map values (string · max length: 1024)
      - `since` (string · max length: 50)
    - `enabled` (boolean)
      Enable or disable that input. Defaults to `true` (enabled).
    - `streams` (map string to object)
      Input streams. Refer to the integration documentation to know which streams are available.
      Map values (object)
      - `condition` (string · max length: 10000) — nullable
        Agent condition expression to evaluate whether to apply this stream.
      - `deprecated` (object)
        - `description` (string · max length: 4096)
        - `replaced_by` (map string to string)
          Map values (string · max length: 1024)
        - `since` (string · max length: 50)
      - `enabled` (boolean)
        Enable or disable that stream. Defaults to `true` (enabled).
      - `var_group_selections` (map string to string)
        Variable group selections. Maps var_group name to the selected option name within that group.
        Map values (string · max length: 1024)
      - `vars` (map string to anyOf)
        Input/stream level variable. Refer to the integration documentation for more information.
        Map values (union anyOf · default: null)
        Any of:
        - **[]string**
        - **string**
        - **[]number**
        - **number**
        - **boolean**
        - **{ id, isSecretRef }**
          - `id` (string · max length: 255)
          - `isSecretRef` (boolean)
    - `vars` (map string to anyOf)
      Input/stream level variable. Refer to the integration documentation for more information.
      Map values (union anyOf · default: null)
      Any of:
      - **[]string**
      - **string**
      - **[]number**
      - **number**
      - **boolean**
      - **{ id, isSecretRef }**
        - `id` (string · max length: 255)
        - `isSecretRef` (boolean)
  - `name` (string · max length: 255)
    Managed integration name.
  - `namespace` (string · max length: 100)
    Policy namespace. Defaults to the agent policy namespace.
  - `onboarding_deployment_id` (string · max length: 256)
    ID of the cloud onboarding instance that manages this managed integration. Set by Fleet, read-only.
  - `package` (object)
    - `name` (string · max length: 255)
      Integration package name.
    - `title` (string · max length: 255)
      Integration package display title.
    - `version` (string · max length: 50)
      Integration package version.
  - `updated_at` (string · max length: 64)
    Last update timestamp (ISO 8601).
  - `updated_by` (string · max length: 1024)
    User who last updated the policy.
  - `var_group_selections` (map string to string)
    Variable group selections. Maps var_group name to the selected option name within that group.
    Map values (string · max length: 1024)
  - `vars` (map string to anyOf)
    Input/stream level variable. Refer to the integration documentation for more information.
    Map values (union anyOf · default: null)
    Any of:
    - **[]string**
    - **string**
    - **[]number**
    - **number**
    - **boolean**
    - **{ id, isSecretRef }**
      - `id` (string · max length: 255)
      - `isSecretRef` (boolean)
#### `400`

Bad Request

`application/json`

- `attributes` (object)
- `error` (string)
- `errorType` (string)
- `message` (string)
- `statusCode` (number)
#### `409`

Conflict

`application/json`

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

#### Console

```console
POST kbn:/api/fleet/managed_integrations
{
  "description": "test",
  "inputs": {
    "ESS Billing-cel": {
      "enabled": true,
      "streams": {
        "ess_billing.billing": {
          "enabled": true,
          "vars": {
            "hide_sensitive": true,
            "http_client_timeout": "30s",
            "lookbehind": 365,
            "tags": [
              "forwarded",
              "billing"
            ]
          }
        },
        "ess_billing.credits": {
          "enabled": false
        }
      },
      "vars": {
        "api_key": "\u003CREPLACE_WITH_YOUR_API_KEY\u003E",
        "organization_id": "1234"
      }
    }
  },
  "name": "ess_billing-1",
  "namespace": "default",
  "package": {
    "name": "ess_billing",
    "version": "1.6.0"
  }
}
```

#### curl

```curl
curl -X POST "${KIBANA_URL}/api/fleet/managed_integrations" \
  -H "kbn-xsrf: true" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "description": "test",
    "inputs": {
      "ESS Billing-cel": {
        "enabled": true,
        "streams": {
          "ess_billing.billing": {
            "enabled": true,
            "vars": {
              "hide_sensitive": true,
              "http_client_timeout": "30s",
              "lookbehind": 365,
              "tags": [
                "forwarded",
                "billing"
              ]
            }
          },
          "ess_billing.credits": {
            "enabled": false
          }
        },
        "vars": {
          "api_key": "\u003CREPLACE_WITH_YOUR_API_KEY\u003E",
          "organization_id": "1234"
        }
      }
    },
    "name": "ess_billing-1",
    "namespace": "default",
    "package": {
      "name": "ess_billing",
      "version": "1.6.0"
    }
  }'
```

## Response examples

#### Create managed integrations response

`application/json`

Example response for creating a managed integration

```json
{
  "item": {
    "created_at": "2025-11-06T18:27:43.541Z",
    "created_by": "test_user",
    "description": "test",
    "id": "d52a7812-5736-4fdc-aed8-72152afa1ffa",
    "inputs": {
      "ESS Billing-cel": {
        "enabled": true,
        "streams": {
          "ess_billing.billing": {
            "enabled": true,
            "vars": {
              "hide_sensitive": true,
              "http_client_timeout": "30s",
              "lookbehind": 365,
              "tags": [
                "forwarded",
                "billing"
              ]
            }
          },
          "ess_billing.credits": {
            "enabled": false
          }
        },
        "vars": {
          "api_key": {
            "id": "QY1sWpoBbWcMW-edr0Ee",
            "isSecretRef": true
          },
          "organization_id": "1234",
          "url": "https://billing.elastic-cloud.com"
        }
      }
    },
    "name": "ess_billing-1",
    "namespace": "default",
    "package": {
      "name": "ess_billing",
      "title": "Elasticsearch Service Billing",
      "version": "1.6.0"
    },
    "updated_at": "2025-11-06T18:27:43.541Z",
    "updated_by": "test_user"
  }
}
```

#### Create managed integrations with awscloud connector response

`application/json`

Example response for AWS cloud connector integration

```json
{
  "item": {
    "cloud_connector": {
      "cloud_connector_id": "aws-connector-67890",
      "enabled": true
    },
    "created_at": "2025-11-06T18:27:43.541Z",
    "created_by": "test_user",
    "description": "CSPM integration for AWS with cloud connector",
    "id": "aws-policy-12345",
    "inputs": {
      "cspm-cloudbeat/cis_aws": {
        "enabled": true,
        "streams": {
          "cloud_security_posture.findings": {
            "enabled": true,
            "vars": {
              "aws.account_type": "organization-account",
              "aws.credentials.type": "cloud_connector",
              "external_id": {
                "id": "secret-external-id-123",
                "isSecretRef": true
              },
              "role_arn": "arn:aws:iam::123456789012:role/TestRole"
            }
          }
        },
        "vars": {
          "cloud_formation_template": "https://console.aws.amazon.com/cloudformation/home#/stacks/quickcreate?templateURL=https://elastic-cspm-cft.s3.eu-central-1.amazonaws.com/cloudformation-cspm-ACCOUNT_TYPE-9.2.0.yml"
        }
      },
      "cspm-cloudbeat/cis_azure": {
        "enabled": false
      },
      "cspm-cloudbeat/cis_gcp": {
        "enabled": false
      }
    },
    "name": "cspm-aws-policy",
    "namespace": "default",
    "package": {
      "name": "cloud_security_posture",
      "title": "Cloud Security Posture Management",
      "version": "3.1.1"
    },
    "updated_at": "2025-11-06T18:27:43.541Z",
    "updated_by": "test_user",
    "vars": {
      "deployment": "aws",
      "posture": "cspm"
    }
  }
}
```

#### Create managed integrations with azure cloud connector response

`application/json`

Example response for Azure cloud connector integration

```json
{
  "item": {
    "cloud_connector": {
      "cloud_connector_id": "azure-connector-67890",
      "enabled": true
    },
    "created_at": "2025-11-06T18:27:43.541Z",
    "created_by": "test_user",
    "description": "CSPM integration for Azure with cloud connector",
    "id": "azure-policy-12345",
    "inputs": {
      "cspm-cloudbeat/cis_aws": {
        "enabled": false
      },
      "cspm-cloudbeat/cis_azure": {
        "enabled": true,
        "streams": {
          "cloud_security_posture.findings": {
            "enabled": true,
            "vars": {
              "azure_credentials_cloud_connector_id": {
                "type": "text",
                "value": "existing-azure-credentials-connector-id"
              },
              "azure.account_type": "organization-account",
              "client_id": {
                "id": "client-secret-id-456",
                "isSecretRef": true
              },
              "tenant_id": {
                "id": "tenant-secret-id-123",
                "isSecretRef": true
              }
            }
          }
        }
      },
      "cspm-cloudbeat/cis_gcp": {
        "enabled": false
      }
    },
    "name": "cspm-azure-policy",
    "namespace": "default",
    "package": {
      "name": "cloud_security_posture",
      "title": "Cloud Security Posture Management",
      "version": "3.1.1"
    },
    "updated_at": "2025-11-06T18:27:43.541Z",
    "updated_by": "test_user",
    "vars": {
      "deployment": "azure",
      "posture": "cspm"
    }
  }
}
```

#### Generic error response

`application/json`

Example of a generic error response

```json
{
  "error": "Bad Request",
  "message": "An error message describing what went wrong",
  "statusCode": 400
}
```

#### Conflict error response

`application/json`

Example of a conflict error response

```json
{
  "error": "Conflict",
  "message": "An error message describing what went wrong",
  "statusCode": 409
}
```

