---
type: api
title: Bulk enable/disable namespace-level customization for packages
description: Enable or disable namespace-level index template customization for a list of packages in one call. Use this for IaC-style declarative flows.<br/><br/>[Required authorization] Route required privileges: integrations-all AND fleet-agent-policies-all.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v0/operation/operation-post-fleet-epm-packages-bulk-namespace-customization
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v0/operation/operation-post-fleet-epm-packages-bulk-namespace-customization
products:
  - Kibana
---

# Bulk enable/disable namespace-level customization for packages

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

## Paths

- `POST` `/api/fleet/epm/packages/_bulk_namespace_customization`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/kibana/v0/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/kibana/v0/authentication#basicauth)

## Description

Enable or disable namespace-level index template customization for a list of packages in one call. Use this for IaC-style declarative flows.<br/><br/>[Required authorization] Route required privileges: integrations-all AND fleet-agent-policies-all.

## Request Body

`application/json`

- `disable` ([] string · max: 100) — optional
  Namespaces to disable namespace-level customization for on each package.
- `enable` ([] string · max: 100) — optional
  Namespaces to enable namespace-level customization for on each package.
- `packages` ([] string · min: 1 · max: 1000) — required
  Package names to apply the customization changes to.

## Responses

#### `200`

OK: A successful request.

`application/json`

- `items` ([] object · max: 1000)
  - `error` (string)
  - `name` (string)
  - `namespace_customization_enabled_for` ([] string · max: 100)
    The opt-in list on the package. Returned whenever the package is installed: the new list on success, or the unchanged list when the request is rejected (for example, because of a namespace-prefix restriction).
  - `success` (boolean)
  - `warnings` ([] object · max: 100)
    - `baseTemplateName` (string · max: 1000)
    - `conflictingTemplates` ([] object · max: 100)
      - `conflictType` (enum)
        Values: `overrides_fleet`, `blocked_by_same_priority`, `overridden_by_fleet`
      - `name` (string · max: 1000)
      - `priority` (number)
    - `dataStreamName` (string · max: 1000)
    - `namespace` (string · max: 255)
    - `nsTemplateName` (string · max: 1000)
#### `400`

A bad request.

`application/json`

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

#### Console

```console
POST /api/fleet/epm/packages/_bulk_namespace_customization
{
  "disable": [
    "dev"
  ],
  "enable": [
    "production",
    "staging"
  ],
  "packages": [
    "system",
    "nginx"
  ]
}
```

#### curl

```curl
curl -X POST "https://{kibana_url}/api/fleet/epm/packages/_bulk_namespace_customization" \
  -H "kbn-xsrf: true" \
  -H "Content-Type: application/json" \
  -d '{
  "disable": [
    "dev"
  ],
  "enable": [
    "production",
    "staging"
  ],
  "packages": [
    "system",
    "nginx"
  ]
}'
```

## Response Examples

#### Success

```json
{
  "items": [
    {
      "name": "system",
      "namespace_customization_enabled_for": [
        "production",
        "staging"
      ],
      "success": true
    },
    {
      "error": "Package nginx is not installed",
      "name": "nginx",
      "success": false
    }
  ]
}
```

#### Bad request

```json
{
  "error": "Bad Request",
  "message": "Namespaces must not appear in both enable and disable: production",
  "statusCode": 400
}
```

