Skip to content

Beta: these docs are still being updated. The next full update is on 18 November at 8 PM UTC. Docs in beta. Full update 18 Nov, 8 PM UTC.

Hoody.com

In the Hub, open Computers and select the computer. In Overview, open Environment variables and choose Edit variables. Add a variable, enter a New value or remove one, then choose Save. Saved values are not shown again.

Use the computer environment variables API to list, merge, set, or delete the API-managed environment variables of a computer.

Variables are persisted to /etc/environment inside the computer, where they are picked up by PAM or SSH on the next login. They are also applied to the computer runtime environment, where they appear in new exec and console sessions. Processes that are already running do not pick up the change until they re-exec.

Every successful response that returns the environment map includes the complete API-managed map in environment_vars, along with a values_redacted flag that says whether the values were shown to you.

Callerenvironment_varsvalues_redacted
Logged-in JWT sessionEvery API-managed key with its valuefalse
Auth token with computers.features.env_valuesEvery API-managed key with its valuefalse
Auth token without computers.features.env_valuesEvery API-managed key, each with the value nulltrue

A redacted response is still a 200, and the set and delete operations still apply the change. Only the returned map hides the values. The permission grants no access on its own: listing requires computers.read, while changing a variable requires computers.update.

The full_access and dev_team templates grant computers.features.env_values; read_only, external_customer, and finance_team do not. The Hoody Agent’s own tokens also hold it, so the agent reads values in your computers.

A computer with no variables returns {}. A redacted list response looks like this:

Media type: application/json

{
"statusCode": 200,
"message": "Environment variables retrieved",
"data": {
"environment_vars": {
"DATABASE_URL": null,
"LOG_LEVEL": null
},
"values_redacted": true,
"env_sync": {
"pending": false,
"revision": 42,
"applied_revision": 42,
"verified_at": "2026-02-15T10:42:13.000Z",
"attempted_at": "2026-02-15T10:42:13.000Z",
"last_error": null,
"exhausted": false
}
}
}

GET /api/v1/computers/{id}/env

Get the computer’s API-managed environment variables and their sync state. This is not the full environment of every process on the computer. The env_sync block reports whether a recent change is still pending, which revision is currently applied, and when the computer last verified it.

NameInTypeRequiredDescription
idpathstringYesComputer ID.

This endpoint does not accept a request body.

Terminal window
curl -X GET "https://api.hoody.com/api/v1/computers/67e89abc123def456789abcd/env" \
-H "Authorization: Bearer $HOODY_TOKEN"

Media type: application/json

{
"statusCode": 200,
"message": "Environment variables retrieved",
"data": {
"environment_vars": {
"DATABASE_URL": "postgres://app:secret@db.internal:5432/app",
"LOG_LEVEL": "info",
"FEATURE_FLAGS": "billing_v2,checkout_v3"
},
"values_redacted": false,
"env_sync": {
"pending": false,
"revision": 42,
"applied_revision": 42,
"verified_at": "2026-02-15T10:42:13.000Z",
"attempted_at": "2026-02-15T10:42:13.000Z",
"last_error": null,
"exhausted": false
}
}
}

PUT /api/v1/computers/{id}/env

Merge multiple environment variables into the computer in one call. Existing keys are updated, new keys are added, and keys not present in the request body are left unchanged.

The body is a flat JSON object where each property is an environment variable name and its value is a non-empty string of 1 to 4096 UTF-8 bytes. A multibyte value can be refused below 4096 characters. Key names must match ^[a-zA-Z_][a-zA-Z0-9_]*$, are at most 128 characters long, and may not start with the reserved HOODY_ prefix. A single request must contain between 1 and 256 properties.

NameInTypeRequiredDescription
idpathstringYesComputer ID.

A flat object of environment variable names to values. Between 1 and 256 entries; each value is a non-empty string of 1 to 4096 UTF-8 bytes. A multibyte value can be refused below 4096 characters.

{
"DATABASE_URL": "postgres://app:secret@db.internal:5432/app",
"LOG_LEVEL": "info",
"FEATURE_FLAGS": "billing_v2,checkout_v3"
}
Terminal window
curl -X PUT "https://api.hoody.com/api/v1/computers/67e89abc123def456789abcd/env" \
-H "Authorization: Bearer $HOODY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"DATABASE_URL": "postgres://app:secret@db.internal:5432/app",
"LOG_LEVEL": "info",
"FEATURE_FLAGS": "billing_v2,checkout_v3"
}'

Media type: application/json

The synced field is true when the change was applied and verified during the request. It is false when no change was detected or application is still pending.

{
"statusCode": 200,
"message": "Environment variables updated",
"data": {
"environment_vars": {
"DATABASE_URL": "postgres://app:secret@db.internal:5432/app",
"LOG_LEVEL": "info",
"FEATURE_FLAGS": "billing_v2,checkout_v3",
"LEGACY_FLAG": "off"
},
"values_redacted": false,
"synced": true,
"env_sync": {
"pending": false,
"revision": 43,
"applied_revision": 43,
"verified_at": "2026-02-15T11:00:00.000Z",
"attempted_at": "2026-02-15T11:00:00.000Z",
"last_error": null,
"exhausted": false
}
}
}

PUT /api/v1/computers/{id}/env/{key}

Set or update one environment variable, identified by key in the path. Use this when you only need to change a single variable without merging into the whole map.

The value field is required and must be a non-empty string of 1 to 4096 UTF-8 bytes. A multibyte value can be refused below 4096 characters. The key must match ^[a-zA-Z_][a-zA-Z0-9_]*$, must be at most 128 characters long, and may not start with the reserved HOODY_ prefix.

NameInTypeRequiredDescription
idpathstringYesComputer ID.
keypathstringYesEnvironment variable key.
FieldTypeRequiredDescription
valuestringYesValue for the environment variable. Must be a non-empty string of 1 to 4096 UTF-8 bytes. A multibyte value can be refused below 4096 characters.
{
"value": "postgres://app:secret@db.internal:5432/app"
}
Terminal window
curl -X PUT "https://api.hoody.com/api/v1/computers/67e89abc123def456789abcd/env/DATABASE_URL" \
-H "Authorization: Bearer $HOODY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"value":"postgres://app:secret@db.internal:5432/app"}'

Media type: application/json

The synced field is true when the change was applied and verified during the request. It is false when no change was detected or application is still pending.

{
"statusCode": 200,
"message": "Environment variable updated",
"data": {
"environment_vars": {
"DATABASE_URL": "postgres://app:secret@db.internal:5432/app",
"LOG_LEVEL": "info"
},
"values_redacted": false,
"synced": true,
"env_sync": {
"pending": false,
"revision": 44,
"applied_revision": 44,
"verified_at": "2026-02-15T11:15:00.000Z",
"attempted_at": "2026-02-15T11:15:00.000Z",
"last_error": null,
"exhausted": false
}
}
}

DELETE /api/v1/computers/{id}/env/{key}

Remove a single environment variable from the computer. The call is idempotent and returns 200 whether or not the key was present. Reserved keys, including those starting with HOODY_, are rejected.

The variable is removed from /etc/environment and from the computer runtime environment. Already-running processes keep their copy of the variable until they re-exec.

NameInTypeRequiredDescription
idpathstringYesComputer ID.
keypathstringYesEnvironment variable key.

This endpoint does not accept a request body.

Terminal window
curl -X DELETE "https://api.hoody.com/api/v1/computers/67e89abc123def456789abcd/env/LEGACY_FLAG" \
-H "Authorization: Bearer $HOODY_TOKEN"

Media type: application/json

The synced field is true when the change was applied and verified during the request. It is false when no change was detected or application is still pending.

{
"statusCode": 200,
"message": "Environment variable deleted",
"data": {
"environment_vars": {
"DATABASE_URL": "postgres://app:secret@db.internal:5432/app",
"LOG_LEVEL": "info"
},
"values_redacted": false,
"synced": true,
"env_sync": {
"pending": false,
"revision": 45,
"applied_revision": 45,
"verified_at": "2026-02-15T11:30:00.000Z",
"attempted_at": "2026-02-15T11:30:00.000Z",
"last_error": null,
"exhausted": false
}
}
}