Skip to main content
POST
/
api
/
v1
/
auth
/
login
Login
curl --request POST \
  --url https://api.superbox.ai/api/v1/auth/login \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "<string>",
  "password": "<string>",
  "provider": "<string>",
  "id_token": "<string>",
  "access_token": "<string>",
  "refresh_token": "<string>"
}
'
{
  "id_token": "<string>",
  "refresh_token": "<string>",
  "expires_in": 123,
  "email": "<string>",
  "local_id": "<string>"
}

Email / Password Login

Endpoint

POST /api/v1/auth/login

Request Body

email
string
required
Registered email address
password
string
required
Account password

Example Request

curl -X POST https://api.superbox.ai/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "password": "SecurePass123!"
  }'

Provider Login (Google / GitHub)

Exchange a Firebase-issued ID token or OAuth access token.

Endpoint

POST /api/v1/auth/login/provider

Request Body

provider
string
required
OAuth provider: google or github
id_token
string
Firebase ID token obtained from the provider. Use this OR access_token.
access_token
string
OAuth access token from the provider. Use this OR id_token.

Example Request

curl -X POST https://api.superbox.ai/api/v1/auth/login/provider \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "google",
    "id_token": "<firebase-google-id-token>"
  }'

Response

Both endpoints return the same response shape.
id_token
string
Firebase ID token (JWT). Use as Authorization: Bearer <id_token>.
refresh_token
string
Refresh token. Use with /auth/refresh to get a new ID token.
expires_in
number
Seconds until the ID token expires (3600 = 1 hour).
email
string
Authenticated email address.
local_id
string
Firebase user ID.

Success Response (200)

{
  "id_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6...",
  "refresh_token": "AMf-vByW3...",
  "expires_in": 3600,
  "email": "user@example.com",
  "local_id": "abc123def456"
}

Error Responses

{
  "status": "error",
  "detail": "Invalid email or password"
}

Token Refresh

Use the refresh token to obtain a new ID token before the current one expires.

Endpoint

POST /api/v1/auth/refresh

Request Body

refresh_token
string
required
Refresh token from a previous login or register response

Example

curl -X POST https://api.superbox.ai/api/v1/auth/refresh \
  -H "Content-Type: application/json" \
  -d '{"refresh_token": "AMf-vByW3..."}'

Using the Token

Include the id_token in all authenticated API requests:
curl https://api.superbox.ai/api/v1/servers \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6..."