POST/services/{uuid}/envs

Create a service environment variable

Creates an environment variable for a service. Supply key and value along with any flags that configure how the variable is used or displayed. A successful response returns the new variable's UUID.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 parameter · 6 body fields
uuidstringrequired
The UUID of the service to add the environment variable to.

Environment variable details to create.

is_literalbooleanoptional
The flag to indicate if the environment variable is a literal, nothing espaced.
is_multilinebooleanoptional
The flag to indicate if the environment variable is multiline.
is_previewbooleanoptional
The flag to indicate if the environment variable is used in preview deployments.
is_shown_oncebooleanoptional
If true, the saved value is hidden in the UI and API responses. MCP never returns environment variable values.
keystringoptional
The key of the environment variable.
valuestringoptional
The value of the environment variable.

5 status codes
201Returns an object containing the UUID of the created environment variable.
uuidstringoptional
400Returned when the token is invalid.
messagestringoptional
401Returned when the request is unauthenticated.
messagestringoptional
404Returned when the service resource is not found.
messagestringoptional
422Returned when the request fails validation.
errorsobjectoptional
messagestringoptional

Error handling

A 400 indicates an invalid token, and a 401 indicates an unauthenticated request. A 404 indicates the service resource was not found; the uuid path parameter must identify an existing service. A 422 indicates validation errors; check the reported field errors.