shadwshadw/Docs
GuidesAPIGetting Started
Dashboard
shadw REST APIOverviewErrors
  • GETGet project settings
  • POSTSet an environment variable
  • DELDelete an environment variable
  • DELDelete a project
APIs & SDKs/shadw REST API/Set an environment variable

Set an environment variable

POSThttps://api.shadw.cloud/v1/projects/{project}/env

Add or update an environment variable. Sensitive values are encrypted at rest (ChaCha20-Poly1305).

Authentication

AuthorizationbearerToken

A platform API key (hive_…, created under Settings → API Keys) or a short-lived JWT minted with POST /v1/token. An API key scopes the request to the team it was created under.

Path parameters

projectstringRequired

The project name.

Body parameters

keystringRequired

Variable name.

valuestringRequired

Value (sealed at rest when sensitive).

target"production" | "preview" | "all"Optional

Which environments it applies to.

sensitivebooleanOptional

Encrypt at rest and mask in the UI.

ts
const response = await fetch('https://api.shadw.cloud/v1/projects/{project}/env', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY', // hive_… (Settings → API Keys)
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "key": "key",
    "value": "value",
    "target": "production",
    "sensitive": true
  }),
});

const data = await response.json();
console.log(data);
Response
json
{ "key": "DATABASE_URL", "target": "all", "sensitive": true }