Skip to main content
POST
Create an environment

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string
required

Display name.

Minimum string length: 1
slug
string
required

URL-friendly identifier; unique within the project.

Minimum string length: 1
playwright_projects_match
string[]

Playwright project names to include. Items must not start with '!'.

playwright_projects_ignore
string[]

Playwright project names to exclude.

tags
string[]

Tags selecting the tests to run (e.g. @smoke); a missing @ is added. A test runs when one of its tags contains any of them, so smoke also selects @smoke-nightly. A test title is not a tag: checkout flow matches no test. To run specific tests, use test_case_ids. Saved for runs in this environment; a trigger request that sends this field replaces it.

Minimum string length: 1
exclude_tags
string[]

Tags whose tests are skipped (e.g. @slow). Applied after every other selection, so it can only remove tests: with tags it runs tests matching tags but not exclude_tags; alone it runs every test except the excluded ones. Saved for runs in this environment; a trigger request that sends this field replaces it.

Minimum string length: 1
scheduled_trigger
string | null

Cron expression for scheduled triggers, or null.

scheduled_concurrency
object | null

Concurrency group and policy scheduled runs are triggered with. Omit to keep the current value; null to fall back to the project's legacy concurrency setting.

reporter_config
object

Reporter configuration for the environment. Slack channels (slack_channels or slack_channel_ids) must be active registered channels of the project's organization (GET /api/v2/slack/channels); they are stored as registered ids.

Response

The created environment.

data
object
required

Response payload.