---
type: api
title: Upload stack pack
description: Creates or updates an Elastic Stack pack and template.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/operation/operation-update-stack-packs
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/operation/operation-update-stack-packs
products:
  - Elastic Cloud Enterprise
---

# Upload stack pack

## Paths

- `POST` `/stack/versions`

- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/authentication#basicauth)
- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/authentication#apikey)

## Description

Creates or updates an Elastic Stack pack and template.
The endpoint supports `multipart/form-data` requests, as well as `application/zip` and `application/octet-stream` requests with a binary body. The maximum size of the payload is 1Mb.
When the archive contains an Elastic Stack configuration that is available through the API, the configuration and template are overwritten.

## Request Body

`multipart/form-data`

- `file` (string) — required
  Zip file that contains one or multiple stack configurations

## Responses

#### `200`

The Elastic Stack pack successfully processed.

`application/json`

- `stacks` ([] StackVersionConfig)
  - `version` (string)
    Stack version
  - `template` ({} StackVersionTemplateInfo)
    The template information for an Elastic Stack version.
    - `template_version` (string)
      Template version
    - `hashes` ([] StackVersionTemplateFileHash)
      Relative paths of files with SHA-256 hashes that contains the template
      - `path` (string)
        File path relative to template's root
      - `hash` (string)
        SHA-256 hash of a file
  - `elasticsearch` ({} StackVersionElasticsearchConfig)
    The Elasticsearch configuration for an Elastic Stack version.
    - `docker_image` (string)
      Docker image for the Elasticsearch
    - `plugins` ([] string)
      List of available plugins
    - `default_plugins` ([] string)
      List of default plugins
    - `blacklist` ([] string)
      List of configuration options that cannot be overridden by user settings
    - `node_types` ([] StackVersionNodeType)
      Node types that are supported by this stack version
      - `node_type` (string)
        Type of the node (master, data, ...)
      - `name` (string)
        Name of the node type
      - `description` (string)
        Description of the node type
      - `settings` (object)
        Settings that are applied to all nodes of this type
      - `capacity_constraints` ({} StackVersionInstanceCapacityConstraint)
        The Elasticsearch instance, Kibana instance, APM Server capacity constraints for an Elastic Stack node type.
        - `min` (integer)
          Min capacity of the instances
        - `max` (integer)
          Max capacity of the instances
      - `compatible_node_types` ([] string)
        Node types that are compatible with this one
      - `mandatory` (boolean)
        Flag to specify a node type is mandatory in a cluster's plan
    - `settings` (object)
      Settings that are applied to all nodes of this type
    - `capacity_constraints` ({} StackVersionInstanceCapacityConstraint)
      The Elasticsearch instance, Kibana instance, APM Server capacity constraints for an Elastic Stack node type.
      - `min` (integer)
        Min capacity of the instances
      - `max` (integer)
        Max capacity of the instances
    - `compatible_node_types` ([] string)
      Node types that are compatible with this one
  - `kibana` ({} StackVersionKibanaConfig)
    The Kibana configuration for an Elastic Stack version.
    - `version` (string)
      Version of Kibana
    - `docker_image` (string)
      Docker image for the kibana
    - `blacklist` ([] string)
      List of configuration options that cannot be overridden by user settings
    - `settings` (object)
      Settings that are applied to all nodes of this type
    - `capacity_constraints` ({} StackVersionInstanceCapacityConstraint)
      The Elasticsearch instance, Kibana instance, APM Server capacity constraints for an Elastic Stack node type.
      - `min` (integer)
        Min capacity of the instances
      - `max` (integer)
        Max capacity of the instances
    - `compatible_node_types` ([] string)
      Node types that are compatible with this one
  - `apm` ({} StackVersionApmConfig)
    The APM Server configuration for an Elastic Stack version.
    - `version` (string)
      Version of APM
    - `docker_image` (string)
      Docker image for the APM
    - `blacklist` ([] string)
      List of configuration options that cannot be overridden by user settings
    - `settings` (object)
      Settings that are applied to all nodes of this type
    - `capacity_constraints` ({} StackVersionInstanceCapacityConstraint)
      The Elasticsearch instance, Kibana instance, APM Server capacity constraints for an Elastic Stack node type.
      - `min` (integer)
        Min capacity of the instances
      - `max` (integer)
        Max capacity of the instances
    - `compatible_node_types` ([] string)
      Node types that are compatible with this one
  - `appsearch` ({} StackVersionAppSearchConfig)
    AppSearch related configuration of an Elastic Stack version
    - `version` (string)
      Version of AppSearch
    - `docker_image` (string)
      Docker image for the AppSearch
    - `blacklist` ([] string)
      List of configuration options that cannot be overridden by user settings
    - `settings` (object)
      Settings that are applied to all nodes of this type
    - `capacity_constraints` ({} StackVersionInstanceCapacityConstraint)
      The Elasticsearch instance, Kibana instance, APM Server capacity constraints for an Elastic Stack node type.
      - `min` (integer)
        Min capacity of the instances
      - `max` (integer)
        Max capacity of the instances
    - `compatible_node_types` ([] string)
      Node types that are compatible with this one
    - `node_types` ([] StackVersionNodeType)
      Node types that are supported by this stack version
      - `node_type` (string)
        Type of the node (master, data, ...)
      - `name` (string)
        Name of the node type
      - `description` (string)
        Description of the node type
      - `settings` (object)
        Settings that are applied to all nodes of this type
      - `capacity_constraints` ({} StackVersionInstanceCapacityConstraint)
        The Elasticsearch instance, Kibana instance, APM Server capacity constraints for an Elastic Stack node type.
        - `min` (integer)
          Min capacity of the instances
        - `max` (integer)
          Max capacity of the instances
      - `compatible_node_types` ([] string)
        Node types that are compatible with this one
      - `mandatory` (boolean)
        Flag to specify a node type is mandatory in a cluster's plan
  - `enterprise_search` ({} StackVersionEnterpriseSearchConfig)
    EnterpriseSearch related configuration of an Elastic Stack version
    - `version` (string)
      Version of EnterpriseSearch
    - `docker_image` (string)
      Docker image for the EnterpriseSearch
    - `blacklist` ([] string)
      List of configuration options that cannot be overridden by user settings
    - `settings` (object)
      Settings that are applied to all nodes of this type
    - `capacity_constraints` ({} StackVersionInstanceCapacityConstraint)
      The Elasticsearch instance, Kibana instance, APM Server capacity constraints for an Elastic Stack node type.
      - `min` (integer)
        Min capacity of the instances
      - `max` (integer)
        Max capacity of the instances
    - `compatible_node_types` ([] string)
      Node types that are compatible with this one
    - `node_types` ([] StackVersionNodeType)
      Node types that are supported by this stack version
      - `node_type` (string)
        Type of the node (master, data, ...)
      - `name` (string)
        Name of the node type
      - `description` (string)
        Description of the node type
      - `settings` (object)
        Settings that are applied to all nodes of this type
      - `capacity_constraints` ({} StackVersionInstanceCapacityConstraint)
        The Elasticsearch instance, Kibana instance, APM Server capacity constraints for an Elastic Stack node type.
        - `min` (integer)
          Min capacity of the instances
        - `max` (integer)
          Max capacity of the instances
      - `compatible_node_types` ([] string)
        Node types that are compatible with this one
      - `mandatory` (boolean)
        Flag to specify a node type is mandatory in a cluster's plan
  - `metadata` ({} StackVersionMetadata)
    The metadata for the Elastic Stack.
    - `notes` (string)
      Notes for administrator
    - `pre_release` (boolean)
      Indicates that the stack pack version is not GA and is not supposed to be used in production
    - `min_platform_version` (string)
      The minimum version of the platform that the stack pack version is compatible with
    - `min_wire_compatibility_version` (string)
      The minimum version required for performing a rolling upgrade to this stack version.
    - `min_index_compatibility_version` (string)
      The minimum version required for performing a full cluster restart upgrade to this stack version.
    - `schema_version` (integer)
      The schema version of the stack pack version
    - `is_fips` (boolean)
      Is this a fips stackpack
  - `deleted` (boolean)
    Identifies that the Elastic Stack version is marked for deletion
  - `upgradable_to` ([] string)
    Stack Versions that this version can upgrade to
  - `min_upgradable_from` (string)
    The minimum version recommended to upgrade this version.
  - `whitelisted` (boolean)
    Whether or not this version is whitelisted. This is only relevant in EC (SaaS) and is not sent in ECE.
  - `accessible` (boolean)
    Whether or not this version is accessible by the calling user. This is only relevant in EC (SaaS) and is not sent in ECE.
  - `rolling_upgrade_compatible_versions` ([] string)
    List of versions that can be upgraded to the current version of the stackpack
- `errors` ([] StackVersionArchiveProcessingError)
  Errors occurred while processing the Elastic Stack pack. Key: stack version, Value: List of errors
  - `stack_version` (string)
    Version of the stack (ie directory name in archive root)
  - `errors` ({} BasicFailedReply)
    - `errors` ([] BasicFailedReplyElement)
      A list of errors that occurred in the failing request
      - `code` (string)
        A structured code representing the error type that occurred
      - `message` (string)
        A human readable message describing the error that occurred
      - `fields` ([] string)
        If the error can be tied to a specific field or fields in the user request, this lists those fields
#### `400`

* There is an error in the file. Choose a different file, then try again. (code: `stackpack.bad_archive`)
* Some unexpected error occurred. (code: `stackpack.unknown_internal_error`)

`application/json`

- `stacks` ([] StackVersionConfig)
  Same fields as `stacks`
- `errors` ([] StackVersionArchiveProcessingError)
  Errors occurred while processing the Elastic Stack pack. Key: stack version, Value: List of errors
  - `stack_version` (string)
    Version of the stack (ie directory name in archive root)
  - `errors` ({} BasicFailedReply)
    - `errors` ([] BasicFailedReplyElement)
      A list of errors that occurred in the failing request
      - `code` (string)
        A structured code representing the error type that occurred
      - `message` (string)
        A human readable message describing the error that occurred
      - `fields` ([] string)
        If the error can be tied to a specific field or fields in the user request, this lists those fields
##### Response Headers

- `x-cloud-error-codes` (enum)
  The error codes associated with the response

## Code Examples

#### Console

```console
POST /stack/versions
```

#### curl

```curl
curl -X POST "/stack/versions"
```

