API reference
Environment variables
Read and change a Serverless App Service's environment variables.
Values are encrypted at rest; sensitive values are never returned. See Environment variables for targets and the names the platform reserves.
GET /v1/orgs/:orgId/projects/:projectId/env
Lists the Serverless App Service's variables, and shared: the organization's shared variables (a Serverless App Service variable with the same key replaces a shared one per environment). Values of sensitive variables are null.
Auth: user access token or platform agent key · Scope: env:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:projectId | Serverless App Service id (prj_…). |
Response 200
{
vars: {
version: number
access: null | {
roles?: string[]
teams?: string[]
}
rotateEveryDays: null | number
rotationDueAt: null | number
value: null | string
key: string
createdAt?: number
updatedAt?: number
orgId: string
projectId: string
targets: ("preview" | "production" | "development")[]
sensitive?: boolean
devReadable?: boolean
updatedBy: string
valueUpdatedAt?: number
}[]
shared: {
version: number
access: null | {
roles?: string[]
teams?: string[]
}
rotateEveryDays: null | number
rotationDueAt: null | number
value: null | string
key: string
createdAt?: number
updatedAt?: number
orgId: string
projectId: string
targets: ("preview" | "production" | "development")[]
sensitive?: boolean
devReadable?: boolean
updatedBy: string
valueUpdatedAt?: number
}[]
}Errors
| Status | Message |
|---|---|
404 | Serverless App Service not found |
GET /v1/orgs/:orgId/projects/:projectId/env/values
One environment's variables as a deployment gets them (shared ones overridden by the Serverless App Service's), for local development (si env pull, si dev). Sensitive values are null, except development-only secrets marked devReadable when the caller has env:write (audited as env.reveal).
Auth: user access token or platform agent key · Scope: env:read · Allowed: env:write
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:projectId | Serverless App Service id (prj_…). |
| Query parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
environment | "production" | "preview" | "development" | No | "development" |
Response 200
{
environment: "preview" | "production" | "development"
vars: {
key: string
value: null | string
sensitive: boolean
devReadable?: true
shared?: true
}[]
}Errors
| Status | Message |
|---|---|
404 | Serverless App Service not found |
POST /v1/orgs/:orgId/projects/:projectId/env
Creates or replaces many variables at once (e.g. a pasted .env file), all with the same environments and sensitivity. Nothing is written unless every key is valid.
Auth: user access token or platform agent key · Scope: env:write
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:projectId | Serverless App Service id (prj_…). |
Request body
| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
vars | object[] | Yes | 1–200 items | |
vars[].key | string | Yes | 1–256 characters | |
vars[].value | string | Yes | up to 65,536 characters | |
targets | ("production" | "preview" | "development")[] | Yes | at least 1 item | |
sensitive | boolean | No | true | |
devReadable | boolean | No | false |
Response 200
{
keys: string[]
targets: ("preview" | "production" | "development")[]
sensitive: boolean
devReadable: boolean
}Errors
| Status | Message |
|---|---|
400 | Invalid names: …. Use letters, numbers and underscores, not starting with a number. |
400 | Reserved by the platform: …. |
400 | Only sensitive variables for Development alone can be readable by developers. |
404 | Serverless App Service not found |
429 | Your plan allows … secrets. Remove some you no longer need, or change plans. |
503 | Some variables weren't saved. Try again. |
PUT /v1/orgs/:orgId/projects/:projectId/env/:key
Creates or replaces a variable. Omit value to keep the stored value, for example to change the targets of a sensitive variable.
Auth: user access token or platform agent key · Scope: env:write
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:projectId | Serverless App Service id (prj_…). |
:key | Variable name; under marketing journeys a person's key: their email address, mobile (E.164) or rec:<record id>, URL-encoded. |
Request body
| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
value | string | No | up to 65,536 characters | |
targets | ("production" | "preview" | "development")[] | Yes | at least 1 item | |
sensitive | boolean | No | true | |
devReadable | boolean | No | false |
Response 200
{
key: string
targets: ("preview" | "production" | "development")[]
sensitive: boolean
devReadable: boolean
version: number
}Errors
| Status | Message |
|---|---|
400 | Use letters, numbers and underscores, not starting with a number. |
400 | … is reserved by the platform. |
400 | Only sensitive variables for Development alone can be readable by developers. |
400 | Enter a value. |
400 | Enter a new value to make this variable visible. |
400 | Enter a new value to make this secret readable by developers. |
404 | Serverless App Service not found |
429 | Your plan allows … secrets. Remove some you no longer need, or change plans. |
DELETE /v1/orgs/:orgId/projects/:projectId/env/:key
Deletes a variable. Running deployments keep the value they started with.
Auth: user access token or platform agent key · Scope: env:write
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:projectId | Serverless App Service id (prj_…). |
:key | Variable name; under marketing journeys a person's key: their email address, mobile (E.164) or rec:<record id>, URL-encoded. |
Response 204 with no body.
Errors
| Status | Message |
|---|---|
404 | Serverless App Service not found |
GET /v1/orgs/:orgId/projects/:projectId/env/:key/value
Reads a value back (version: an earlier one). Sensitive values only as their access rule allows; audited.
Auth: user access token or platform agent key · Scope: env:read · Allowed: env:write
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:projectId | Serverless App Service id (prj_…). |
:key | Variable name; under marketing journeys a person's key: their email address, mobile (E.164) or rec:<record id>, URL-encoded. |
| Query parameter | Type | Required | Notes |
|---|---|---|---|
version | integer | No | ≥ 1; coerced from a string |
Errors
| Status | Message |
|---|---|
403 | This secret's access rule doesn't include you. Owners and admins can change who may read it. |
403 | Earlier versions of this secret follow its access rule, which doesn't include you. |
404 | Variable not found |
404 | That version isn't kept any more. |
GET /v1/orgs/:orgId/projects/:projectId/env/:key/versions
The versions kept (when each was set and by whom), newest first.
Auth: user access token or platform agent key · Scope: env:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:projectId | Serverless App Service id (prj_…). |
:key | Variable name; under marketing journeys a person's key: their email address, mobile (E.164) or rec:<record id>, URL-encoded. |
Response 200
{
key: string
current: number
versions: {
version: number
createdAt?: number
createdBy: string
current: boolean
}[]
}Errors
| Status | Message |
|---|---|
404 | Variable not found |
POST /v1/orgs/:orgId/projects/:projectId/env/:key/versions/:version/restore
Sets an earlier value again, as a new version. Takes effect on the next deployment.
Auth: user access token or platform agent key · Scope: env:write
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:projectId | Serverless App Service id (prj_…). |
:key | Variable name; under marketing journeys a person's key: their email address, mobile (E.164) or rec:<record id>, URL-encoded. |
:version | A published journey version's number (1, 2, …). |
Response 200
{
key: string
version: number
}Errors
| Status | Message |
|---|---|
404 | Variable not found |
404 | That version isn't kept any more. |
PUT /v1/orgs/:orgId/projects/:projectId/env/:key/settings
A rotation reminder and who may read the value back.
Auth: user access token or platform agent key · Scopes: env:write, keys:write (when body.access !== undefined)
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:projectId | Serverless App Service id (prj_…). |
:key | Variable name; under marketing journeys a person's key: their email address, mobile (E.164) or rec:<record id>, URL-encoded. |
Request body
| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
rotateEveryDays | integer | No | 1–3650; can be null | |
access | object | No | can be null | |
access.roles | [] | No | [] | up to 4 items |
access.teams | string[] | No | [] | up to 50 items; each 1–64 characters |
Response 200
{
key: string
rotateEveryDays: null | number
access: null | {
roles?: string[]
teams?: string[]
}
}Errors
| Status | Message |
|---|---|
404 | Variable not found |
GET /v1/orgs/:orgId/env
Lists the organization's shared variables. Sensitive values are null.
Auth: user access token or platform agent key · Scope: env:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
Response 200
{
vars: {
version: number
access: null | {
roles?: string[]
teams?: string[]
}
rotateEveryDays: null | number
rotationDueAt: null | number
value: null | string
key: string
createdAt?: number
updatedAt?: number
orgId: string
projectId: string
targets: ("preview" | "production" | "development")[]
sensitive?: boolean
devReadable?: boolean
updatedBy: string
valueUpdatedAt?: number
}[]
}POST /v1/orgs/:orgId/env
Creates or replaces many shared variables at once, all with the same environments and sensitivity.
Auth: user access token or platform agent key · Scope: env:write
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
Request body
| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
vars | object[] | Yes | 1–200 items | |
vars[].key | string | Yes | 1–256 characters | |
vars[].value | string | Yes | up to 65,536 characters | |
targets | ("production" | "preview" | "development")[] | Yes | at least 1 item | |
sensitive | boolean | No | true | |
devReadable | boolean | No | false |
Response 200
{
keys: string[]
targets: ("preview" | "production" | "development")[]
sensitive: boolean
devReadable: boolean
}Errors
| Status | Message |
|---|---|
400 | Invalid names: …. Use letters, numbers and underscores, not starting with a number. |
400 | Reserved by the platform: …. |
400 | Only sensitive variables for Development alone can be readable by developers. |
429 | Your plan allows … secrets. Remove some you no longer need, or change plans. |
503 | Some variables weren't saved. Try again. |
PUT /v1/orgs/:orgId/env/:key
Creates or replaces a shared variable. Omit value to keep the stored one.
Auth: user access token or platform agent key · Scope: env:write
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:key | Variable name; under marketing journeys a person's key: their email address, mobile (E.164) or rec:<record id>, URL-encoded. |
Request body
| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
value | string | No | up to 65,536 characters | |
targets | ("production" | "preview" | "development")[] | Yes | at least 1 item | |
sensitive | boolean | No | true | |
devReadable | boolean | No | false |
Response 200
{
key: string
targets: ("preview" | "production" | "development")[]
sensitive: boolean
devReadable: boolean
version: number
}Errors
| Status | Message |
|---|---|
400 | Use letters, numbers and underscores, not starting with a number. |
400 | … is reserved by the platform. |
400 | Only sensitive variables for Development alone can be readable by developers. |
400 | Enter a value. |
400 | Enter a new value to make this variable visible. |
400 | Enter a new value to make this secret readable by developers. |
429 | Your plan allows … secrets. Remove some you no longer need, or change plans. |
DELETE /v1/orgs/:orgId/env/:key
Deletes a shared variable. Serverless App Services' own variables with the same key are unaffected.
Auth: user access token or platform agent key · Scope: env:write
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:key | Variable name; under marketing journeys a person's key: their email address, mobile (E.164) or rec:<record id>, URL-encoded. |
Response 204 with no body.
GET /v1/orgs/:orgId/env/:key/value
Reads a value back (version: an earlier one). Sensitive values only as their access rule allows; audited.
Auth: user access token or platform agent key · Scope: env:read · Allowed: env:write
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:key | Variable name; under marketing journeys a person's key: their email address, mobile (E.164) or rec:<record id>, URL-encoded. |
| Query parameter | Type | Required | Notes |
|---|---|---|---|
version | integer | No | ≥ 1; coerced from a string |
Errors
| Status | Message |
|---|---|
403 | This secret's access rule doesn't include you. Owners and admins can change who may read it. |
403 | Earlier versions of this secret follow its access rule, which doesn't include you. |
404 | Variable not found |
404 | That version isn't kept any more. |
GET /v1/orgs/:orgId/env/:key/versions
The versions kept (when each was set and by whom), newest first.
Auth: user access token or platform agent key · Scope: env:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:key | Variable name; under marketing journeys a person's key: their email address, mobile (E.164) or rec:<record id>, URL-encoded. |
Response 200
{
key: string
current: number
versions: {
version: number
createdAt?: number
createdBy: string
current: boolean
}[]
}Errors
| Status | Message |
|---|---|
404 | Variable not found |
POST /v1/orgs/:orgId/env/:key/versions/:version/restore
Sets an earlier value again, as a new version. Takes effect on the next deployment.
Auth: user access token or platform agent key · Scope: env:write
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:key | Variable name; under marketing journeys a person's key: their email address, mobile (E.164) or rec:<record id>, URL-encoded. |
:version | A published journey version's number (1, 2, …). |
Response 200
{
key: string
version: number
}Errors
| Status | Message |
|---|---|
404 | Variable not found |
404 | That version isn't kept any more. |
PUT /v1/orgs/:orgId/env/:key/settings
A rotation reminder and who may read the value back.
Auth: user access token or platform agent key · Scopes: env:write, keys:write (when body.access !== undefined)
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:key | Variable name; under marketing journeys a person's key: their email address, mobile (E.164) or rec:<record id>, URL-encoded. |
Request body
| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
rotateEveryDays | integer | No | 1–3650; can be null | |
access | object | No | can be null | |
access.roles | [] | No | [] | up to 4 items |
access.teams | string[] | No | [] | up to 50 items; each 1–64 characters |
Response 200
{
key: string
rotateEveryDays: null | number
access: null | {
roles?: string[]
teams?: string[]
}
}Errors
| Status | Message |
|---|---|
404 | Variable not found |
GET /v1/orgs/:orgId/secrets
Every secret in the organization (shared ones and each Serverless App Service's sensitive variables): key, targets, current version, last change and by whom, rotation reminder and when it's due, and the access rule. Never values. Also limit, the plan's secretsMax. Needs env:read.
Auth: user access token or platform agent key · Scope: env:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
Response 200
{
secrets: {
project: null | {
projectId: string
name: string
}
shared: boolean
version: number
access: null | {
roles?: string[]
teams?: string[]
}
rotateEveryDays: null | number
rotationDueAt: null | number
value: null | string
key: string
createdAt?: number
updatedAt?: number
orgId: string
projectId: string
targets: ("preview" | "production" | "development")[]
sensitive?: boolean
devReadable?: boolean
updatedBy: string
valueUpdatedAt?: number
}[]
limit: number
}