Skip to main content
POST
/
projects
/
{slug}
/
environments
/
{environmentSlug}
/
variables
Create variable
curl --request POST \
  --url https://api.envless.cloud/projects/{slug}/environments/{environmentSlug}/variables \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "DATABASE_URL",
  "value": "v1:5J9k...==",
  "type": "string",
  "isSecret": true
}
'
{
  "success": true,
  "code": 201,
  "message": "Variable created.",
  "data": {
    "id": "<string>",
    "name": "<string>",
    "value": "<string>",
    "type": "<string>",
    "environmentId": "<string>",
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.envless.cloud/llms.txt

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

Authorizations

Authorization
string
header
required

Personal access key from https://app.envless.cloud/keys. Pass as Authorization: Bearer ev_live_....

Path Parameters

slug
string
required

The project's slug.

environmentSlug
string
required

The environment's slug.

Body

application/json
name
string
required
Example:

"DATABASE_URL"

value
string
required

AES-GCM ciphertext, base64-encoded, prefixed with v1:.

Example:

"v1:5J9k...=="

type
enum<string>
default:string
Available options:
string,
number,
boolean
isSecret
boolean
default:true

Response

Variable created

success
boolean
Example:

true

code
integer
Example:

201

message
string
Example:

"Variable created."

data
object