Skip to content

Set (upsert) one environment variable on the app

PUT
/api/workspaces/{workspaceId}/apps/{id}/env
curl --request PUT \
--url http://localhost:8080/api/workspaces/example/apps/example/env \
--header 'Content-Type: application/json' \
--cookie auth_session=<auth_session> \
--data '{ "key": "example", "value": "example", "secret": false }'

Values are encrypted at rest. secret: true keeps the value out of the publish build and forbids the VITE_ prefix (Vite inlines VITE_* into the public bundle). A running dev server picks the change up on its next restart.

workspaceId
required
string
id
required
string
Media typeapplication/json
object
key
required
string
>= 1 characters <= 128 characters
value
required
string
<= 8192 characters
secret
boolean

Successful response

Media typeapplication/json
object
success

Whether the request succeeded.

boolean
data

Endpoint-specific response payload.

message
string
error
string

Example

{
"message": "Operation completed",
"error": "Error message"
}

Invalid request

Media typeapplication/json
object
success
boolean
error
string

Example

{
"error": "Error message"
}

Internal server error

Media typeapplication/json
object
success
boolean
error
string

Example

{
"error": "Error message"
}