---
title: "Create a test"
method: POST
path: "/api/tests"
tags: ["Tests"]
---

# Create a test

`POST /api/tests`

Create a new test with a script. Supported types: `browser` (Playwright), `api`, `performance` (k6), `database`, `custom`.

## Request body

- object
  - `title` string, required
  - `script` string, required — Test script content
  - `type` 'browser' | 'api' | 'performance' | 'database' | 'custom' — Test type. Aliases accepted: `playwright` → `browser`, `k6` → `performance`
  - `description` string

## Response `201`

Test created

- object
  - `success` boolean
  - `test` Test
    - `id` string, uuid
    - `name` string, nullable
    - `title` string
    - `description` string, nullable
    - `priority` 'low' | 'medium' | 'high' — Test priority
    - `type` 'browser' | 'api' | 'performance' | 'database' | 'custom' — Test type. `browser` = Playwright, `performance` = k6
    - `script` string, nullable — Test script content
    - `projectId` string, uuid, nullable
    - `organizationId` string, uuid, nullable
    - `tags` Tag[]
      - `id` string, uuid
      - `name` string
      - `color` string, nullable
    - `createdAt` string, date-time, nullable
    - `updatedAt` string, date-time, nullable

## Other responses

- `401` — Authentication required or token invalid

## Changes

- **2026-03-21** `40aeed2ccba7` — 3 breaking, 4 info
  - the response property `test/createdAt` became nullable for the status `201`
  - the response property `test/script` became nullable for the status `201`
  - the response property `test/updatedAt` became nullable for the status `201`
  - added the optional property `test/name` to the response with the `201` status
  - …3 more
- **2026-02-08** `78bbac89339b` — 4 warning
  - removed the optional property `test/name` from the response with the `201` status
  - removed the optional property `test/organizationId` from the response with the `201` status
  - removed the optional property `test/projectId` from the response with the `201` status
  - removed the optional property `test/tags` from the response with the `201` status

[Change history](https://skmtc.dev/supercheck-io/apis/supercheck-api/changes/api/tests/post.md)

---

[API](https://skmtc.dev/supercheck-io/apis/supercheck-api.md) · [All operations](https://skmtc.dev/supercheck-io/apis/supercheck-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/supercheck-io/supercheck-api/revisions/81782deccf0e/schema)
