---
title: "Validate a test script"
method: POST
path: "/api/validate-script"
tags: ["Tests"]
---

# Validate a test script

`POST /api/validate-script`

Validate a Playwright or k6 script using the same server-side rules as the Playground and CLI preflight checks.

## Request body

- ValidationScriptRequest
  - `script` string, required — Test script content to validate
  - `testType` 'browser' | 'api' | 'performance' | 'database' | 'custom' — Optional expected test type used for script/type compatibility checks

## Response `200`

Script is valid

- ValidationScriptSuccessResponse
  - `valid` true
  - `message` string
  - `warnings` string[]

## Other responses

- `400` — Script failed validation
- `401` — Authentication required or token invalid
- `500` — Validation service error

---

[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)
