{ "openapi": "3.1.0", "info": { "title": "Supercheck API", "version": "1.0.0", "description": "API for test automation, monitoring, and CI/CD integration. Supercheck provides Playwright browser testing, k6 performance testing, uptime monitoring, and alerting \u2014 all managed via API or CLI.", "contact": { "name": "Supercheck", "url": "https://supercheck.io" }, "license": { "name": "AGPL-3.0", "url": "https://github.com/supercheck-io/supercheck/blob/main/LICENSE" } }, "servers": [ { "url": "https://demo.supercheck.dev", "description": "Demo" }, { "url": "https://app.supercheck.io", "description": "Production (Cloud)" } ], "security": [ { "bearerAuth": [] } ], "tags": [ { "name": "Authentication", "description": "CLI token management and verification" }, { "name": "Jobs", "description": "Job scheduling and execution" }, { "name": "Trigger Keys", "description": "API trigger key management for jobs" }, { "name": "Runs", "description": "Job run management and monitoring" }, { "name": "Tests", "description": "Test script management" }, { "name": "Monitors", "description": "Uptime and performance monitoring" }, { "name": "Variables", "description": "Project environment variables" }, { "name": "Tags", "description": "Resource tagging" }, { "name": "Notifications", "description": "Notification provider management" }, { "name": "Alerts", "description": "Alert history" }, { "name": "Audit", "description": "Audit log access" }, { "name": "System", "description": "Health checks and metadata" }, { "name": "Status Pages", "description": "Manage status pages for uptime dashboards" } ], "paths": { "/api/health": { "get": { "operationId": "getHealth", "summary": "Health check", "description": "Returns the health status of the API and its dependencies (database, Redis, storage).", "tags": [ "System" ], "security": [], "responses": { "200": { "description": "Health status", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "ok", "degraded", "unhealthy" ] }, "timestamp": { "type": "string", "format": "date-time" }, "latencyMs": { "type": "integer" }, "checks": { "type": "object", "properties": { "database": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "ok", "error" ] }, "latencyMs": { "type": "integer" }, "error": { "type": "string" } } }, "redis": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "ok", "error" ] }, "latencyMs": { "type": "integer" }, "error": { "type": "string" } } }, "s3": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "ok", "error" ] }, "latencyMs": { "type": "integer" }, "error": { "type": "string" } } } } } }, "required": [ "status", "timestamp", "latencyMs", "checks" ] } } } }, "503": { "description": "Service unhealthy", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "ok", "degraded", "unhealthy" ] }, "timestamp": { "type": "string", "format": "date-time" }, "latencyMs": { "type": "integer" }, "checks": { "type": "object", "properties": { "database": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "ok", "error" ] }, "latencyMs": { "type": "integer" }, "error": { "type": "string" } } }, "redis": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "ok", "error" ] }, "latencyMs": { "type": "integer" }, "error": { "type": "string" } } }, "s3": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "ok", "error" ] }, "latencyMs": { "type": "integer" }, "error": { "type": "string" } } } } } }, "required": [ "status", "timestamp", "latencyMs", "checks" ] } } } } } } }, "/api/locations": { "get": { "operationId": "listLocations", "summary": "List execution locations", "description": "Returns enabled execution locations visible in the current hosting mode. Authentication is required.", "tags": [ "System" ], "responses": { "200": { "description": "Available locations", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean", "example": true }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/Location" } } } } } } } } } }, "/api/cli-tokens": { "get": { "operationId": "listCliTokens", "summary": "List CLI tokens", "description": "List all CLI tokens for the current project. Also used by `supercheck whoami` to verify the current token.", "tags": [ "Authentication" ], "responses": { "200": { "description": "List of CLI tokens", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "tokens": { "type": "array", "items": { "$ref": "#/components/schemas/CliToken" } } } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" } } }, "post": { "operationId": "createCliToken", "summary": "Create a CLI token", "description": "Create a new CLI token for API access. The plain token value is returned only once in the response \u2014 store it securely.", "tags": [ "Authentication" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "description": "Human-readable token name", "example": "CI/CD Pipeline" }, "expiresIn": { "type": "integer", "description": "Optional expiration duration in seconds (min 3600 = 1 hour, max 31536000 = 1 year)", "example": 7776000, "minimum": 3600, "maximum": 31536000 } }, "required": [ "name" ] } } } }, "responses": { "201": { "description": "Token created. The `key` field contains the plain token \u2014 store it securely, it cannot be retrieved again.", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "token": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "key": { "type": "string", "description": "Plain token value (shown only once)", "example": "sck_live_a1b2c3d4e5f6789012345678901234ab" }, "start": { "type": "string", "description": "Display prefix for identification" }, "enabled": { "type": "boolean" }, "expiresAt": { "type": "string", "format": "date-time", "nullable": true }, "createdAt": { "type": "string", "format": "date-time" } } } } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "409": { "description": "Duplicate token name within this project" } } } }, "/api/cli-tokens/{id}": { "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "CLI token ID" } ], "patch": { "operationId": "updateCliToken", "summary": "Update a CLI token", "description": "Enable, disable, or rename a CLI token.", "tags": [ "Authentication" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "name": { "type": "string" } } } } } }, "responses": { "200": { "description": "Token updated", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "token": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "enabled": { "type": "boolean" } } } } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/NotFound" } } }, "delete": { "operationId": "deleteCliToken", "summary": "Revoke a CLI token", "description": "Permanently delete a CLI token. This action cannot be undone.", "tags": [ "Authentication" ], "responses": { "200": { "description": "Token revoked", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" } } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/api/jobs": { "get": { "operationId": "listJobs", "summary": "List jobs", "description": "List all jobs in the current project with pagination.", "tags": [ "Jobs" ], "parameters": [ { "$ref": "#/components/parameters/Page" }, { "$ref": "#/components/parameters/Limit" } ], "responses": { "200": { "description": "Paginated list of jobs", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/PaginatedResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Job" } } } } ] } } } }, "401": { "$ref": "#/components/responses/Unauthorized" } } }, "post": { "operationId": "createJob", "summary": "Create a job", "description": "Create a new job with optional scheduling and test configuration.", "tags": [ "Jobs" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/JobCreateRequest" } } } }, "responses": { "200": { "description": "Job created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/JobCreateResponse" } } } }, "400": { "description": "Invalid job payload" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "402": { "description": "Active subscription required" }, "403": { "$ref": "#/components/responses/Forbidden" } } } }, "/api/jobs/{id}": { "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "Job ID" } ], "get": { "operationId": "getJob", "summary": "Get job details", "description": "Retrieve full details for a job including its tests and last run information.", "tags": [ "Jobs" ], "responses": { "200": { "description": "Job details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Job" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/NotFound" } } }, "patch": { "operationId": "updateJob", "summary": "Update a job", "description": "Update job configuration. Only provided fields are changed.", "tags": [ "Jobs" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/JobUpdateRequest" } } } }, "responses": { "200": { "description": "Job updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/JobUpdateResponse" } } } }, "400": { "description": "Invalid job update payload" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" } } }, "delete": { "operationId": "deleteJob", "summary": "Delete a job", "description": "Permanently delete a job and all its associated runs.", "tags": [ "Jobs" ], "responses": { "200": { "description": "Job deleted", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" } }, "required": [ "success", "message" ] } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/api/jobs/{id}/trigger": { "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "Job ID" } ], "post": { "operationId": "triggerJob", "summary": "Trigger job execution", "description": "Trigger a job run using a job-scoped trigger key in the `Authorization: Bearer ` header. For k6 jobs, an optional `location` query parameter can target an enabled location code or `global` for unrestricted any-worker routing. Note: this endpoint only accepts a job trigger key (`sck_trigger_*` / legacy `job_*`) in the `Authorization` header. CLI tokens (`sck_live_*`) are rejected with 401.", "tags": [ "Jobs" ], "parameters": [ { "name": "location", "in": "query", "required": false, "schema": { "type": "string" }, "description": "Optional execution location for k6 jobs. Use an enabled location code (for example `us-east`) or `global` for unrestricted any-worker routing. `global` is rejected when project location restrictions are enabled." } ], "responses": { "200": { "description": "Job triggered", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/JobTriggerResponse" } } } }, "400": { "description": "Invalid job ID, invalid location, or the job cannot be triggered" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "402": { "description": "Active subscription required" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "429": { "description": "Rate limited \u2014 too many trigger requests", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" }, "limit": { "type": "integer" }, "remaining": { "type": "integer" }, "resetAt": { "type": "string", "format": "date-time" } } } } } } } }, "get": { "operationId": "getJobTriggerInfo", "summary": "Get job trigger information", "description": "Retrieve the authenticated trigger URL and usage instructions for a job.", "tags": [ "Jobs" ], "responses": { "200": { "description": "Trigger information", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/JobTriggerInfoResponse" } } } }, "400": { "description": "Invalid job ID format" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/api/jobs/run": { "post": { "operationId": "runJob", "summary": "Run a job immediately", "description": "Execute a job immediately by providing its ID. The job's configured tests will be run. For k6 jobs, an optional `location` can target an enabled location code or `global` for unrestricted any-worker routing.", "tags": [ "Jobs" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "jobId": { "type": "string", "format": "uuid", "description": "ID of the job to run" }, "tests": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "title": { "type": "string" }, "type": { "type": "string", "enum": [ "browser", "api", "performance", "database", "custom" ] } }, "required": [ "id" ] }, "minItems": 1, "description": "Tests to execute for this run. The server validates ownership and uses the stored scripts as the source of truth." }, "trigger": { "type": "string", "enum": [ "manual", "remote", "schedule" ], "description": "Requested trigger source. CLI-authenticated calls are normalized to `remote` by the server." }, "location": { "type": "string", "description": "Optional execution location for k6 jobs. Use an enabled location code (for example `us-east`) or `global` for unrestricted any-worker routing. `global` is rejected when project location restrictions are enabled." } }, "required": [ "jobId", "tests", "trigger" ] } } } }, "responses": { "200": { "description": "Job started", "content": { "application/json": { "schema": { "type": "object", "properties": { "runId": { "type": "string", "format": "uuid" }, "jobId": { "type": "string", "format": "uuid" }, "status": { "type": "string" }, "message": { "type": "string" } } } } } }, "400": { "description": "Invalid job execution payload" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "402": { "description": "Active subscription required" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/api/jobs/{id}/api-keys": { "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "Job ID" } ], "get": { "operationId": "listJobApiKeys", "summary": "List trigger keys", "description": "List all API trigger keys for a specific job.", "tags": [ "Trigger Keys" ], "responses": { "200": { "description": "List of trigger keys", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "apiKeys": { "type": "array", "items": { "$ref": "#/components/schemas/TriggerKey" } } } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/NotFound" } } }, "post": { "operationId": "createJobApiKey", "summary": "Create a trigger key", "description": "Create a new API trigger key for a job. The plain key is returned only once \u2014 store it securely.", "tags": [ "Trigger Keys" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "description": "Human-readable name for the trigger key", "example": "GitHub Actions" }, "expiresIn": { "type": "integer", "description": "Optional expiration duration in seconds", "example": 7776000 } }, "required": [ "name" ] } } } }, "responses": { "201": { "description": "Trigger key created. Store the `key` value securely \u2014 it cannot be retrieved again.", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "apiKey": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "key": { "type": "string", "description": "Plain key value (shown only once)", "example": "sck_trigger_f1e2d3c4b5a6789012345678901234cd" }, "start": { "type": "string" }, "enabled": { "type": "boolean" }, "expiresAt": { "type": "string", "format": "date-time", "nullable": true }, "createdAt": { "type": "string", "format": "date-time" } } } } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/api/jobs/{id}/api-keys/{keyId}": { "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "Job ID" }, { "name": "keyId", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "Trigger key ID" } ], "patch": { "operationId": "updateJobApiKey", "summary": "Update a trigger key", "description": "Enable, disable, or rename a trigger key.", "tags": [ "Trigger Keys" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "name": { "type": "string" } } } } } }, "responses": { "200": { "description": "Trigger key updated", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "apiKey": { "$ref": "#/components/schemas/TriggerKey" } } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/NotFound" } } }, "delete": { "operationId": "deleteJobApiKey", "summary": "Delete a trigger key", "description": "Permanently delete a trigger key. This action cannot be undone.", "tags": [ "Trigger Keys" ], "responses": { "200": { "description": "Trigger key deleted", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" } } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/api/runs": { "get": { "operationId": "listRuns", "summary": "List runs", "description": "List job runs with optional filters for job ID and status.", "tags": [ "Runs" ], "parameters": [ { "$ref": "#/components/parameters/Page" }, { "$ref": "#/components/parameters/Limit" }, { "name": "jobId", "in": "query", "schema": { "type": "string", "format": "uuid" }, "description": "Filter by job ID" }, { "name": "status", "in": "query", "schema": { "type": "string", "enum": [ "queued", "running", "passed", "failed", "error", "blocked" ] }, "description": "Filter by status" } ], "responses": { "200": { "description": "Paginated list of runs", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/PaginatedResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Run" } } } } ] } } } }, "401": { "$ref": "#/components/responses/Unauthorized" } } } }, "/api/runs/{runId}": { "parameters": [ { "name": "runId", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "Run ID" } ], "get": { "operationId": "getRun", "summary": "Get run details", "description": "Retrieve full details for a specific run including logs, report URL, and execution metadata.", "tags": [ "Runs" ], "responses": { "200": { "description": "Run details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Run" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/NotFound" } } }, "delete": { "operationId": "deleteRun", "summary": "Delete a run", "description": "Permanently delete a run and its associated data.", "tags": [ "Runs" ], "responses": { "200": { "description": "Run deleted", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" } } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/api/runs/{runId}/permissions": { "parameters": [ { "name": "runId", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "Run ID" } ], "get": { "operationId": "getRunPermissions", "summary": "Get run access permissions", "description": "Returns the caller's role and scoped project/organization IDs for a run.", "tags": [ "Runs" ], "responses": { "200": { "description": "Permissions payload", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RunPermissionsResponse" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "500": { "description": "Failed to fetch permissions" } } } }, "/api/runs/{runId}/status": { "parameters": [ { "name": "runId", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "Run ID" } ], "get": { "operationId": "getRunStatus", "summary": "Get run status", "description": "Quick status check for a run. Useful for polling in CI/CD pipelines.", "tags": [ "Runs" ], "responses": { "200": { "description": "Run status", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RunStatusResponse" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/api/runs/{runId}/stream": { "parameters": [ { "name": "runId", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "Run ID" } ], "get": { "operationId": "streamRunOutput", "summary": "Stream run output (SSE)", "description": "Stream live console output from a running job execution using Server-Sent Events. The stream includes heartbeat events and closes when the run completes.", "tags": [ "Runs" ], "responses": { "200": { "description": "SSE event stream", "content": { "text/event-stream": { "schema": { "type": "string" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/api/runs/{runId}/cancel": { "parameters": [ { "name": "runId", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "Run ID" } ], "post": { "operationId": "cancelRun", "summary": "Cancel a run", "description": "Cancel a running or queued job execution.", "tags": [ "Runs" ], "responses": { "200": { "description": "Run cancelled", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" }, "runId": { "type": "string", "format": "uuid" } } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/api/tests": { "get": { "operationId": "listTests", "summary": "List tests", "description": "List all tests in the current project with optional search and type filters.", "tags": [ "Tests" ], "parameters": [ { "$ref": "#/components/parameters/Page" }, { "$ref": "#/components/parameters/Limit" }, { "name": "includeScript", "in": "query", "schema": { "type": "boolean" }, "description": "Include decoded script content in each listed test. Defaults to false." }, { "name": "search", "in": "query", "schema": { "type": "string" }, "description": "Search by title" }, { "name": "type", "in": "query", "schema": { "type": "string", "enum": [ "browser", "api", "performance", "database", "custom" ] }, "description": "Filter by test type. Aliases: `playwright` \u2192 `browser`, `k6` \u2192 `performance`" } ], "responses": { "200": { "description": "Paginated list of tests", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/PaginatedResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Test" } } } } ] } } } }, "401": { "$ref": "#/components/responses/Unauthorized" } } }, "post": { "operationId": "createTest", "summary": "Create a test", "description": "Create a new test with a script. Supported types: `browser` (Playwright), `api`, `performance` (k6), `database`, `custom`.", "tags": [ "Tests" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "title": { "type": "string", "example": "Homepage Load Test" }, "script": { "type": "string", "description": "Test script content" }, "type": { "type": "string", "enum": [ "browser", "api", "performance", "database", "custom" ], "default": "browser", "description": "Test type. Aliases accepted: `playwright` \u2192 `browser`, `k6` \u2192 `performance`" }, "description": { "type": "string" } }, "required": [ "title", "script" ] } } } }, "responses": { "201": { "description": "Test created", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "test": { "$ref": "#/components/schemas/Test" } } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" } } } }, "/api/tests/{id}": { "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "Test ID" } ], "get": { "operationId": "getTest", "summary": "Get test details", "description": "Retrieve full details for a test including its script content.", "tags": [ "Tests" ], "responses": { "200": { "description": "Test details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Test" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/NotFound" } }, "parameters": [ { "name": "includeScript", "in": "query", "schema": { "type": "boolean" }, "description": "Include decoded script content in the response. Defaults to true unless explicitly set to false." } ] }, "patch": { "operationId": "updateTest", "summary": "Update a test", "description": "Update test title, script, description, or type.", "tags": [ "Tests" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "title": { "type": "string" }, "script": { "type": "string" }, "description": { "type": "string" }, "type": { "type": "string", "enum": [ "browser", "api", "performance", "database", "custom" ] } } } } } }, "responses": { "200": { "description": "Test updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Test" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/NotFound" } } }, "delete": { "operationId": "deleteTest", "summary": "Delete a test", "description": "Delete a test. Fails if the test is in use by active jobs or synthetic monitors.", "tags": [ "Tests" ], "responses": { "200": { "description": "Test deleted", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" } }, "required": [ "success", "message" ] } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "409": { "description": "Test is in use by jobs or synthetic monitors and cannot be deleted" } } } }, "/api/tests/{id}/tags": { "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "Test ID" } ], "get": { "operationId": "getTestTags", "summary": "Get test tags", "description": "List all tags attached to a test.", "tags": [ "Tests" ], "responses": { "200": { "description": "Tags for the test", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Tag" } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" } } }, "post": { "operationId": "replaceTestTags", "summary": "Replace test tags", "description": "Replace all tags for a test with the provided list.", "tags": [ "Tests" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "tagIds": { "type": "array", "items": { "type": "string", "format": "uuid" } } }, "required": [ "tagIds" ] } } } }, "responses": { "200": { "description": "Updated tag list", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Tag" } } } } }, "400": { "description": "Invalid input" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" } } }, "delete": { "operationId": "deleteTestTag", "summary": "Remove a tag from a test", "description": "Remove a specific tag from a test.", "tags": [ "Tests" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "tagId": { "type": "string", "format": "uuid" } }, "required": [ "tagId" ] } } } }, "responses": { "200": { "description": "Tag removed", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" } } } } } }, "400": { "description": "Invalid input" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/api/tests/{id}/execute": { "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "Test ID" } ], "post": { "operationId": "executeTest", "summary": "Execute a test", "description": "Execute a single test immediately. Creates a run and enqueues the test for execution. For k6 performance tests, an optional `location` can target an enabled location code or `global` for unrestricted any-worker routing.", "tags": [ "Tests" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "location": { "type": "string", "description": "Execution location for k6 performance tests. Use an enabled location code (for example `us-east`) or `global` for unrestricted any-worker routing. `global` is rejected when project location restrictions are enabled." } } } } } }, "responses": { "200": { "description": "Test execution started", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "runId": { "type": "string", "format": "uuid" }, "message": { "type": "string" } } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/api/monitors": { "get": { "operationId": "listMonitors", "summary": "List monitors", "description": "List all uptime and performance monitors in the current project.", "tags": [ "Monitors" ], "parameters": [ { "$ref": "#/components/parameters/Page" }, { "$ref": "#/components/parameters/Limit" } ], "responses": { "200": { "description": "Paginated list of monitors", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/PaginatedResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/Monitor" } } } } ] } } } }, "401": { "$ref": "#/components/responses/Unauthorized" } } }, "post": { "operationId": "createMonitor", "summary": "Create a monitor", "description": "Create a new uptime or performance monitor.", "tags": [ "Monitors" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MonitorCreateRequest" } } } }, "responses": { "201": { "description": "Monitor created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Monitor" } } } }, "400": { "description": "Invalid monitor payload" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "402": { "description": "Active subscription required" }, "403": { "$ref": "#/components/responses/Forbidden" } } } }, "/api/monitors/{id}": { "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "Monitor ID" } ], "get": { "operationId": "getMonitor", "summary": "Get monitor details", "description": "Retrieve full details for a monitor including recent check results.", "tags": [ "Monitors" ], "responses": { "200": { "description": "Monitor details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Monitor" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/NotFound" } } }, "patch": { "operationId": "updateMonitor", "summary": "Update a monitor", "description": "Update monitor configuration. Only provided fields are changed.", "tags": [ "Monitors" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MonitorUpdateRequest" } } } }, "responses": { "200": { "description": "Monitor updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Monitor" } } } }, "400": { "description": "Invalid monitor update payload" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" } } }, "delete": { "operationId": "deleteMonitor", "summary": "Delete a monitor", "description": "Permanently delete a monitor and its check history.", "tags": [ "Monitors" ], "responses": { "200": { "description": "Monitor deleted", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" } }, "required": [ "success", "message" ] } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/api/monitors/{id}/results": { "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "Monitor ID" } ], "get": { "operationId": "getMonitorResults", "summary": "Get monitor check results", "description": "Retrieve paginated check results for a monitor with optional date and location filters.", "tags": [ "Monitors" ], "parameters": [ { "$ref": "#/components/parameters/Page" }, { "$ref": "#/components/parameters/Limit" }, { "name": "date", "in": "query", "schema": { "type": "string", "format": "date" }, "description": "Filter results to a specific UTC date (`YYYY-MM-DD`)." }, { "name": "location", "in": "query", "schema": { "type": "string" }, "description": "Filter by execution location" } ], "responses": { "200": { "description": "Check results", "content": { "application/json": { "schema": { "allOf": [ { "$ref": "#/components/schemas/PaginatedResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/MonitorResult" } } } } ] } } } }, "400": { "description": "Invalid pagination or filter parameters" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/api/monitors/{id}/stats": { "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "Monitor ID" } ], "get": { "operationId": "getMonitorStats", "summary": "Get monitor statistics", "description": "Returns performance statistics including uptime percentage, average response time, and p95 latency.", "tags": [ "Monitors" ], "responses": { "200": { "description": "Monitor statistics", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MonitorStats" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/api/variables": { "get": { "operationId": "listVariables", "summary": "List variables", "description": "List all project variables for the current project. Secret values are redacted in the response. File-type variables include metadata such as type, fileName, fileSize, and mimeType.", "tags": [ "Variables" ], "responses": { "200": { "description": "List of variables", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Variable" } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" } } }, "post": { "operationId": "createVariable", "summary": "Create a variable", "description": "Create a new text or secret project variable. File-type variables are managed through the project UI upload workflow rather than this public JSON endpoint.", "tags": [ "Variables" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "key": { "type": "string", "example": "API_BASE_URL" }, "value": { "type": "string", "example": "https://api.example.com" }, "isSecret": { "type": "boolean", "default": false }, "description": { "type": "string" } }, "required": [ "key", "value" ] } } } }, "responses": { "201": { "description": "Variable created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Variable" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" } } } }, "/api/variables/{id}": { "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "Variable ID" } ], "get": { "operationId": "getVariable", "summary": "Get a variable", "description": "Retrieve a single variable. Secret values are redacted, and file-type variables return metadata rather than file contents.", "tags": [ "Variables" ], "responses": { "200": { "description": "Variable details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Variable" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/NotFound" } } }, "put": { "operationId": "updateVariable", "summary": "Update a variable", "description": "Update an existing text or secret variable's key, value, secret flag, or description. File-type variables must be managed through the project UI upload workflow.", "tags": [ "Variables" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "key": { "type": "string" }, "value": { "type": "string" }, "isSecret": { "type": "boolean" }, "description": { "type": "string" } } } } } }, "responses": { "200": { "description": "Variable updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Variable" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/NotFound" } } }, "delete": { "operationId": "deleteVariable", "summary": "Delete a variable", "description": "Permanently remove an environment variable from the project.", "tags": [ "Variables" ], "responses": { "200": { "description": "Variable deleted" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/api/tags": { "get": { "operationId": "listTags", "summary": "List tags", "description": "List all tags in the current project.", "tags": [ "Tags" ], "responses": { "200": { "description": "List of tags", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Tag" } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" } } }, "post": { "operationId": "createTag", "summary": "Create a tag", "description": "Create a new tag for organizing tests, monitors, and other resources.", "tags": [ "Tags" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "example": "production" }, "color": { "type": "string", "example": "#3B82F6" } }, "required": [ "name" ] } } } }, "responses": { "201": { "description": "Tag created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Tag" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" } } } }, "/api/tags/{id}": { "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "Tag ID" } ], "delete": { "operationId": "deleteTag", "summary": "Delete a tag", "description": "Delete a tag. Resources using this tag will have it removed.", "tags": [ "Tags" ], "responses": { "200": { "description": "Tag deleted" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/NotFound" } } }, "get": { "operationId": "getTag", "summary": "Get a tag", "description": "Return a single tag by ID.", "tags": [ "Tags" ], "responses": { "200": { "description": "Tag", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Tag" } } } }, "400": { "description": "Tag ID is required" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "500": { "description": "Internal server error" } } }, "put": { "operationId": "updateTag", "summary": "Update a tag", "description": "Rename a tag or change its color.", "tags": [ "Tags" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "name" ], "properties": { "name": { "type": "string" }, "color": { "type": "string", "nullable": true } } } } } }, "responses": { "200": { "description": "Updated tag", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Tag" } } } }, "400": { "description": "Tag name is required" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "500": { "description": "Internal server error" } } } }, "/api/notification-providers": { "get": { "operationId": "listNotificationProviders", "summary": "List notification providers", "description": "List all configured notification providers for the current project.", "tags": [ "Notifications" ], "responses": { "200": { "description": "List of notification providers", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/NotificationProvider" } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" } } }, "post": { "operationId": "createNotificationProvider", "summary": "Create a notification provider", "description": "Create a new notification provider (email, Slack, webhook, Telegram, Discord, or Teams).", "tags": [ "Notifications" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "example": "Slack Alerts" }, "type": { "type": "string", "enum": [ "email", "slack", "webhook", "telegram", "discord", "teams" ] }, "config": { "type": "object", "description": "Provider-specific configuration (e.g. `webhookUrl` for Slack)" } }, "required": [ "name", "type", "config" ] } } } }, "responses": { "201": { "description": "Provider created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotificationProvider" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" } } } }, "/api/notification-providers/{id}": { "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "Notification provider ID" } ], "get": { "operationId": "getNotificationProvider", "summary": "Get notification provider details", "description": "Retrieve configuration details of a notification provider.", "tags": [ "Notifications" ], "responses": { "200": { "description": "Provider details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotificationProvider" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/NotFound" } } }, "put": { "operationId": "updateNotificationProvider", "summary": "Update a notification provider", "description": "Update notification provider name, type, or configuration.", "tags": [ "Notifications" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string" }, "type": { "type": "string" }, "config": { "type": "object" } }, "required": [ "name", "type", "config" ] } } } }, "responses": { "200": { "description": "Provider updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NotificationProvider" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/NotFound" } } }, "delete": { "operationId": "deleteNotificationProvider", "summary": "Delete a notification provider", "description": "Remove a notification provider configuration.", "tags": [ "Notifications" ], "responses": { "200": { "description": "Provider deleted" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/api/notification-providers/test": { "post": { "operationId": "testNotificationProvider", "summary": "Send a test notification", "description": "Send a test notification to verify provider configuration before saving.", "tags": [ "Notifications" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "email", "slack", "webhook", "telegram", "discord", "teams" ] }, "config": { "type": "object" } }, "required": [ "type", "config" ] } } } }, "responses": { "200": { "description": "Test result", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" }, "error": { "type": "string" } } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" } } } }, "/api/alerts/history": { "get": { "operationId": "getAlertHistory", "summary": "Get alert history", "description": "View the history of triggered alerts for the current project.", "tags": [ "Alerts" ], "parameters": [ { "$ref": "#/components/parameters/Page" }, { "$ref": "#/components/parameters/Limit" } ], "responses": { "200": { "description": "Alert history", "content": { "application/json": { "schema": { "oneOf": [ { "type": "array", "items": { "$ref": "#/components/schemas/AlertHistoryEntry" } }, { "allOf": [ { "$ref": "#/components/schemas/PaginatedResponse" }, { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/AlertHistoryEntry" } } } } ] } ] } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "500": { "description": "Failed to fetch alert history" } } }, "post": { "operationId": "createAlertHistory", "summary": "Create an alert history entry", "description": "Record an alert event (for example a manually created failure or recovery signal). Requires monitor manage permission.", "tags": [ "Alerts" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "type", "message", "target", "targetType", "provider" ], "properties": { "type": { "type": "string" }, "message": { "type": "string" }, "target": { "type": "string" }, "targetType": { "type": "string" }, "provider": { "type": "string" }, "status": { "type": "string", "nullable": true }, "monitorId": { "type": "string", "format": "uuid", "nullable": true }, "jobId": { "type": "string", "format": "uuid", "nullable": true }, "errorMessage": { "type": "string", "nullable": true } } } } } }, "responses": { "201": { "description": "Alert history entry created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AlertHistoryEntry" } } } }, "400": { "description": "Missing required fields" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "500": { "description": "Internal server error" } } } }, "/api/audit": { "get": { "operationId": "getAuditLogs", "summary": "Get audit logs", "description": "View audit trail of organization actions. Requires admin permissions.", "tags": [ "Audit" ], "parameters": [ { "$ref": "#/components/parameters/Page" }, { "$ref": "#/components/parameters/Limit" }, { "name": "action", "in": "query", "schema": { "type": "string" }, "description": "Filter by action type" } ], "responses": { "200": { "description": "Audit log entries", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AuditResponse" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "500": { "description": "Failed to fetch audit logs" } } } }, "/api/status-pages": { "get": { "operationId": "listStatusPages", "summary": "List status pages", "description": "Fetch status pages for the current project.", "tags": [ "Status Pages" ], "responses": { "200": { "description": "Status page list", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StatusPageListResponse" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "500": { "description": "Failed to fetch status pages" } } } }, "/api/status-pages/check": { "get": { "operationId": "checkStatusPageSubdomain", "summary": "Check status page subdomain", "description": "Verify a status page subdomain is published and return its ID.", "tags": [ "Status Pages" ], "security": [], "parameters": [ { "name": "subdomain", "in": "query", "required": true, "schema": { "type": "string" }, "description": "Status page subdomain" } ], "responses": { "200": { "description": "Status page lookup", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "status": { "type": "string" } } } } } }, "400": { "description": "Subdomain parameter is required" }, "404": { "$ref": "#/components/responses/NotFound" } } }, "post": { "operationId": "checkStatusPageSubdomainPost", "summary": "Check status page subdomain (POST)", "description": "Verify a status page subdomain is published and return its ID. Public endpoint (no authentication required).", "tags": [ "Status Pages" ], "security": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "subdomain" ], "properties": { "subdomain": { "type": "string" } } } } } }, "responses": { "200": { "description": "Status page lookup", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "status": { "type": "string" } } } } } }, "400": { "description": "Invalid request" }, "404": { "$ref": "#/components/responses/NotFound" }, "500": { "description": "Internal server error" } } } }, "/api/status-pages/{id}": { "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "Status page ID" } ], "get": { "operationId": "getStatusPage", "summary": "Get status page details", "description": "Fetch a status page with components, monitors, and permissions.", "tags": [ "Status Pages" ], "responses": { "200": { "description": "Status page details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StatusPageDetailResponse" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "500": { "description": "Failed to fetch status page" } } }, "delete": { "operationId": "deleteStatusPage", "summary": "Delete a status page", "description": "Permanently deletes a status page and all its components.", "tags": [ "Status Pages" ], "responses": { "200": { "description": "Status page deleted", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" } }, "required": [ "success", "message" ] } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/api/status-pages/{id}/upload": { "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "Status page ID" } ], "post": { "operationId": "uploadStatusPageAsset", "summary": "Upload status page assets", "description": "Upload favicon, logo, or cover image for a status page.", "tags": [ "Status Pages" ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "file": { "type": "string", "format": "binary" }, "type": { "type": "string", "enum": [ "favicon", "logo", "cover" ] } }, "required": [ "file", "type" ] } } } }, "responses": { "200": { "description": "Upload successful", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" }, "url": { "type": "string" }, "s3Key": { "type": "string" }, "type": { "type": "string" } } } } } }, "400": { "description": "Invalid upload payload" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "404": { "$ref": "#/components/responses/NotFound" }, "500": { "description": "Failed to upload file" } } } }, "/api/status-pages/{id}/rss": { "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "Status page ID" } ], "get": { "operationId": "getStatusPageRss", "summary": "Get status page RSS feed", "description": "Returns an RSS feed for a published status page.", "tags": [ "Status Pages" ], "security": [], "responses": { "200": { "description": "RSS feed", "content": { "application/rss+xml": { "schema": { "type": "string" } } } }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "500": { "description": "Failed to generate RSS feed" } } } }, "/api/validate-script": { "post": { "operationId": "validateScript", "summary": "Validate a test script", "description": "Validate a Playwright or k6 script using the same server-side rules as the Playground and CLI preflight checks.", "tags": [ "Tests" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidationScriptRequest" } } } }, "responses": { "200": { "description": "Script is valid", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidationScriptSuccessResponse" } } } }, "400": { "description": "Script failed validation", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidationScriptErrorResponse" } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "500": { "description": "Validation service error" } } } }, "/api/monitors/{id}/status": { "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "Monitor ID" } ], "patch": { "operationId": "updateMonitorStatus", "summary": "Update monitor status", "description": "Pause, resume, or otherwise set a monitor's status (for example `paused` or `maintenance`). Requires monitor manage or update permission. Automated status changes from checks are handled separately.", "tags": [ "Monitors" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "status" ], "properties": { "status": { "type": "string", "enum": [ "up", "down", "paused", "pending", "maintenance", "error" ] } } } } } }, "responses": { "200": { "description": "Monitor status updated", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "id": { "type": "string", "format": "uuid" }, "status": { "type": "string", "enum": [ "up", "down", "paused", "pending", "maintenance", "error" ] }, "updatedAt": { "type": "string", "format": "date-time" } } } } } }, "400": { "description": "Invalid status value" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "500": { "description": "Internal server error" } } } }, "/api/monitors/{id}/notifications": { "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "Monitor ID" } ], "get": { "operationId": "getMonitorNotifications", "summary": "List monitor notification links", "description": "Return the notification providers linked to a monitor.", "tags": [ "Monitors" ], "responses": { "200": { "description": "Linked notification providers", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/MonitorNotificationLink" } } } } }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "500": { "description": "Internal server error" } } }, "post": { "operationId": "createMonitorNotification", "summary": "Link a notification provider to a monitor", "description": "Attach a notification provider to a monitor. The provider must belong to the same project as the monitor.", "tags": [ "Monitors" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "notificationProviderId" ], "properties": { "notificationProviderId": { "type": "string", "format": "uuid" } } } } } }, "responses": { "201": { "description": "Notification link created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MonitorNotificationLink" } } } }, "400": { "description": "Missing notification provider ID" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "description": "Monitor or provider not found" }, "409": { "description": "Monitor already linked to this provider" }, "500": { "description": "Internal server error" } } }, "delete": { "operationId": "deleteMonitorNotification", "summary": "Unlink a notification provider from a monitor", "description": "Remove a notification provider link from a monitor.", "tags": [ "Monitors" ], "parameters": [ { "name": "notificationProviderId", "in": "query", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "Notification provider to unlink" } ], "responses": { "200": { "description": "Notification link removed", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" } } } } } }, "400": { "description": "Missing notification provider ID" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "500": { "description": "Internal server error" } } } }, "/api/monitors/{id}/permissions": { "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "Monitor ID" } ], "get": { "operationId": "getMonitorPermissions", "summary": "Get monitor permissions", "description": "Return the current user's effective permissions for a monitor.", "tags": [ "Monitors" ], "responses": { "200": { "description": "Effective permissions", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MonitorPermissionsResponse" } } } }, "400": { "description": "Invalid monitor ID" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "500": { "description": "Internal server error" } } } }, "/api/monitors/{id}/location-stats": { "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "description": "Monitor ID" }, { "name": "days", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 90, "default": 7 }, "description": "Number of days to look back (1-90)" } ], "get": { "operationId": "getMonitorLocationStats", "summary": "Get monitor location stats", "description": "Return per-location aggregated statistics (uptime, response times) for a monitor over the requested window.", "tags": [ "Monitors" ], "responses": { "200": { "description": "Per-location statistics", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/MonitorLocationStats" } } } } }, "400": { "description": "Days must be between 1 and 90" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "500": { "description": "Internal server error" } } } } }, "components": { "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer", "description": "CLI token (`sck_live_*`) for full API access, or trigger key (`sck_trigger_*` / legacy `job_*`) for job trigger endpoint only." } }, "parameters": { "Page": { "name": "page", "in": "query", "schema": { "type": "integer", "default": 1, "minimum": 1, "example": 1 }, "description": "Page number for pagination" }, "Limit": { "name": "limit", "in": "query", "schema": { "type": "integer", "default": 20, "minimum": 1, "maximum": 100, "example": 20 }, "description": "Items per page" } }, "responses": { "Unauthorized": { "description": "Authentication required or token invalid", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "Unauthorized" } } } } } }, "NotFound": { "description": "Resource not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "Not found" } } } } } }, "Forbidden": { "description": "Insufficient permissions", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } } } } } } }, "schemas": { "PaginatedResponse": { "type": "object", "properties": { "pagination": { "type": "object", "properties": { "total": { "type": "integer" }, "page": { "type": "integer" }, "limit": { "type": "integer" }, "totalPages": { "type": "integer" }, "hasNextPage": { "type": "boolean" }, "hasPrevPage": { "type": "boolean" } } } } }, "Job": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "description": { "type": "string", "nullable": true }, "cronSchedule": { "type": "string", "nullable": true }, "status": { "type": "string", "enum": [ "pending", "running", "passed", "failed", "error" ] }, "alertConfig": { "anyOf": [ { "$ref": "#/components/schemas/JobAlertConfig" }, { "type": "null" } ], "description": "Alert configuration for this job" }, "tests": { "type": "array", "items": { "$ref": "#/components/schemas/Test" }, "description": "Tests associated with this job" }, "lastRun": { "anyOf": [ { "$ref": "#/components/schemas/JobLastRun" }, { "type": "null" } ] }, "testCount": { "type": "integer", "nullable": true }, "lastRunAt": { "type": "string", "format": "date-time", "nullable": true }, "nextRunAt": { "type": "string", "format": "date-time", "nullable": true }, "scheduledJobId": { "type": "string", "nullable": true }, "jobType": { "type": "string", "enum": [ "playwright", "k6" ], "nullable": true }, "organizationId": { "type": "string", "format": "uuid", "nullable": true }, "projectId": { "type": "string", "format": "uuid", "nullable": true }, "createdByUserId": { "type": "string", "format": "uuid", "nullable": true }, "createdAt": { "type": "string", "format": "date-time", "nullable": true }, "updatedAt": { "type": "string", "format": "date-time", "nullable": true } } }, "Run": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "jobId": { "type": "string", "format": "uuid", "nullable": true }, "jobName": { "type": "string", "nullable": true }, "jobType": { "type": "string", "enum": [ "playwright", "k6" ], "nullable": true }, "status": { "type": "string", "enum": [ "queued", "running", "passed", "failed", "error", "blocked" ] }, "trigger": { "type": "string", "enum": [ "manual", "remote", "schedule" ] }, "duration": { "type": "string", "description": "Formatted duration string", "nullable": true }, "durationMs": { "type": "integer", "description": "Duration in milliseconds", "nullable": true }, "startedAt": { "type": "string", "format": "date-time", "nullable": true }, "completedAt": { "type": "string", "format": "date-time", "nullable": true }, "logs": { "type": "string", "nullable": true }, "errorDetails": { "type": "string", "nullable": true }, "reportUrl": { "type": "string", "nullable": true, "description": "URL to the run report" }, "testCount": { "type": "integer", "nullable": true }, "location": { "type": "string", "nullable": true }, "projectId": { "type": "string", "format": "uuid", "nullable": true }, "organizationId": { "type": "string", "format": "uuid", "nullable": true } } }, "RunPermissionsResponse": { "type": "object", "properties": { "success": { "type": "boolean" }, "data": { "type": "object", "properties": { "userRole": { "type": "string" }, "projectId": { "type": "string", "format": "uuid" }, "organizationId": { "type": "string", "format": "uuid" } } } } }, "StatusPage": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "subdomain": { "type": "string" }, "status": { "type": "string" }, "pageDescription": { "type": "string", "nullable": true }, "allowRssFeed": { "type": "boolean" }, "faviconLogo": { "type": "string", "nullable": true }, "transactionalLogo": { "type": "string", "nullable": true }, "heroCover": { "type": "string", "nullable": true }, "createdAt": { "type": "string", "format": "date-time", "nullable": true }, "updatedAt": { "type": "string", "format": "date-time", "nullable": true } }, "additionalProperties": true }, "StatusPageComponentMonitor": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "type": { "type": "string" }, "status": { "type": "string" }, "target": { "type": "string" }, "weight": { "type": "number", "nullable": true } } }, "StatusPageComponent": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "description": { "type": "string", "nullable": true }, "position": { "type": "integer", "nullable": true }, "createdAt": { "type": "string", "format": "date-time", "nullable": true }, "updatedAt": { "type": "string", "format": "date-time", "nullable": true }, "monitors": { "type": "array", "items": { "$ref": "#/components/schemas/StatusPageComponentMonitor" } }, "monitorIds": { "type": "array", "items": { "type": "string", "format": "uuid" } } }, "additionalProperties": true }, "StatusPageDetailResponse": { "type": "object", "properties": { "statusPage": { "$ref": "#/components/schemas/StatusPage" }, "components": { "type": "array", "items": { "$ref": "#/components/schemas/StatusPageComponent" } }, "monitors": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "type": { "type": "string" }, "status": { "type": "string" } } } }, "canUpdate": { "type": "boolean" } } }, "StatusPageListResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/StatusPage" } }, "pagination": { "type": "object", "properties": { "total": { "type": "integer" }, "page": { "type": "integer" }, "limit": { "type": "integer" }, "totalPages": { "type": "integer" } } } } }, "AlertHistoryEntry": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "targetType": { "type": "string" }, "targetId": { "type": "string" }, "targetName": { "type": "string" }, "type": { "type": "string" }, "message": { "type": "string" }, "status": { "type": "string" }, "timestamp": { "type": "string", "format": "date-time" }, "notificationProvider": { "type": "string" }, "metadata": { "type": "object", "properties": { "errorMessage": { "type": "string", "nullable": true } }, "additionalProperties": true } } }, "AuditLogEntry": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "action": { "type": "string" }, "details": { "type": "object", "nullable": true }, "createdAt": { "type": "string", "format": "date-time" }, "user": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string", "nullable": true }, "email": { "type": "string", "nullable": true } } } } }, "AuditResponse": { "type": "object", "properties": { "success": { "type": "boolean" }, "data": { "type": "object", "properties": { "logs": { "type": "array", "items": { "$ref": "#/components/schemas/AuditLogEntry" } }, "pagination": { "type": "object", "properties": { "currentPage": { "type": "integer" }, "totalPages": { "type": "integer" }, "totalCount": { "type": "integer" }, "limit": { "type": "integer" }, "hasNext": { "type": "boolean" }, "hasPrev": { "type": "boolean" } } }, "filters": { "type": "object", "properties": { "actions": { "type": "array", "items": { "type": "string" } } } } } } } }, "Test": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string", "nullable": true }, "title": { "type": "string" }, "description": { "type": "string", "nullable": true }, "priority": { "type": "string", "enum": [ "low", "medium", "high" ], "description": "Test priority" }, "type": { "type": "string", "enum": [ "browser", "api", "performance", "database", "custom" ], "description": "Test type. `browser` = Playwright, `performance` = k6" }, "script": { "type": "string", "nullable": true, "description": "Test script content" }, "projectId": { "type": "string", "format": "uuid", "nullable": true }, "organizationId": { "type": "string", "format": "uuid", "nullable": true }, "tags": { "type": "array", "items": { "$ref": "#/components/schemas/Tag" } }, "createdAt": { "type": "string", "format": "date-time", "nullable": true }, "updatedAt": { "type": "string", "format": "date-time", "nullable": true } } }, "Monitor": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "organizationId": { "type": "string", "format": "uuid", "nullable": true }, "projectId": { "type": "string", "format": "uuid", "nullable": true }, "createdByUserId": { "type": "string", "format": "uuid", "nullable": true }, "name": { "type": "string" }, "description": { "type": "string", "nullable": true }, "target": { "type": "string", "description": "URL, host, or synthetic test target being monitored" }, "type": { "type": "string", "enum": [ "http_request", "website", "ping_host", "port_check", "synthetic_test" ] }, "status": { "type": "string", "enum": [ "up", "down", "paused", "pending", "maintenance", "error" ] }, "frequencyMinutes": { "type": "integer", "description": "Check interval in minutes" }, "enabled": { "type": "boolean" }, "config": { "anyOf": [ { "$ref": "#/components/schemas/MonitorConfig" }, { "type": "null" } ] }, "alertConfig": { "anyOf": [ { "$ref": "#/components/schemas/MonitorAlertConfig" }, { "type": "null" } ] }, "lastCheckAt": { "type": "string", "format": "date-time", "nullable": true }, "lastStatusChangeAt": { "type": "string", "format": "date-time", "nullable": true }, "mutedUntil": { "type": "string", "format": "date-time", "nullable": true }, "scheduledJobId": { "type": "string", "nullable": true }, "recentResults": { "type": "array", "items": { "$ref": "#/components/schemas/MonitorResult" } }, "createdAt": { "type": "string", "format": "date-time", "nullable": true }, "updatedAt": { "type": "string", "format": "date-time", "nullable": true } } }, "MonitorResult": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "monitorId": { "type": "string", "format": "uuid" }, "checkedAt": { "type": "string", "format": "date-time" }, "location": { "type": "string" }, "status": { "type": "string", "enum": [ "up", "down", "error", "timeout" ] }, "responseTimeMs": { "type": "integer", "nullable": true, "description": "Response time in milliseconds" }, "details": { "anyOf": [ { "$ref": "#/components/schemas/MonitorResultDetails" }, { "type": "null" } ] }, "isUp": { "type": "boolean" }, "isStatusChange": { "type": "boolean" }, "consecutiveFailureCount": { "type": "integer" }, "consecutiveSuccessCount": { "type": "integer" }, "alertsSentForFailure": { "type": "integer" }, "alertsSentForRecovery": { "type": "integer" }, "testExecutionId": { "type": "string", "nullable": true }, "testReportS3Url": { "type": "string", "nullable": true }, "executionGroupId": { "type": "string", "nullable": true } } }, "MonitorStats": { "type": "object", "properties": { "uptimePercent": { "type": "number", "format": "float" }, "avgResponseTime": { "type": "number", "format": "float" }, "p95ResponseTime": { "type": "number", "format": "float" }, "totalChecks": { "type": "integer" }, "successfulChecks": { "type": "integer" }, "failedChecks": { "type": "integer" } } }, "Variable": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "projectId": { "type": "string", "format": "uuid" }, "key": { "type": "string", "pattern": "^[A-Z][A-Z0-9_]*$", "minLength": 4, "maxLength": 20, "description": "Variable key. Uppercase letters, digits, and underscores only; 4-20 characters; must not use the `SUPERCHECK_` prefix or a reserved name (for example PATH, HOME)." }, "type": { "type": "string", "enum": [ "variable", "secret", "file" ], "description": "Variable type. File variables expose metadata in API responses; file contents are not returned." }, "value": { "type": "string", "description": "Plaintext for regular variables, redacted for secrets, and empty for file variables" }, "isSecret": { "type": "boolean" }, "description": { "type": "string", "nullable": true }, "fileName": { "type": "string", "nullable": true }, "fileSize": { "type": "integer", "nullable": true }, "mimeType": { "type": "string", "nullable": true }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time", "nullable": true } } }, "Tag": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "color": { "type": "string", "nullable": true } } }, "CliToken": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "start": { "type": "string", "description": "Display prefix (e.g. sck_live_a1b2...)" }, "enabled": { "type": "boolean" }, "expiresAt": { "type": "string", "format": "date-time", "nullable": true }, "lastRequest": { "type": "string", "format": "date-time", "nullable": true }, "createdAt": { "type": "string", "format": "date-time" } } }, "TriggerKey": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "start": { "type": "string", "description": "Display prefix (e.g. sck_trigger_f1e2...)" }, "enabled": { "type": "boolean" }, "jobId": { "type": "string", "format": "uuid" }, "expiresAt": { "type": "string", "format": "date-time", "nullable": true }, "lastRequest": { "type": "string", "format": "date-time", "nullable": true }, "createdByName": { "type": "string", "nullable": true }, "createdAt": { "type": "string", "format": "date-time" } } }, "NotificationProvider": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "type": { "type": "string", "enum": [ "email", "slack", "webhook", "telegram", "discord", "teams" ] }, "enabled": { "type": "boolean" }, "config": { "type": "object" }, "lastUsed": { "type": "string", "format": "date-time", "nullable": true }, "createdAt": { "type": "string", "format": "date-time" } } }, "AlertEvent": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "type": { "type": "string" }, "message": { "type": "string" }, "severity": { "type": "string", "enum": [ "info", "warning", "critical" ] }, "resourceId": { "type": "string", "format": "uuid" }, "resourceType": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" } } }, "AuditEntry": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "action": { "type": "string" }, "userId": { "type": "string", "format": "uuid" }, "userName": { "type": "string" }, "details": { "type": "object" }, "ipAddress": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" } } }, "Location": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "region": { "type": "string" } } }, "JobAlertConfig": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "notificationProviders": { "type": "array", "items": { "type": "string", "format": "uuid" } }, "alertOnFailure": { "type": "boolean" }, "alertOnSuccess": { "type": "boolean" }, "alertOnTimeout": { "type": "boolean" }, "failureThreshold": { "type": "integer", "minimum": 1 }, "recoveryThreshold": { "type": "integer", "minimum": 1 }, "customMessage": { "type": "string" } } }, "JobTestRef": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" } }, "required": [ "id" ] }, "JobLastRun": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "status": { "type": "string", "enum": [ "queued", "running", "passed", "failed", "error", "blocked" ] }, "errorDetails": { "type": "string", "nullable": true }, "durationMs": { "type": "integer", "nullable": true }, "startedAt": { "type": "string", "format": "date-time", "nullable": true }, "completedAt": { "type": "string", "format": "date-time", "nullable": true } } }, "JobCreateRequest": { "type": "object", "properties": { "name": { "type": "string", "example": "Nightly E2E Suite" }, "description": { "type": "string" }, "cronSchedule": { "type": "string", "example": "0 2 * * *" }, "tests": { "type": "array", "items": { "$ref": "#/components/schemas/JobTestRef" }, "minItems": 1, "description": "Array of test references to include in this job" }, "jobType": { "type": "string", "enum": [ "playwright", "k6" ], "default": "playwright" }, "alertConfig": { "$ref": "#/components/schemas/JobAlertConfig" } }, "required": [ "name", "tests" ] }, "JobCreateResponse": { "type": "object", "properties": { "success": { "type": "boolean" }, "job": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "description": { "type": "string", "nullable": true }, "cronSchedule": { "type": "string", "nullable": true }, "nextRunAt": { "type": "string", "format": "date-time", "nullable": true }, "scheduledJobId": { "type": "string", "nullable": true }, "jobType": { "type": "string", "enum": [ "playwright", "k6" ] } } } } }, "JobUpdateRequest": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "cronSchedule": { "type": "string" }, "tests": { "type": "array", "items": { "$ref": "#/components/schemas/JobTestRef" }, "minItems": 1 }, "alertConfig": { "$ref": "#/components/schemas/JobAlertConfig" } } }, "JobUpdateResponse": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "description": { "type": "string", "nullable": true }, "cronSchedule": { "type": "string", "nullable": true }, "nextRunAt": { "type": "string", "format": "date-time", "nullable": true }, "scheduledJobId": { "type": "string", "nullable": true }, "testCount": { "type": "integer" } } }, "JobTriggerResponseData": { "type": "object", "properties": { "jobId": { "type": "string", "format": "uuid" }, "jobName": { "type": "string" }, "runId": { "type": "string", "format": "uuid" }, "status": { "type": "string", "enum": [ "queued", "running" ] }, "position": { "type": "integer", "nullable": true }, "testCount": { "type": "integer" }, "triggeredBy": { "type": "string" }, "triggeredAt": { "type": "string", "format": "date-time" } } }, "JobTriggerResponse": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" }, "data": { "$ref": "#/components/schemas/JobTriggerResponseData" } } }, "JobTriggerInfoResponse": { "type": "object", "properties": { "success": { "type": "boolean" }, "job": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "name": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "running", "passed", "failed", "error" ] } } }, "triggerUrl": { "type": "string" }, "documentation": { "type": "object", "properties": { "method": { "type": "string" }, "headers": { "type": "object", "additionalProperties": { "type": "string" } }, "description": { "type": "string" }, "example": { "type": "string" }, "notes": { "type": "array", "items": { "type": "string" } } } } } }, "RunStatusResponse": { "type": "object", "properties": { "runId": { "type": "string", "format": "uuid" }, "jobId": { "type": "string", "format": "uuid", "nullable": true }, "status": { "type": "string", "enum": [ "queued", "running", "passed", "failed", "error", "blocked" ] }, "startedAt": { "type": "string", "format": "date-time", "nullable": true }, "completedAt": { "type": "string", "format": "date-time", "nullable": true }, "durationMs": { "type": "integer", "nullable": true, "description": "Duration in milliseconds" }, "errorDetails": { "type": "string", "nullable": true }, "reportUrl": { "type": "string", "nullable": true, "description": "URL to the detailed run report" } } }, "MonitorLocationConfig": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "locations": { "type": "array", "items": { "type": "string" } }, "threshold": { "type": "integer" }, "strategy": { "type": "string", "enum": [ "all", "majority", "any" ] } } }, "MonitorConfig": { "type": "object", "properties": { "method": { "type": "string", "enum": [ "GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS" ] }, "headers": { "type": "object", "additionalProperties": { "type": "string" } }, "body": { "type": "string" }, "expectedStatusCodes": { "type": "string" }, "keywordInBody": { "type": "string" }, "keywordInBodyShouldBePresent": { "type": "boolean" }, "responseBodyJsonPath": { "type": "object", "properties": { "path": { "type": "string" }, "expectedValue": {} } }, "auth": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "none", "basic", "bearer" ] }, "username": { "type": "string" }, "password": { "type": "string" }, "token": { "type": "string" } } }, "port": { "type": "integer" }, "protocol": { "type": "string", "enum": [ "tcp", "udp" ] }, "expectClosed": { "type": "boolean" }, "enableSslCheck": { "type": "boolean" }, "sslDaysUntilExpirationWarning": { "type": "integer" }, "sslCheckFrequencyHours": { "type": "integer" }, "sslLastCheckedAt": { "type": "string", "format": "date-time", "nullable": true }, "sslCheckOnStatusChange": { "type": "boolean" }, "checkExpiration": { "type": "boolean" }, "daysUntilExpirationWarning": { "type": "integer" }, "checkRevocation": { "type": "boolean" }, "timeoutSeconds": { "type": "integer", "minimum": 1 }, "regions": { "type": "array", "items": { "type": "string" } }, "locationConfig": { "$ref": "#/components/schemas/MonitorLocationConfig" }, "retryStrategy": { "type": "object", "properties": { "maxRetries": { "type": "integer" }, "backoffFactor": { "type": "integer" } } }, "alertChannels": { "type": "array", "items": { "type": "string" } }, "testId": { "type": "string", "format": "uuid" }, "testTitle": { "type": "string" }, "playwrightOptions": { "type": "object", "properties": { "headless": { "type": "boolean" }, "timeout": { "type": "integer" }, "retries": { "type": "integer" } } } }, "additionalProperties": true }, "MonitorAlertConfig": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "notificationProviders": { "type": "array", "items": { "type": "string", "format": "uuid" } }, "alertOnFailure": { "type": "boolean" }, "alertOnRecovery": { "type": "boolean" }, "alertOnSslExpiration": { "type": "boolean" }, "failureThreshold": { "type": "integer", "minimum": 1 }, "recoveryThreshold": { "type": "integer", "minimum": 1 }, "customMessage": { "type": "string" } } }, "MonitorResultDetails": { "type": "object", "properties": { "statusCode": { "type": "integer", "nullable": true }, "statusText": { "type": "string", "nullable": true }, "errorMessage": { "type": "string", "nullable": true }, "responseHeaders": { "type": "object", "additionalProperties": { "type": "string" } }, "responseBodySnippet": { "type": "string", "nullable": true }, "ipAddress": { "type": "string", "nullable": true }, "location": { "type": "string", "nullable": true }, "sslCertificate": { "type": "object", "properties": { "valid": { "type": "boolean" }, "issuer": { "type": "string", "nullable": true }, "subject": { "type": "string", "nullable": true }, "validFrom": { "type": "string", "nullable": true }, "validTo": { "type": "string", "nullable": true }, "daysRemaining": { "type": "integer", "nullable": true } } } }, "additionalProperties": true }, "MonitorCreateRequest": { "type": "object", "properties": { "name": { "type": "string", "example": "API Health Check" }, "description": { "type": "string" }, "type": { "type": "string", "enum": [ "http_request", "website", "ping_host", "port_check", "synthetic_test" ], "default": "http_request" }, "target": { "type": "string", "description": "URL, host, or synthetic test target to monitor" }, "frequencyMinutes": { "type": "integer", "description": "Check interval in minutes", "default": 5, "minimum": 1, "maximum": 1440, "example": 5 }, "enabled": { "type": "boolean", "default": true }, "config": { "$ref": "#/components/schemas/MonitorConfig" }, "alertConfig": { "$ref": "#/components/schemas/MonitorAlertConfig" } }, "required": [ "name", "type" ] }, "MonitorUpdateRequest": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" }, "type": { "type": "string", "enum": [ "http_request", "website", "ping_host", "port_check", "synthetic_test" ] }, "target": { "type": "string" }, "frequencyMinutes": { "type": "integer", "minimum": 1, "maximum": 1440 }, "enabled": { "type": "boolean" }, "status": { "type": "string", "enum": [ "up", "down", "paused", "pending", "maintenance", "error" ] }, "config": { "$ref": "#/components/schemas/MonitorConfig" }, "alertConfig": { "$ref": "#/components/schemas/MonitorAlertConfig" } } }, "ValidationScriptRequest": { "type": "object", "properties": { "script": { "type": "string", "description": "Test script content to validate" }, "testType": { "type": "string", "enum": [ "browser", "api", "performance", "database", "custom" ], "description": "Optional expected test type used for script/type compatibility checks" } }, "required": [ "script" ] }, "ValidationScriptSuccessResponse": { "type": "object", "properties": { "valid": { "type": "boolean", "const": true }, "message": { "type": "string" }, "warnings": { "type": "array", "items": { "type": "string" } } } }, "ValidationScriptErrorResponse": { "type": "object", "properties": { "valid": { "type": "boolean", "const": false }, "error": { "type": "string" }, "warnings": { "type": "array", "items": { "type": "string" } }, "line": { "type": "integer", "nullable": true }, "column": { "type": "integer", "nullable": true }, "errorType": { "type": "string", "nullable": true }, "suggestedType": { "type": "string", "enum": [ "browser", "api", "performance", "database", "custom" ], "nullable": true }, "isValidationError": { "type": "boolean" } } }, "MonitorNotificationLink": { "type": "object", "properties": { "id": { "type": "string", "format": "uuid" }, "monitorId": { "type": "string", "format": "uuid" }, "notificationProviderId": { "type": "string", "format": "uuid" } } }, "MonitorPermissionsResponse": { "type": "object", "properties": { "canView": { "type": "boolean" }, "canEdit": { "type": "boolean" }, "canDelete": { "type": "boolean" }, "canToggle": { "type": "boolean" }, "userRole": { "type": "string" } } }, "MonitorLocationStats": { "type": "object", "properties": { "location": { "type": "string" }, "totalChecks": { "type": "integer", "nullable": true }, "upChecks": { "type": "integer", "nullable": true }, "uptimePercentage": { "type": "number", "nullable": true }, "avgResponseTime": { "type": "number", "nullable": true }, "minResponseTime": { "type": "number", "nullable": true }, "maxResponseTime": { "type": "number", "nullable": true } } } } } }