Skip to content

Create an environment

View .md
POST

A named set of environment variables to start sandboxes with, by name, with environment on POST /v1/sandboxes. Values are encrypted and never returned. At most 50 per project.

Authorization

  • Authorizationheaderrequired

    Bearer YOUR_API_KEY. Create a key in the dashboard.

Body

application/json

  • namestringrequired

    1 to 64 letters, digits, dots, dashes or underscores, starting with a letter or digit. Unique in the project: a taken name answers 409 conflict.

    Limitsmax length 64
  • envobject

    The variables. Same rules as env on POST /v1/sandboxes: keys match [A-Za-z_][A-Za-z0-9_]{0,127}, at most 100 and 64 KB, and a few platform names are refused.

    1 properties
    • {key}string

Responses

201Created.
  • environmentobjectrequired

    A named set of environment variables to start sandboxes with. Values are encrypted at rest and never returned.

    5 properties
    • idstringrequired
    • namestringrequired
    • variablesobject[]required

      Each variable's name and the last four characters of its value.

      2 properties
      • keystringrequired
      • last4stringrequired
    • createdAtstring<date-time>required
    • updatedAtstring<date-time>required
400Invalid name or variables.
  • codestringrequired
  • messagestringrequired
  • detailsobject
401Unauthorized.
  • codestringrequired
  • messagestringrequired
  • detailsobject
403`plan_limit_reached`: the project keeps 50 environments already.
  • codestringrequired
  • messagestringrequired
  • detailsobject
409`conflict`: an environment with that name exists.
  • codestringrequired
  • messagestringrequired
  • detailsobject