Coolify logoCoolify
PATCH
/services/{uuid}/envs

Update env by service UUID.

Authorization

bearerAuth
AuthorizationBearer <token>

Go to Keys & Tokens / API tokens and create a new token. Use the token as the bearer token.

In: header

Path Parameters

uuid*string

UUID of the service.

Request Body

application/json

Env updated.

TypeScript Definitions

Use the request body type in TypeScript.

key*string

The key of the environment variable.

value*string

The value of the environment variable.

is_preview?boolean

The flag to indicate if the environment variable is used in preview deployments.

is_literal?boolean

The flag to indicate if the environment variable is a literal, nothing espaced.

is_multiline?boolean

The flag to indicate if the environment variable is multiline.

is_shown_once?boolean

The flag to indicate if the environment variable's value is shown on the UI.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://app.coolify.io/api/v1/services/string/envs" \  -H "Content-Type: application/json" \  -d '{    "key": "string",    "value": "string"  }'
{  "message": "Environment variable updated."}
{  "message": "Invalid token."}
{  "message": "Unauthenticated."}
{  "message": "Resource not found."}
{  "message": "Validation error.",  "errors": {    "name": [      "The name field is required."    ],    "api_url": [      "The api url field is required.",      "The api url format is invalid."    ]  }}