ENDPOINT | PATCH
Set variables
Sets and removes variables; the app restarts with them. A value can be an organisation secret's reference (CLOVERR_SEC_STRIPE). Needs Manage.
PATCHhttps://api.cloverr.co.uk/v1/cloud-instances/{id}/env
Scope: cloudSuccess: 200120 requests a minute per token
Path parameters
iduuidrequiredThe instance.Body (JSON)
setobjectNAME: value pairs.unsetstring[]Names to remove.Example request & response
Send your token in the Authorization header. A successful response wraps the result in data.
curl -X PATCH https://api.cloverr.co.uk/v1/cloud-instances/3f6c1d2e-8a4b-4c1d-9e2f-5a6b7c8d9e0f/env \
-H "Authorization: Bearer $CLOVERR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"set":{"API_KEY":"CLOVERR_SEC_STRIPE","NODE_ENV":"production"},"unset":["OLD_FLAG"]}'200 · JSON
{
"data": {
"id": "3f6c1d2e-8a4b-4c1d-9e2f-5a6b7c8d9e0f",
"names": [
"API_KEY",
"NODE_ENV"
]
}
}Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_name | A name that can't be set (PORT, DATA_DIR, PUBLIC_URL…). |
| 401 | unauthorized | No token, or it's invalid, expired, revoked, or its owner left the organisation. |
| 403 | forbidden | The token doesn't have this endpoint's scope. |
| 403 | ip_not_allowed | The token only works from listed addresses, and this request came from another. |
| 403 | two_factor_required | The organisation requires login verification and the token's owner hasn't set it up. |
| 429 | rate_limited | More than 120 requests in a minute with this token. Wait for Retry-After. |
| 500 | server_error | Something went wrong on our side. Safe to retry. |
Errors look like { "error": { "code", "message" } }. All error codes.