Creating API Keys
1
Navigate to API Keys
Go to Project Admin → API Keys in the nunu.ai dashboard
2
Create a new key
Click Create API Key
3
Select permissions
Choose the permissions your key needs based on your use case
4
Save your key
Copy and securely store your key—it won’t be shown again
Using API Keys
Include your API key in theX-Api-Key header with every request:
Permissions
API keys are scoped to specific permissions. Request only the permissions your integration needs:| Permission | Description | Endpoints |
|---|---|---|
project:read-runs | Read run data, artifacts, and bug reports | GET /runs, GET /runs/{id}, GET /runs/{id}/bugs |
project:operate-runs | Start and stop test runs | POST /runs, POST /runs/stop |
project:manage-build-storage | Upload, manage, and delete builds | All /builds/* endpoints |
Combining Permissions
A single API key can have multiple permissions. For example, a CI/CD integration might need bothproject:manage-build-storage (to upload builds) and project:operate-runs (to trigger tests).
Key Management Best Practices
Use Environment Variables
Store API keys in environment variables, not in code:Rotate Keys Regularly
1
Create new key
Create a new API key with the same permissions
2
Update integrations
Update all integrations with the new key
3
Deactivate old key
Deactivate the old key after confirming the transition works
Use Separate Keys for Different Purposes
CI/CD Integration
CI/CD Integration
Permissions:
project:manage-build-storage + project:operate-runsUse for uploading builds and triggering tests from your CI/CD pipeline.Monitoring Dashboard
Monitoring Dashboard
Permissions:
project:read-runs onlyUse for read-only access to view test results and run history.Build Upload Only
Build Upload Only
Permissions:
project:manage-build-storage onlyUse when you only need to upload builds without triggering tests.Monitor Key Usage
Check the Last Used timestamp in Project Admin → API Keys to identify unused keys that should be removed.Key Expiration
API keys can be configured with an expiration date. After expiration, requests with that key will receive a403 Forbidden response.
Error Responses
Missing API Key (401)
X-Api-Key header in your request.
Invalid API Key (401)
Expired API Key (403)
Disabled API Key (403)
Missing Permission (403)
Security Recommendations
Server-Side Only
API keys should only be used in server-side or CI/CD environments
HTTPS Only
All API requests must use HTTPS
Least Privilege
Grant only the permissions each integration needs
Regular Audits
Review and remove unused API keys regularly
In CI/CD, use your platform’s secrets management (GitHub Secrets, GitLab CI Variables, Jenkins Credentials, etc.) to securely store API keys.