
| Name                                    | Description                                                    |
| --------------------------------------- | -------------------------------------------------------------- |
| [List deployments](#list-deployments)   | List deployments that experiments or flags can be assigned to. |
| [Create deployment](#create-deployment) | Create a deployment.                                           |
| [Edit deployment](#edit-deployment)     | Edit a deployment.                                             |

{% callout type="note" heading="EU data residency" %}
The examples on this page use the default base URL `https://experiment.amplitude.com`. If your project uses Amplitude's EU data center, use `https://experiment.eu.amplitude.com` instead. For more information, refer to [Regions](/docs/apis/experiment/experiment-management-api#regions).
{% /callout %}

## List deployments

```bash
GET https://experiment.amplitude.com/api/1/deployments
```

Fetch a list of deployments that experiments or flags can be assigned to.

### Query parameters

| Name     | Description                                                                             |
| -------- | --------------------------------------------------------------------------------------- |
| `limit`  | Optional. Type: `number`. The max number of deployments to be returned. Capped at 1000. |
| `cursor` | Optional. Type: `number`. The offset to start the "page" of results from.               |

### Response

A successful request returns a `200 OK` response with a JSON-encoded list of deployments in the response body.

{% callout type="example" heading="Request" %}

```curl
curl --request GET \
    --url 'https://experiment.amplitude.com/api/1/deployments?limit=1000' \
    --header 'Accept: application/json' \
    --header 'Authorization: Bearer <management-api-key>'
```

{% /callout %}

{% callout type="example" heading="Response" %}

```json
    {
        "deployments": [
            {
                "id": <id>,
                "projectId": <projectId>,
                "label": "deployment-1",
                "key": <key>,
                "deleted": true
            },
            {
                "id": <id>,
                "projectId": <projectId>,
                "label": "deployment-2",
                "key": <key>,
                "deleted": false
            }
        ]
    }
```

{% /callout %}

## Create deployment

```bash
POST https://experiment.amplitude.com/api/1/deployments
```

Create a deployment that experiments or flags can be assigned to.

### Query parameters

| Name        | Description                                                                                         |
| ----------- | --------------------------------------------------------------------------------------------------- |
| `projectId` | Required. Type: `string`. The project's ID.                                                         |
| `label`     | Required. Type: `string`. Deployment's label. Must contain alphanumeric and/or `_`, `-` characters. |
| `type`      | Required. Type: `string`. Deployment's type. Must be either `client` or `server`.                   |

{% callout type="example" heading="Request" %}

```json
{
  "projectId": "<projectId>",
  "label": "hello-world",
  "type": "client"
}
```

{% /callout %}

### Response

A successful request returns a `200 OK` response and the deployment's `id`.

{% callout type="example" heading="Request" %}

```curl
curl --request POST \
    --url 'https://experiment.amplitude.com/api/1/deployments' \
    --header 'Accept: application/json' \
    --header 'Authorization: Bearer <management-api-key>'
```

{% /callout %}

{% callout type="example" heading="" %}

```json
    {
        "id": <id>
    }
```

{% /callout %}

## Edit deployment

```bash
PATCH https://experiment.amplitude.com/api/1/deployments/<id>
```

Edit a deployment that experiments or flags can be assigned to.

### Query parameters

| Name      | Description                                                                                         |
| --------- | --------------------------------------------------------------------------------------------------- |
| `label`   | Optional. Type: `string`. Deployment's label. Must contain alphanumeric and/or `_`, `-` characters. |
| `archive` | Optional. Type: `boolean`. Soft-delete or restore the deployment.                                   |

{% callout type="example" heading="Request" %}

```json
{
  "label": "updated-label"
}
```

{% /callout %}

### Response

A successful request returns a `200 OK` response and `OK` text.

{% callout type="example" heading="Request" %}

```curl
curl --request PATCH \
    --url 'https://experiment.amplitude.com/api/1/deployments/<id>' \
    --header 'Accept: application/json' \
    --header 'Authorization: Bearer <management-api-key>'
```

{% /callout %}
