Savannah Cloud

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_... or Authorization: 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/json

Request 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/json

Request 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

RolePermissions
ownerFull org access, invite/remove users, manage billing and deployments
adminFull operational access, not allowed to remove the owner
memberRead/write access for jobs, deployments, and basic project work

Error responses

StatusMeaning
401Missing or invalid credentials
403Authenticated but insufficient permissions
404User or org not found

JWTs are short-lived session credentials and must be refreshed by logging in again once expired.

On this page