Skip to main content
POST
/
v1
/
apps
/
{id}
/
envs
Create or Edit Application Environment Variables
curl --request POST \
  --url https://api.vertracloud.app/v1/apps/{id}/envs \
  --header 'Content-Type: application/json' \
  --data '
{
  "environments": [
    {}
  ]
}
'
{
  "response": [
    {
      "id": "env123",
      "key": "API_KEY",
      "value": "secret123",
      "note": "API key for external service",
      "created_at": "2026-03-14T19:58:00Z"
    },
    {
      "id": "env456",
      "key": "DATABASE_URL",
      "value": "mysql://user:pass@localhost/db",
      "note": null,
      "created_at": "2026-03-14T19:58:00Z"
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.vertracloud.app/llms.txt

Use this file to discover all available pages before exploring further.

id
string
required
The ID of the application to create or update environment variables for. If the application belongs to a workspace, include the workspace_id in the format appId-workspace_id.
environments
array
required
An array of environment variable objects.

Response

response
array
An array of environment variable objects after creation or update.
{
  "response": [
    {
      "id": "env123",
      "key": "API_KEY",
      "value": "secret123",
      "note": "API key for external service",
      "created_at": "2026-03-14T19:58:00Z"
    },
    {
      "id": "env456",
      "key": "DATABASE_URL",
      "value": "mysql://user:pass@localhost/db",
      "note": null,
      "created_at": "2026-03-14T19:58:00Z"
    }
  ]
}

Error Responses

code
string
The error code indicating the reason for failure. Possible values:
  • UNAUTHORIZED: The user is not authenticated or lacks sufficient permissions.
  • FORBIDDEN: The user does not have permission to access the application.
  • APP_NOT_FOUND: The specified application does not exist.
  • INVALID_BODY: The request body is not a valid array or is empty.
  • INVALID_ENVIRONMENT: One or more environment variables are invalid or use forbidden keys.
  • ENV_VARIABLE_TOO_LONG: An environment variable key or value exceeds length limits.
  • ENV_LIMIT_EXCEEDED: The total number of environment variables exceeds the limit of 25.
message
string
A descriptive message providing additional details about the error.
{
  "code": "UNAUTHORIZED"
}