Authentication¶
Versioner uses two authentication methods depending on your use case:
| Method | Format | Use for |
|---|---|---|
| API Keys | sk_{account}_{id}_{random} |
CI/CD event tracking |
| Personal Access Tokens | pat_{...} |
Programmatic read access, agent integrations |
The web application uses session tokens internally — these aren't intended for direct API use.
API Keys¶
API keys authenticate event tracking from CI/CD systems:
POST /build-events/— track buildsPOST /deployment-events/— track deployments
Create and manage API keys under Settings → Integrations → API Keys in the Versioner app.
Usage¶
Include the key as a Bearer token:
import requests
response = requests.post(
"https://api.versioner.io/deployment-events/",
headers={
"Authorization": "Bearer sk_mycompany_k1_abc123def456...",
"Content-Type": "application/json"
},
json={
"product_name": "my-service",
"version": "1.2.3",
"environment_name": "production",
"status": "success"
}
)
const response = await fetch('https://api.versioner.io/deployment-events/', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk_mycompany_k1_abc123def456...',
'Content-Type': 'application/json'
},
body: JSON.stringify({
product_name: 'my-service',
version: '1.2.3',
environment_name: 'production',
status: 'success'
})
});
Multiple Keys¶
You can create multiple API keys per account — useful for key rotation, separating systems, or revoking a compromised key without disrupting others.
Rotating Keys¶
- Create a new key
- Update your systems to use it
- Verify it works
- Revoke the old key
Personal Access Tokens (PATs)¶
PATs are for programmatic access. They're user-scoped and designed for agents, scripts, and integrations that work with Versioner data. The MCP server uses PATs for this purpose.
Expanding scope
PAT support currently covers read operations. Write access via PATs is planned — check the interactive docs for the current endpoint list.
Create and manage PATs under Settings → Developer in the Versioner app.
Usage¶
Same Bearer token format as API keys:
Managing Keys¶
Security Best Practices¶
Never commit keys to source control:
# ❌ Wrong
env:
VERSIONER_API_KEY: sk_mycompany_k1_abc123...
# ✅ Right
env:
VERSIONER_API_KEY: ${{ secrets.VERSIONER_API_KEY }}
Use environment variables:
Limit access: give keys only to systems that need them, use separate keys per environment, revoke promptly when no longer needed.
Monitor usage: the last_used_at field on each key helps identify unused keys (candidates for revocation) and unexpected usage (potential compromise).
Authentication Errors¶
401 Unauthorized¶
Key is missing, invalid, or revoked.
- Verify the key is correct and hasn't been revoked
- Confirm the
Authorization: Bearerheader is present
403 Forbidden¶
Key is valid but lacks permission for the requested resource.
- Verify you're accessing resources within your account
- For write operations, ensure you're using a JWT session (web app) or wait for PAT write support
No Authentication Required¶
GET /healthGET /docs,GET /redoc,GET /openapi.json
Next Steps¶
- Event Tracking — submit deployment and build events
- Event Types — status values and payload details
- Response Codes — error handling
- Interactive Docs — explore all endpoints with current auth requirements