Environments
Update an environment
PUT /v1/environments/{environment_id}- Permission
write:environments- Tokens
- API key, CLI user token
Replace an API-managed environment definition. Git-managed definitions must be edited in their repository.
Path parameters
environment_idstringrequired
{
}
{
}
1
import os
2
3
from ellipsis import Ellipsis
4
from ellipsis import models
5
6
client = Ellipsis(api_key=os.environ["ELLIPSIS_API_TOKEN"])
7
8
request = models.UpdateEnvironmentRequest.model_validate(
9
{
10
"environment": {
11
"ellipsis": {
12
"kind": "environment",
13
"name": "api-environment",
14
"metadata": {
15
"labels": [],
16
"annotations": {}
17
}
18
},
19
"repositories": [
20
{
21
"name": "api-repo"
22
}
23
],
24
"compute": {},
25
"hooks": {},
26
"mcp_servers": [],
27
"variables": []
28
}
29
}
30
)
31
32
result = client.environments.update(
33
"api-environment",
34
request.environment,
35
)
36
print(result)
1
import { Ellipsis } from '@ellipsis-dev/sdk';
2
3
const client = new Ellipsis({
4
apiKey: process.env.ELLIPSIS_API_TOKEN!,
5
});
6
7
const request: Parameters<typeof client.environments.update>[1] = {
8
"environment": {
9
"ellipsis": {
10
"kind": "environment",
11
"name": "api-environment",
12
"metadata": {
13
"labels": [],
14
"annotations": {}
15
}
16
},
17
"repositories": [
18
{
19
"name": "api-repo"
20
}
21
],
22
"compute": {},
23
"hooks": {},
24
"mcp_servers": [],
25
"variables": []
26
}
27
};
28
29
const result = await client.environments.update("api-environment", request);
30
console.log(result);
1
curl -X PUT "https://api.ellipsis.dev/v1/environments/{environment_id}" \
2
-H "Authorization: Bearer $ELLIPSIS_API_TOKEN" \
3
-H "Content-Type: application/json" \
4
-d '{
5
"environment": {
6
"ellipsis": {
7
"kind": "environment",
8
"name": "api-environment",
9
"metadata": {
10
"labels": [],
11
"annotations": {}
12
}
13
},
14
"repositories": [
15
{
16
"name": "api-repo"
17
}
18
],
19
"compute": {},
20
"hooks": {},
21
"mcp_servers": [],
22
"variables": []
23
}
24
}'
Request
environmentEnvironmentDocument-Inputrequired
The environment's new definition. Replaces the previous one wholesale , this is not a partial update.
Response
environmentEnvironmentrequired
The saved environment.