Skip to main content
POST
Create environment

Path Parameters

applicationShortId
string
required
Pattern: ^app(-.+_.+|_.+)$

Body

application/json

Add an environment to an application, e.g. staging next to production.

name
string
required

Environment name, unique within the application.

Required string length: 1 - 100
url
string<uri>

Public http(s) start URL. Required for web and API applications; mobile applications have no URL.

isProduction
boolean

Mark the environment as production. Defaults to false. The agent avoids destructive actions on production.

platform
enum<string>

Mobile only. Platform the environment runs on. Required unless applicationBuildShortId is passed, in which case it defaults to the build's platform.

Available options:
ios,
android
applicationBuildShortId
string

Mobile only. Build to launch by default, from manage_application_builds or GET /applications/{applicationShortId}/builds. It must belong to the same application and match platform. Omit to create the environment without a build and set one later with an update.

Pattern: ^build(-.+_.+|_.+)$
otherApplicationBuildShortIds
string[]

Mobile only, together with applicationBuildShortId. Companion apps installed next to the primary build. Every build must belong to the same application, use the same platform, and have a distinct bundle ID. At most 3.

Pattern: ^build(-.+_.+|_.+)$
customHeaders
object[]

Web and API applications only. Headers sent to matching hosts when tests run against this environment, e.g. a preview protection bypass token. Ignored when an environment with this name already exists; update that environment instead.

basicAuth
object[]

Web and API applications only. HTTP Basic Auth credentials sent to matching hosts when tests run against this environment. Ignored when an environment with this name already exists; update that environment instead.

projectShortId
string

Target a specific project by its prefixed short ID (proj-slug_shortId or proj_shortId), as returned by the projects API. Required for organization-scoped API keys; project-scoped keys may only pass their own project's short ID.

Pattern: ^proj(-.+_.+|_.+)$

Response

200 - application/json

The request has succeeded.

created
boolean
required

False when an unarchived environment with this name already existed and was returned unchanged.

environment
object
required