---
type: api
title: Upgrade a Deployment to a new Elastic Stack version
description: Important: This API is currently in Tech Preview. While available for use, it is subject to change. Upgrades all resources (Elasticsearch, Kibana, APM, Enterprise Search, etc.) in the deployment to the specified Elastic Stack version. Both the current deployment version and the target version must be >= 8.0.0.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/cloud/operation/operation-upgrade-deployment
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/cloud/operation/operation-upgrade-deployment
products:
  - Elastic Cloud Hosted
---

# Upgrade a Deployment to a new Elastic Stack version

Availability:

- Server: `https://api.elastic-cloud.com/api/v1`

## Paths

- `POST` `/deployments/{deployment_id}/upgrade`

#### Path Parameters

- `deployment_id` (string)
  Identifier for the Deployment

## Description

Important: This API is currently in Tech Preview. While available for use, it is subject to change. Upgrades all resources (Elasticsearch, Kibana, APM, Enterprise Search, etc.) in the deployment to the specified Elastic Stack version. Both the current deployment version and the target version must be >= 8.0.0.

## Request Body

`application/json`

Target version must be >= 8.0.0.

- `target_version` (string) — required
  Target Elastic Stack version to which to upgrade

## Responses

#### `202`

Deployment upgrade initiated successfully

`application/json`

Type: `EmptyResponse`

#### `400`

* The specified version is invalid or not available. (code: `deployments.invalid_version`)
* The target version must be >= 8.0.0. (code: `deployments.upgrade.target_version_must_be_above_8_0_0`)
* The current deployment version must be >= 8.0.0. (code: `deployments.upgrade.source_version_must_be_above_8_0_0`)
* The target version must be greater than the current deployment version. (code: `deployments.upgrade_path_not_allowed`)

`application/json`

- `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

#### `404`

The Deployment specified by {deployment_id} cannot be found. (code: `deployments.deployment_not_found`)

`application/json`

- `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

#### `409`

A resource in the deployment has a failed last plan attempt. Resolve it before upgrading. (code: `deployments.upgrade_deployment_resource_last_plan_failed`)

`application/json`

- `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

#### `500`

Failed to upgrade the deployment. (code: `deployments.upgrade_internal_error`)

`application/json`

- `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 /deployments/{deployment_id}/upgrade
```

#### curl

```curl
curl -X POST "https://api.elastic-cloud.com/api/v1/deployments/{deployment_id}/upgrade"
```

