environments
Update environment settings
Changed onUpdate the build, runtime, and regional settings for an environment.
All settings fields are optional. Omit a field to leave it unchanged. For nullable fields (dockerfile, healthcheck, openapiSpecPath), send null to clear the value. When regions is present it replaces the full set of regions for the environment.
Required Permissions
Your root key must have one of the following permissions:
- environment.*.update_environment (to update any environment)
- environment.<environment_id>.update_environment (to update a specific environment)
post/v2/environments.updateSettings
Request
- Base URLhttps://api.unkey.com
- URLhttps://api.unkey.com/v2/environments.updateSettings
- AuthHTTP bearer
Request body
Example request
{
"project": "proj_1234abcd",
"app": "proj_1234abcd",
"environment": "proj_1234abcd",
"dockerfile": "./Dockerfile",
"rootDirectory": ".",
"buildCommand": "pnpm --filter api build",
"autoDeploy": true,
"port": 8080,
"vCpus": 1,
"memoryMib": 512,
"storageMib": 1024,
"healthcheck": {
"method": "GET",
"path": "/healthz",
"intervalSeconds": 10,
"timeoutSeconds": 2,
"failureThreshold": 3,
"initialDelaySeconds": 5
},
"shutdownSignal": "SIGTERM",
"upstreamProtocol": "http1",
"openapiSpecPath": "/openapi.yaml",
"regions": [
{
"name": "us-east-1",
"replicas": {
"min": 1,
"max": 3
}
}
]
}Response
Successfully updated the environment settings.
Example response
{
"meta": {
"requestId": "req_123"
}
}Changes
- info
the endpoint scheme security
bearerwas added to the API - info
the endpoint scheme security
rootKeywas removed from the API
- info
- warning
removed the request property
- info
added the new optional request property
- warning