SDK reference
Environment variables and secrets
GET/
Lists the Serverless App Service's variables, and shared: the organization's shared variables (a Serverless App Service variable with the same key replaces a shared one per environment). Values of sensitive variables are null.
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/projects/{projectId}/env' \
-H "Authorization: Bearer $CACTIVE_TOKEN"GET/
One environment's variables as a deployment gets them (shared ones overridden by the Serverless App Service's), for local development (cactive env pull, cactive dev). Sensitive values are null, except development-only secrets marked devReadable when the caller has env:write (audited as env.reveal).
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/projects/{projectId}/env/values' \
-H "Authorization: Bearer $CACTIVE_TOKEN"POST/
Creates or replaces many variables at once (e.g. a pasted .env file), all with the same environments and sensitivity. Nothing is written unless every key is valid.
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/projects/{projectId}/env' \
-H "Authorization: Bearer $CACTIVE_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"vars": [
{
"key": "example",
"value": "example"
}
],
"targets": [
"production"
]
}'PUT/
Creates or replaces a variable. Omit value to keep the stored value, for example to change the targets of a sensitive variable.
curl -X PUT 'https://api.cactive.com.au/v1/orgs/{orgId}/projects/{projectId}/env/{key}' \
-H "Authorization: Bearer $CACTIVE_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"targets": [
"production"
]
}'DELETE/
Deletes a variable. Running deployments keep the value they started with.
Parameters and answerscurl -X DELETE 'https://api.cactive.com.au/v1/orgs/{orgId}/projects/{projectId}/env/{key}' \
-H "Authorization: Bearer $CACTIVE_TOKEN"GET/
Reads a value back (version: an earlier one). Sensitive values only as their access rule allows; audited.
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/projects/{projectId}/env/{key}/value' \
-H "Authorization: Bearer $CACTIVE_TOKEN"GET/
The versions kept (when each was set and by whom), newest first.
Parameters and answerscurl 'https://api.cactive.com.au/v1/orgs/{orgId}/projects/{projectId}/env/{key}/versions' \
-H "Authorization: Bearer $CACTIVE_TOKEN"POST/
Sets an earlier value again, as a new version. Takes effect on the next deployment.
Parameters and answerscurl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/projects/{projectId}/env/{key}/versions/{version}/restore' \
-H "Authorization: Bearer $CACTIVE_TOKEN"PUT/
A rotation reminder and who may read the value back.
Parameters and answerscurl -X PUT 'https://api.cactive.com.au/v1/orgs/{orgId}/projects/{projectId}/env/{key}/settings' \
-H "Authorization: Bearer $CACTIVE_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"rotateEveryDays": 1,
"access": {
"roles": [],
"teams": [],
"ownersOnly": true
}
}'GET/
Lists the organization's shared variables. Sensitive values are null.
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/env' \
-H "Authorization: Bearer $CACTIVE_TOKEN"POST/
Creates or replaces many shared variables at once, all with the same environments and sensitivity.
Parameters and answerscurl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/env' \
-H "Authorization: Bearer $CACTIVE_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"vars": [
{
"key": "example",
"value": "example"
}
],
"targets": [
"production"
]
}'PUT/
Creates or replaces a shared variable. Omit value to keep the stored one.
curl -X PUT 'https://api.cactive.com.au/v1/orgs/{orgId}/env/{key}' \
-H "Authorization: Bearer $CACTIVE_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"targets": [
"production"
]
}'DELETE/
Deletes a shared variable. Serverless App Services' own variables with the same key are unaffected.
Parameters and answerscurl -X DELETE 'https://api.cactive.com.au/v1/orgs/{orgId}/env/{key}' \
-H "Authorization: Bearer $CACTIVE_TOKEN"GET/
Reads a value back (version: an earlier one). Sensitive values only as their access rule allows; audited.
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/env/{key}/value' \
-H "Authorization: Bearer $CACTIVE_TOKEN"GET/
The versions kept (when each was set and by whom), newest first.
Parameters and answerscurl 'https://api.cactive.com.au/v1/orgs/{orgId}/env/{key}/versions' \
-H "Authorization: Bearer $CACTIVE_TOKEN"POST/
Sets an earlier value again, as a new version. Takes effect on the next deployment.
Parameters and answerscurl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/env/{key}/versions/{version}/restore' \
-H "Authorization: Bearer $CACTIVE_TOKEN"PUT/
A rotation reminder and who may read the value back.
Parameters and answerscurl -X PUT 'https://api.cactive.com.au/v1/orgs/{orgId}/env/{key}/settings' \
-H "Authorization: Bearer $CACTIVE_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"rotateEveryDays": 1,
"access": {
"roles": [],
"teams": [],
"ownersOnly": true
}
}'GET/
Every secret in the organization (shared ones and each Serverless App Service's sensitive variables): key, targets, current version, last change and by whom, rotation reminder and when it's due, and the access rule. Never values. Also limit, the plan's secretsMax. Needs env:read.
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/secrets' \
-H "Authorization: Bearer $CACTIVE_TOKEN"