API Reference
API Reference
Authenticate and interact with the Test-Lab API
API Reference
The Test-Lab API enables you to trigger tests programmatically, perfect for CI/CD integration.
Base URL
https://test-lab.ai/api/v1Authentication
All API requests require authentication using an API key.
Getting an API Key
- Go to Dashboard → Settings → API Keys
- Click Create API Key
- Copy the key (shown only once)
Store your API key securely. It cannot be retrieved after creation.
Using the API Key
Include your key in the Authorization header:
curl -X POST https://test-lab.ai/api/v1/run \
-H "Authorization: Bearer tl_xxxxx" \
-H "Content-Type: application/json" \
-d '{"testPlanId": YOUR_TEST_PLAN_ID}'API Key Format
Keys are prefixed with tl_ for easy identification:
tl_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /v1/run | Trigger test runs |
Error Handling
HTTP Status Codes
| Code | Description |
|---|---|
| 200 | Success |
| 400 | Bad request - invalid parameters |
| 401 | Unauthorized - invalid or missing API key |
| 402 | Payment required - insufficient credits |
| 404 | Not found - resource doesn't exist |
| 429 | Rate limited - too many requests |
| 500 | Server error |
Error Response Format
{
"error": "Error message describing the issue"
}Credit Errors
When credits are insufficient:
{
"error": "Insufficient credits. Please top up to continue running tests."
}Rate Limits
- API calls: 100 requests per minute per API key
- Concurrent jobs: 10 parallel test runs
Environments
| Environment | Base URL |
|---|---|
| Production | https://test-lab.ai/api/v1 |
API Versioning
The API is versioned via URL path (/v1/). We'll communicate breaking changes in advance.
SDKs
Currently, we provide cURL and code examples. SDKs coming soon.