Skip to main content
POST
/
api
/
environments
Create an environment
curl --request POST \
  --url https://api.empirical.run/api/environments \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "slug": "<string>",
  "playwright_projects_match": [
    "<string>"
  ],
  "playwright_projects_ignore": [
    "<string>"
  ],
  "scheduled_trigger": "<string>"
}
'
{
  "data": {
    "environment": {
      "id": 123,
      "project_id": 123,
      "slug": "<string>",
      "name": "<string>",
      "playwright_projects_match": [
        "<string>"
      ],
      "playwright_projects_ignore": [
        "<string>"
      ],
      "is_disabled": true,
      "env_files": [
        "<string>"
      ],
      "scheduled_trigger": "<string>",
      "created_at": "<string>",
      "updated_at": "<string>"
    }
  }
}

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.

scheduled_trigger
string | null

Cron expression for scheduled triggers, or null.

Response

The created environment.

data
object
required

Response payload.