API reference

Environment variables

Read and change a Serverless App Service's environment variables.
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
A person's token or an API key, as Authorization: Bearer.
Get an API key

Path parameters

  • orgId

    Organization id (org_…).

  • projectId

    Serverless App Service id (prj_…).

Errors

  • 404Serverless App Service not found
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/projects/{projectId}/env' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
Send it from this page with your session or a key.

Response 200

{
  vars: {
    version: number
    access: null | {
      roles?: string[]
      teams?: string[]
      ownersOnly?: boolean
    }
    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[]
      ownersOnly?: boolean
    }
    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
  }[]
}
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 (cactive env pull, cactive dev). Sensitive values are null, except development-only secrets marked devReadable when the caller has env:write (audited as env.reveal).

Auth
A person's token or an API key, as Authorization: Bearer.
Allowed
env:write
Get an API key

Path parameters

  • orgId

    Organization id (org_…).

  • projectId

    Serverless App Service id (prj_…).

Query parameters

  • environment"production" | "preview" | "development"

    Default "development".

Errors

  • 404Serverless App Service not found
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/projects/{projectId}/env/values' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
Send it from this page with your session or a key.

Response 200

{
  environment: "preview" | "production" | "development"
  vars: {
    key: string
    value: null | string
    sensitive: boolean
    devReadable?: true
    shared?: true
  }[]
}
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
A person's token or an API key, as Authorization: Bearer.
Get an API key

Path parameters

  • orgId

    Organization id (org_…).

  • projectId

    Serverless App Service id (prj_…).

Request body

  • varsobject[]required

    1–200 items.

  • vars[].keystringrequired

    1–256 characters.

  • vars[].valuestringrequired

    Up to 65,536 characters.

  • targets("production" | "preview" | "development")[]required

    At least 1 item.

  • sensitiveboolean

    Default true.

  • devReadableboolean

    Default false.

Errors

  • 400Invalid names: …. Use letters, numbers and underscores, not starting with a number.
  • 400Reserved by the platform: ….
  • 400Only sensitive variables for Development alone can be readable by developers.
  • 404Serverless App Service not found
  • 429Your plan allows … secrets. Remove some you no longer need, or change plans.
  • 503Some variables weren't saved. Try again.
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/projects/{projectId}/env' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "vars": [
      {
        "key": "example",
        "value": "example"
      }
    ],
    "targets": [
      "production"
    ]
  }'
Send it from this page with your session or a key.

Response 200

{
  keys: string[]
  targets: ("preview" | "production" | "development")[]
  sensitive: boolean
  devReadable: boolean
}
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
A person's token or an API key, as Authorization: Bearer.
Get an API key

Path parameters

  • 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

  • valuestring

    Up to 65,536 characters.

  • targets("production" | "preview" | "development")[]required

    At least 1 item.

  • sensitiveboolean

    Default true.

  • devReadableboolean

    Default false.

Errors

  • 400Use letters, numbers and underscores, not starting with a number.
  • 400… is reserved by the platform.
  • 400Only sensitive variables for Development alone can be readable by developers.
  • 400Enter a value.
  • 400Enter a new value to make this variable visible.
  • 400Enter a new value to make this secret readable by developers.
  • 404Serverless App Service not found
  • 429Your plan allows … secrets. Remove some you no longer need, or change plans.
curl -X PUT 'https://api.cactive.com.au/v1/orgs/{orgId}/projects/{projectId}/env/{key}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "targets": [
      "production"
    ]
  }'
Send it from this page with your session or a key.

Response 200

{
  key: string
  targets: ("preview" | "production" | "development")[]
  sensitive: boolean
  devReadable: boolean
  version: number
}
DELETE/v1/orgs/:orgId/projects/:projectId/env/:key

Deletes a variable. Running deployments keep the value they started with.

Auth
A person's token or an API key, as Authorization: Bearer.
Get an API key

Path parameters

  • 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.

Errors

  • 404Serverless App Service not found
curl -X DELETE 'https://api.cactive.com.au/v1/orgs/{orgId}/projects/{projectId}/env/{key}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
Send it from this page with your session or a key.

Response 204 with no body

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
A person's token or an API key, as Authorization: Bearer.
Allowed
env:write
Get an API key

Path parameters

  • 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 parameters

  • versioninteger

    ≥ 1. Coerced from a string.

Errors

  • 403Earlier versions of this secret follow its access rule, which doesn't include you.
  • 404Variable not found
  • 404That version isn't kept any more.
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/projects/{projectId}/env/{key}/value' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
Send it from this page with your session or a key.
GET/v1/orgs/:orgId/projects/:projectId/env/:key/versions

The versions kept (when each was set and by whom), newest first.

Auth
A person's token or an API key, as Authorization: Bearer.
Get an API key

Path parameters

  • 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.

Errors

  • 404Variable not found
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/projects/{projectId}/env/{key}/versions' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
Send it from this page with your session or a key.

Response 200

{
  key: string
  current: number
  versions: {
    version: number
    createdAt?: number
    createdBy: string
    current: boolean
  }[]
}
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
A person's token or an API key, as Authorization: Bearer.
Get an API key

Path parameters

  • 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, …).

Errors

  • 404Variable not found
  • 404That version isn't kept any more.
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/projects/{projectId}/env/{key}/versions/{version}/restore' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
Send it from this page with your session or a key.

Response 200

{
  key: string
  version: number
}
PUT/v1/orgs/:orgId/projects/:projectId/env/:key/settings

A rotation reminder and who may read the value back.

Auth
A person's token or an API key, as Authorization: Bearer.
Scopes
env:write, keys:write (when body.access !== undefined)
Get an API key

Path parameters

  • 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

  • rotateEveryDaysintegeror null

    1–3650.

  • accessobjector null
  • access.roles[]

    Default []. Up to 4 items.

  • access.teamsstring[]

    Default []. Up to 50 items. Each 1–64 characters.

  • access.ownersOnlyboolean

Errors

  • 404Variable not found
curl -X PUT 'https://api.cactive.com.au/v1/orgs/{orgId}/projects/{projectId}/env/{key}/settings' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "rotateEveryDays": 1,
    "access": {
      "roles": [],
      "teams": [],
      "ownersOnly": true
    }
  }'
Send it from this page with your session or a key.

Response 200

{
  key: string
  rotateEveryDays: null | number
  access: null | {
    roles?: string[]
    teams?: string[]
    ownersOnly?: boolean
  }
}
GET/v1/orgs/:orgId/env

Lists the organization's shared variables. Sensitive values are null.

Auth
A person's token or an API key, as Authorization: Bearer.
Get an API key

Path parameters

  • orgId

    Organization id (org_…).

curl 'https://api.cactive.com.au/v1/orgs/{orgId}/env' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
Send it from this page with your session or a key.

Response 200

{
  vars: {
    version: number
    access: null | {
      roles?: string[]
      teams?: string[]
      ownersOnly?: boolean
    }
    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
A person's token or an API key, as Authorization: Bearer.
Get an API key

Path parameters

  • orgId

    Organization id (org_…).

Request body

  • varsobject[]required

    1–200 items.

  • vars[].keystringrequired

    1–256 characters.

  • vars[].valuestringrequired

    Up to 65,536 characters.

  • targets("production" | "preview" | "development")[]required

    At least 1 item.

  • sensitiveboolean

    Default true.

  • devReadableboolean

    Default false.

Errors

  • 400Invalid names: …. Use letters, numbers and underscores, not starting with a number.
  • 400Reserved by the platform: ….
  • 400Only sensitive variables for Development alone can be readable by developers.
  • 429Your plan allows … secrets. Remove some you no longer need, or change plans.
  • 503Some variables weren't saved. Try again.
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/env' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "vars": [
      {
        "key": "example",
        "value": "example"
      }
    ],
    "targets": [
      "production"
    ]
  }'
Send it from this page with your session or a key.

Response 200

{
  keys: string[]
  targets: ("preview" | "production" | "development")[]
  sensitive: boolean
  devReadable: boolean
}
PUT/v1/orgs/:orgId/env/:key

Creates or replaces a shared variable. Omit value to keep the stored one.

Auth
A person's token or an API key, as Authorization: Bearer.
Get an API key

Path parameters

  • 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

  • valuestring

    Up to 65,536 characters.

  • targets("production" | "preview" | "development")[]required

    At least 1 item.

  • sensitiveboolean

    Default true.

  • devReadableboolean

    Default false.

Errors

  • 400Use letters, numbers and underscores, not starting with a number.
  • 400… is reserved by the platform.
  • 400Only sensitive variables for Development alone can be readable by developers.
  • 400Enter a value.
  • 400Enter a new value to make this variable visible.
  • 400Enter a new value to make this secret readable by developers.
  • 429Your plan allows … secrets. Remove some you no longer need, or change plans.
curl -X PUT 'https://api.cactive.com.au/v1/orgs/{orgId}/env/{key}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "targets": [
      "production"
    ]
  }'
Send it from this page with your session or a key.

Response 200

{
  key: string
  targets: ("preview" | "production" | "development")[]
  sensitive: boolean
  devReadable: boolean
  version: number
}
DELETE/v1/orgs/:orgId/env/:key

Deletes a shared variable. Serverless App Services' own variables with the same key are unaffected.

Auth
A person's token or an API key, as Authorization: Bearer.
Get an API key

Path parameters

  • 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.

curl -X DELETE 'https://api.cactive.com.au/v1/orgs/{orgId}/env/{key}' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
Send it from this page with your session or a key.

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
A person's token or an API key, as Authorization: Bearer.
Allowed
env:write
Get an API key

Path parameters

  • 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 parameters

  • versioninteger

    ≥ 1. Coerced from a string.

Errors

  • 403Earlier versions of this secret follow its access rule, which doesn't include you.
  • 404Variable not found
  • 404That version isn't kept any more.
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/env/{key}/value' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
Send it from this page with your session or a key.
GET/v1/orgs/:orgId/env/:key/versions

The versions kept (when each was set and by whom), newest first.

Auth
A person's token or an API key, as Authorization: Bearer.
Get an API key

Path parameters

  • 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.

Errors

  • 404Variable not found
curl 'https://api.cactive.com.au/v1/orgs/{orgId}/env/{key}/versions' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
Send it from this page with your session or a key.

Response 200

{
  key: string
  current: number
  versions: {
    version: number
    createdAt?: number
    createdBy: string
    current: boolean
  }[]
}
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
A person's token or an API key, as Authorization: Bearer.
Get an API key

Path parameters

  • 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, …).

Errors

  • 404Variable not found
  • 404That version isn't kept any more.
curl -X POST 'https://api.cactive.com.au/v1/orgs/{orgId}/env/{key}/versions/{version}/restore' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
Send it from this page with your session or a key.

Response 200

{
  key: string
  version: number
}
PUT/v1/orgs/:orgId/env/:key/settings

A rotation reminder and who may read the value back.

Auth
A person's token or an API key, as Authorization: Bearer.
Scopes
env:write, keys:write (when body.access !== undefined)
Get an API key

Path parameters

  • 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

  • rotateEveryDaysintegeror null

    1–3650.

  • accessobjector null
  • access.roles[]

    Default []. Up to 4 items.

  • access.teamsstring[]

    Default []. Up to 50 items. Each 1–64 characters.

  • access.ownersOnlyboolean

Errors

  • 404Variable not found
curl -X PUT 'https://api.cactive.com.au/v1/orgs/{orgId}/env/{key}/settings' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "rotateEveryDays": 1,
    "access": {
      "roles": [],
      "teams": [],
      "ownersOnly": true
    }
  }'
Send it from this page with your session or a key.

Response 200

{
  key: string
  rotateEveryDays: null | number
  access: null | {
    roles?: string[]
    teams?: string[]
    ownersOnly?: boolean
  }
}
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
A person's token or an API key, as Authorization: Bearer.
Get an API key

Path parameters

  • orgId

    Organization id (org_…).

curl 'https://api.cactive.com.au/v1/orgs/{orgId}/secrets' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
Send it from this page with your session or a key.

Response 200

{
  secrets: {
    project: null | {
      projectId: string
      name: string
    }
    shared: boolean
    version: number
    access: null | {
      roles?: string[]
      teams?: string[]
      ownersOnly?: boolean
    }
    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
}