Authentication
JWT and API key authentication for the Savannah Cloud API.
Overview
All protected endpoints require one of the following:
- JWT token —
Authorization: Bearer <token> - API key —
X-API-Key: sc_...orAuthorization: Bearer sc_...
JWTs are issued by /auth/register and /auth/login, while API keys are managed by the org and are scoped to a single tenant.
Register organization
POST /auth/register
Content-Type: application/jsonRequest body
{
"org_name": "Acme Corp",
"email": "admin@acme.com",
"password": "yourpassword"
}Response 200
{
"token": "eyJhbGci...",
"user": {
"id": "usr_...",
"email": "admin@acme.com",
"role": "owner"
},
"org": {
"id": "org_...",
"name": "Acme Corp"
}
}Login
POST /auth/login
Content-Type: application/jsonRequest body
{
"email": "admin@acme.com",
"password": "yourpassword"
}Response 200
{
"token": "eyJhbGci...",
"user": {
"id": "usr_...",
"email": "admin@acme.com",
"role": "owner"
}
}Current user
GET /auth/me
Authorization: Bearer <token>Response 200
{
"id": "usr_...",
"email": "admin@acme.com",
"role": "owner",
"org_id": "org_..."
}Roles
| Role | Permissions |
|---|---|
owner | Full org access, invite/remove users, manage billing and deployments |
admin | Full operational access, not allowed to remove the owner |
member | Read/write access for jobs, deployments, and basic project work |
Error responses
| Status | Meaning |
|---|---|
401 | Missing or invalid credentials |
403 | Authenticated but insufficient permissions |
404 | User or org not found |
JWTs are short-lived session credentials and must be refreshed by logging in again once expired.