Skip to main content
POST
/
api
/
snoozes
Create Snooze
curl --request POST \
  --url https://api.example.com/api/snoozes \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "project_id": 123,
  "test_ids": [
    "<string>"
  ],
  "snooze_until": "<string>",
  "description": "<string>",
  "created_by": "<string>",
  "scoped_to_environment_id": 123
}
'
{
  "data": {
    "snooze": {
      "id": 13,
      "project_id": 4,
      "test_ids": [
        "a30a6eba6312f6b87ea5-55e241fbe3f4b8ae61ee"
      ],
      "snooze_until": "2026-04-01T00:00:00.000Z",
      "description": "Known flaky test, tracking in JIRA-5678",
      "created_from_test_run_id": null,
      "created_by": null,
      "created_at": "2026-03-25T10:30:00.000Z",
      "updated_at": "2026-03-25T10:30:00.000Z",
      "scoped_to_environment_id": null
    }
  }
}
Creates a new snooze to temporarily suppress test failures for the specified Playwright tests.

Examples

Request

Authorization
string
required
Bearer token for authentication. Format: Bearer <your-api-key>
project_id
number
required
The project ID.
test_ids
string[]
required
Array of Playwright test IDs (41-character hashes) to snooze. You can get these from the List Test Cases endpoint.
snooze_until
string
required
ISO 8601 timestamp for when the snooze should expire.
description
string
Optional description explaining why the tests are being snoozed.
created_by
string
Optional user identifier for the snooze creator. Set automatically for dashboard users; use this field to attribute API-created snoozes to a user.
scoped_to_environment_id
number
Environment ID to scope the snooze to. If omitted, the snooze applies to all environments.

Response

data.snooze
object
The created snooze object.
{
  "data": {
    "snooze": {
      "id": 13,
      "project_id": 4,
      "test_ids": [
        "a30a6eba6312f6b87ea5-55e241fbe3f4b8ae61ee"
      ],
      "snooze_until": "2026-04-01T00:00:00.000Z",
      "description": "Known flaky test, tracking in JIRA-5678",
      "created_from_test_run_id": null,
      "created_by": null,
      "created_at": "2026-03-25T10:30:00.000Z",
      "updated_at": "2026-03-25T10:30:00.000Z",
      "scoped_to_environment_id": null
    }
  }
}

Basic snooze

curl -X POST \
  https://dash.empirical.run/api/snoozes \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $EMPIRICALRUN_KEY" \
  -d '{
    "project_id": 4,
    "test_ids": ["a30a6eba6312f6b87ea5-55e241fbe3f4b8ae61ee"],
    "snooze_until": "2026-04-01T00:00:00.000Z",
    "description": "Known flaky test, tracking in JIRA-5678"
  }'

Scoped to environment

curl -X POST \
  https://dash.empirical.run/api/snoozes \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $EMPIRICALRUN_KEY" \
  -d '{
    "project_id": 4,
    "test_ids": [
      "a30a6eba6312f6b87ea5-55e241fbe3f4b8ae61ee",
      "b41b7fca7423g7c98fb6-66f352gcf4g5c9bf72ff"
    ],
    "snooze_until": "2026-04-15T00:00:00.000Z",
    "description": "Staging environment flakiness",
    "scoped_to_environment_id": 7
  }'