Environments
Update an environment
Replace an API-managed environment definition.
TypeScript SDKThe npm client, generated from the API spec.Python SDKThe PyPI client, sync and async.
| Method | Path | Required permissions |
|---|---|---|
| PUT | /v1/environments/{environment_id} | write:environments |
Token access
- API key
- Supported.
- CLI user token
- Supported.
- Sandbox token
- Unavailable. Not supported by sandbox tokens, even with permissions.ellipsis enabled.
Higher permission levels include lower levels: read < write < delete.
Git-managed definitions must be edited in their repository.
Path parameters
environment_idstringrequired
curl -X PUT "https://api.ellipsis.dev/v1/environments/{environment_id}" \
-H "Authorization: Bearer $ELLIPSIS_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"environment": {
"ellipsis": {
"kind": "environment",
"name": "api-environment",
"metadata": {
"labels": [],
"annotations": {}
}
},
"repositories": [
{
"name": "api-repo"
}
],
"compute": {},
"hooks": {},
"mcp_servers": [],
"variables": []
}
}'import os
from ellipsis import Ellipsis
from ellipsis import models
client = Ellipsis(api_key=os.environ["ELLIPSIS_API_TOKEN"])
request = models.UpdateEnvironmentRequest.model_validate(
{
"environment": {
"ellipsis": {
"kind": "environment",
"name": "api-environment",
"metadata": {
"labels": [],
"annotations": {}
}
},
"repositories": [
{
"name": "api-repo"
}
],
"compute": {},
"hooks": {},
"mcp_servers": [],
"variables": []
}
}
)
result = client.environments.update(
"api-environment",
request.environment,
)
print(result)import { Ellipsis } from '@ellipsis-dev/sdk';
const client = new Ellipsis({
apiKey: process.env.ELLIPSIS_API_TOKEN!,
});
const request: Parameters<typeof client.environments.update>[1] = {
"environment": {
"ellipsis": {
"kind": "environment",
"name": "api-environment",
"metadata": {
"labels": [],
"annotations": {}
}
},
"repositories": [
{
"name": "api-repo"
}
],
"compute": {},
"hooks": {},
"mcp_servers": [],
"variables": []
}
};
const result = await client.environments.update("api-environment", request);
console.log(result);Request
Example request body
{
}
Body parameters
environmentEnvironmentDocument-Inputrequired
The environment's new definition. Replaces the previous one wholesale , this is not a partial update.
Response
Example response, 200
{
}