Experiment Management API Deployment Endpoints

Name
Description
List deployments List deployments that experiments or flags can be assigned to.
Create deployment Create a deployment.
Edit deployment Edit a deployment.

List deployments

1GET 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 The max number of deployments to be returned. Capped at 1000.
cursor The offset to start the "page" of results from.

Response

A successful request returns a 200 OK response and a list of deployments encoded as JSON in the response body.

Request

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

Response

1{
2 "deployments": [
3 {
4 "id": <id>,
5 "projectId": <projectId>,
6 "label": "deployment-1",
7 "key": <key>,
8 "deleted": true
9 },
10 {
11 "id": <id>,
12 "projectId": <projectId>,
13 "label": "deployment-2",
14 "key": <key>,
15 "deleted": false
16 }
17 ]
18}

Create deployment

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

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

Query parameters

Name Description
projectId Required
label Required
type Required

Request

1{
2 "projectId":"<projectId>",
3 "label": "hello-world",
4 "type": "client"
5}

Response

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

Request

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

Exampl

1{
2 "id": <id>
3}

Edit deployment

1PATCH 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
archive Optional

Request

1{
2 "label": "updated-label"
3}

Response

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

Request

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

Was this page helpful?

Thanks for your feedback!

June 4th, 2024

Need help? Contact Support

Visit Amplitude.com

Have a look at the Amplitude Blog

Learn more at Amplitude Academy

© 2024 Amplitude, Inc. All rights reserved. Amplitude is a registered trademark of Amplitude, Inc.