environments
Get environment
Changed onRetrieve a single environment by its id.
Use this to fetch environment details after creation or to verify an environment exists before performing operations.
Required Permissions
Your root key must have one of the following permissions:
- environment.*.read_environment (to read any environment)
- environment.<environment_id>.read_environment (to read a specific environment)
post/v2/environments.getEnvironment
Request
- Base URLhttps://api.unkey.com
- URLhttps://api.unkey.com/v2/environments.getEnvironment
- AuthHTTP bearer
Request body
Example request
{
"project": "proj_1234abcd",
"app": "proj_1234abcd",
"environment": "proj_1234abcd"
}Response
Successfully retrieved the environment.
Example response
{
"meta": {
"requestId": "req_123"
},
"data": {
"id": "env_1234abcd",
"slug": "production",
"description": "Production environment",
"kind": "production",
"createdAt": 1704067200000,
"updatedAt": 1704153600000,
"runtime": {
"port": 8080,
"vCpus": 0.25,
"memoryMib": 256,
"command": [
"node",
"server.js"
],
"healthcheck": {
"method": "GET",
"path": "/healthz",
"intervalSeconds": 10,
"timeoutSeconds": 2,
"failureThreshold": 3,
"initialDelaySeconds": 5
},
"shutdownSignal": "SIGTERM",
"upstreamProtocol": "http1",
"openapiSpecPath": "/openapi.yaml"
},
"build": {
"dockerfile": "Dockerfile",
"rootDirectory": ".",
"buildCommand": "pnpm --filter api build",
"watchPaths": [
"src/**"
],
"autoDeploy": true
},
"regions": [
{
"name": "us-east-1",
"replicas": {
"min": 1,
"max": 3
}
}
]
}
}Changes
- info
added the required property
/to the response with the status
- info
- info
the endpoint scheme security
bearerwas added to the API - info
the endpoint scheme security
rootKeywas removed from the API
- info