Bulk enable/disable namespace-level customization for packages

POST /api/fleet/epm/packages/_bulk_namespace_customization

Spaces method and path for this operation:

post /s/{space_id}/api/fleet/epm/packages/_bulk_namespace_customization

Refer to Spaces for more information.

Enable or disable namespace-level index template customization for a list of packages in one call. Use this for IaC-style declarative flows.

[Required authorization] Route required privileges: integrations-all AND fleet-agent-policies-all.

Headers

  • kbn-xsrf string Required

    A required header to protect against CSRF attacks

application/json

Body

  • disable array[string]

    Namespaces to disable namespace-level customization for on each package.

    Not more than 100 elements.

  • enable array[string]

    Namespaces to enable namespace-level customization for on each package.

    Not more than 100 elements.

  • packages array[string] Required

    Package names to apply the customization changes to.

    At least 1 but not more than 1000 elements.

Responses

  • 200 application/json

    OK: A successful request.

    Hide response attribute Show response attribute object
    • items array[object] Required

      Not more than 1000 elements.

      Hide items attributes Show items attributes object
      • error string
      • name string Required
      • namespace_customization_enabled_for array[string]

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

        Not more than 100 elements.

      • success boolean Required
  • 400 application/json

    A bad request.

    Hide response attributes Show response attributes object
    • attributes Required
    • error string
    • errorType string
    • message string Required
    • statusCode number
POST /api/fleet/epm/packages/_bulk_namespace_customization
curl \
 --request POST 'https://localhost:5601/api/fleet/epm/packages/_bulk_namespace_customization' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --header "kbn-xsrf: true" \
 --data '{"disable":["dev"],"enable":["production","staging"],"packages":["system","nginx"]}'
Request example
{
  "disable": [
    "dev"
  ],
  "enable": [
    "production",
    "staging"
  ],
  "packages": [
    "system",
    "nginx"
  ]
}
Response examples (200)
{
  "items": [
    {
      "name": "system",
      "namespace_customization_enabled_for": [
        "production",
        "staging"
      ],
      "success": true
    },
    {
      "error": "Package nginx is not installed",
      "name": "nginx",
      "success": false
    }
  ]
}
Response examples (400)
{
  "error": "Bad Request",
  "message": "Namespaces must not appear in both enable and disable: production",
  "statusCode": 400
}