Skip to content
Hoody.com

Use these endpoints to read and modify the environment variables exposed to a running container. All operations authenticate with a JWT bearer token and act on a single container identified by {id}.

Each value has a max length of 32,768 characters. Keys must match the pattern ^[a-zA-Z_][a-zA-Z0-9_]*$ and must not start with the reserved HOODY_ prefix. Writes are mirrored to /etc/environment (visible on the next PAM/SSH login) and applied to the container runtime environment (visible to new exec/console sessions). Processes that are already running do not pick up the change until they re-exec.

Get all environment variables for a container.

NameInTypeRequiredDescription
idpathstringYesContainer ID
{
"statusCode": 200,
"message": "Environment variables retrieved",
"data": {
"environment_vars": {
"NODE_ENV": "production",
"DATABASE_URL": "postgres://user:pass@db.example.com:5432/app",
"LOG_LEVEL": "info",
"FEATURE_FLAGS": "new-dashboard,beta-search"
}
}
}
Error CodeTitleDescriptionResolution
MISSING_TOKENAuthentication token missingNo authentication token was provided in the requestInclude a valid JWT token in the Authorization header as Bearer <token>
RESOURCE_ACCESS_DENIEDResource access deniedYou do not have permission to access this specific resourceEnsure you own this resource or have been granted access by the owner
CONTAINER_NOT_FOUNDContainer not foundThe requested container does not exist or you do not have permission to access it.Verify the container ID is correct and that you have access to the project it belongs to.
Terminal window
curl -X GET 'https://api.hoody.com/api/v1/containers/{id}/env' \
-H 'Authorization: Bearer <token>'

Merge environment variables into the container. Existing keys are updated and new keys are added; keys not present in the body are left unchanged (merge semantics). Keys starting with HOODY_ are reserved and are rejected.

NameInTypeRequiredDescription
idpathstringYesContainer ID

The body is a JSON object whose entries are the variable keys and string values. Constraints:

  • Object keys must match ^[a-zA-Z_][a-zA-Z0-9_]*$, must be 1 to 256 characters, and must not start with HOODY_.
  • Each value is a string with a max length of 32,768 characters.
  • The object must contain between 1 and 200 properties.
{
"NODE_ENV": "production",
"DATABASE_URL": "postgres://user:pass@db.example.com:5432/app",
"REDIS_URL": "redis://cache.internal:6379/0",
"FEATURE_FLAGS": "new-dashboard,beta-search"
}
{
"statusCode": 200,
"message": "Environment variables updated",
"data": {
"environment_vars": {
"NODE_ENV": "production",
"DATABASE_URL": "postgres://user:pass@db.example.com:5432/app",
"REDIS_URL": "redis://cache.internal:6379/0",
"FEATURE_FLAGS": "new-dashboard,beta-search"
},
"synced": true
}
}
Error CodeTitleDescriptionResolution
VALIDATION_ERRORInvalid input parametersOne or more request parameters failed validationCheck the error message for specific field requirements and correct your input
INVALID_ENV_KEYInvalid Environment Variable KeyThe environment variable key is invalid. Keys must start with a letter or underscore, contain only alphanumeric characters and underscores, and must not start with the reserved HOODY_ prefix.Use a key that matches [a-zA-Z_][a-zA-Z0-9_]* and does not start with HOODY_.
RESERVED_ENV_PREFIXReserved Environment Variable PrefixEnvironment variable keys starting with HOODY_ are reserved for system use and cannot be set or deleted by users.Use a different key name that does not start with HOODY_.
MISSING_TOKENAuthentication token missingNo authentication token was provided in the requestInclude a valid JWT token in the Authorization header as Bearer <token>
RESOURCE_ACCESS_DENIEDResource access deniedYou do not have permission to access this specific resourceEnsure you own this resource or have been granted access by the owner
CONTAINER_NOT_FOUNDContainer not foundThe requested container does not exist or you do not have permission to access it.Verify the container ID is correct and that you have access to the project it belongs to.
Terminal window
curl -X PUT 'https://api.hoody.com/api/v1/containers/{id}/env' \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{
"NODE_ENV": "production",
"DATABASE_URL": "postgres://user:pass@db.example.com:5432/app",
"REDIS_URL": "redis://cache.internal:6379/0"
}'

Set or update a single environment variable on the container. Keys starting with HOODY_ are reserved and are rejected.

NameInTypeRequiredDescription
idpathstringYesContainer ID
keypathstringYesEnvironment variable key
NameTypeRequiredDescription
valuestringYesValue for the environment variable. Max 32,768 characters.
{
"value": "postgres://user:pass@db.example.com:5432/app"
}
{
"statusCode": 200,
"message": "Environment variable updated",
"data": {
"environment_vars": {
"DATABASE_URL": "postgres://user:pass@db.example.com:5432/app"
},
"synced": true
}
}
Error CodeTitleDescriptionResolution
VALIDATION_ERRORInvalid input parametersOne or more request parameters failed validationCheck the error message for specific field requirements and correct your input
INVALID_ENV_KEYInvalid Environment Variable KeyThe environment variable key is invalid. Keys must start with a letter or underscore, contain only alphanumeric characters and underscores, and must not start with the reserved HOODY_ prefix.Use a key that matches [a-zA-Z_][a-zA-Z0-9_]* and does not start with HOODY_.
RESERVED_ENV_PREFIXReserved Environment Variable PrefixEnvironment variable keys starting with HOODY_ are reserved for system use and cannot be set or deleted by users.Use a different key name that does not start with HOODY_.
MISSING_TOKENAuthentication token missingNo authentication token was provided in the requestInclude a valid JWT token in the Authorization header as Bearer <token>
RESOURCE_ACCESS_DENIEDResource access deniedYou do not have permission to access this specific resourceEnsure you own this resource or have been granted access by the owner
CONTAINER_NOT_FOUNDContainer not foundThe requested container does not exist or you do not have permission to access it.Verify the container ID is correct and that you have access to the project it belongs to.
Terminal window
curl -X PUT 'https://api.hoody.com/api/v1/containers/{id}/env/DATABASE_URL' \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{
"value": "postgres://user:pass@db.example.com:5432/app"
}'

Remove a single environment variable from the container. The operation is idempotent and returns 200 whether the key existed or not. Keys starting with HOODY_ are reserved and cannot be deleted.

NameInTypeRequiredDescription
idpathstringYesContainer ID
keypathstringYesEnvironment variable key
{
"statusCode": 200,
"message": "Environment variable deleted",
"data": {
"environment_vars": {
"NODE_ENV": "production",
"LOG_LEVEL": "info"
},
"synced": true
}
}
Error CodeTitleDescriptionResolution
RESERVED_ENV_PREFIXReserved Environment Variable PrefixEnvironment variable keys starting with HOODY_ are reserved for system use and cannot be set or deleted by users.Use a different key name that does not start with HOODY_.
MISSING_TOKENAuthentication token missingNo authentication token was provided in the requestInclude a valid JWT token in the Authorization header as Bearer <token>
RESOURCE_ACCESS_DENIEDResource access deniedYou do not have permission to access this specific resourceEnsure you own this resource or have been granted access by the owner
CONTAINER_NOT_FOUNDContainer not foundThe requested container does not exist or you do not have permission to access it.Verify the container ID is correct and that you have access to the project it belongs to.
Terminal window
curl -X DELETE 'https://api.hoody.com/api/v1/containers/{id}/env/DATABASE_URL' \
-H 'Authorization: Bearer <token>'