API ReferenceAuthentication
Authentication
All Testably API requests require authentication via Bearer token. Generate a token from your project settings and include it in every request.
API Key Generation
- 1Navigate to Settings in your project
- 2Open the API & Tokens tab
- 3Click "New Token" button
- 4Enter a descriptive name for your token (e.g., "CI Pipeline", "Local Dev")
- 5Click Create to generate the token
- 6Copy the token immediately — it will only be shown once
Token format:
testably_xxxxxxxxxxxxBearer Token Usage
Include your API token in the Authorization header of every request using the Bearer scheme.
cURL
curl -X GET https://api.testably.app/v1/projects \ -H "Authorization: Bearer testably_xxxxxxxxxxxx" \ -H "Content-Type: application/json"
JavaScript (fetch)
const response = await fetch('https://api.testably.app/v1/projects', {
method: 'GET',
headers: {
'Authorization': 'Bearer testably_xxxxxxxxxxxx',
'Content-Type': 'application/json',
},
});
const data = await response.json();
console.log(data);Security Best Practices
Never hardcode API tokens in your source code. Always use environment variables or secret management tools.
Use environment variables
# .env TESTABLY_API_TOKEN=testably_xxxxxxxxxxxx
Add .env to .gitignore
# .gitignore .env .env.local .env.*.local
CI/CD Secret Management
GitHub Actions
Settings → Secrets → Actions
GitLab CI
Settings → CI/CD → Variables
Error Codes
| Code | Status | Description |
|---|---|---|
| 401 | Unauthorized | Invalid or missing API token. Check that your token is correct and included in the Authorization header. |
| 403 | Forbidden | Token does not have access to the requested resource. Verify the token has the required project scope. |
| 429 | Too Many Requests | Rate limit exceeded. You are allowed 60 requests per minute per token. Wait and retry with exponential backoff. |