List Vars
GET /variables/
Responses
- 200 list[VarOut]
- 401 no key, or a key that was revoked
- 403 the key lacks the permission
Example request
curl -X GET "$API/variables/" \
-H "Authorization: Bearer $LH_API_KEY"
Environment variables for one site, or shared by every site. Secret values are never returned.
Every call needs Authorization: Bearer lh_… unless marked No key needed; the example uses $API for https://api.localhost.co.zw and $LH_API_KEY for your key. A * marks a required field.
GET /variables/
curl -X GET "$API/variables/" \
-H "Authorization: Bearer $LH_API_KEY"
PUT /variables/{key}
| Name | Type | Notes |
|---|---|---|
| key * in path | string |
| Name | Type | Notes |
|---|---|---|
| value | string | null | |
| secret | boolean | null | |
| build_time | boolean | null | |
| production_only | boolean | null | |
| only_sites | list[string] | null | |
| note | string | null |
curl -X PUT "$API/variables/<key>" \
-H "Authorization: Bearer $LH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"value": "<value>",
"secret": true,
"build_time": true,
"production_only": true,
"only_sites": [
"<only_sites>"
],
"note": "<note>"
}'
DELETE /variables/{key}
| Name | Type | Notes |
|---|---|---|
| key * in path | string |
curl -X DELETE "$API/variables/<key>" \
-H "Authorization: Bearer $LH_API_KEY"
GET /sites/{slug}/env
Everything the site's app gets, with where each value comes from. Secrets are masked.
| Name | Type | Notes |
|---|---|---|
| slug * in path | string |
curl -X GET "$API/sites/<slug>/env" \
-H "Authorization: Bearer $LH_API_KEY"
PUT /sites/{slug}/env/{key}
Add or change one of the site's own settings. The site restarts with it without going offline.
| Name | Type | Notes |
|---|---|---|
| slug * in path | string | |
| key * in path | string |
| Name | Type | Notes |
|---|---|---|
| value | string | null | |
| secret | boolean | null | |
| build_time | boolean | null | |
| production_only | boolean | null | |
| only_sites | list[string] | null | |
| note | string | null |
curl -X PUT "$API/sites/<slug>/env/<key>" \
-H "Authorization: Bearer $LH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"value": "<value>",
"secret": true,
"build_time": true,
"production_only": true,
"only_sites": [
"<only_sites>"
],
"note": "<note>"
}'
DELETE /sites/{slug}/env/{key}
| Name | Type | Notes |
|---|---|---|
| slug * in path | string | |
| key * in path | string |
curl -X DELETE "$API/sites/<slug>/env/<key>" \
-H "Authorization: Bearer $LH_API_KEY"
The objects these endpoints send and receive.
| Name | Type | Notes |
|---|---|---|
| value | string | null | |
| secret | boolean | null | |
| build_time | boolean | null | |
| production_only | boolean | null | |
| only_sites | list[string] | null | |
| note | string | null |
| Name | Type | Notes |
|---|---|---|
| key * | string | |
| value * | string | |
| secret * | boolean | |
| source * | string | |
| build_time | boolean | default false |
| production_only | boolean | default false |
| only_sites | list[string] | default [] |
| overrides | string | default "" |