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

Endpoint

POST /auth/login

Request Body

email
string
required
User email or username
password
string
required
User password
remember_me
boolean
default:false
Extended session duration

Example Request

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

Response

user
object
Authenticated user object
token
string
JWT access token (expires in 24h)
refresh_token
string
Refresh token (expires in 7 days or 30 days if remember_me)
expires_in
number
Token expiration time in seconds

Success Response (200)

{
  "user": {
    "id": "usr_1234567890",
    "email": "areeb@example.com",
    "username": "areeb",
    "avatar_url": "https://avatars.superbox.ai/areeb.jpg"
  },
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "refresh_token": "rt_abcdef123456...",
  "expires_in": 86400
}

Error Responses

{
  "error": "Authentication failed",
  "message": "Invalid email or password"
}

Using the Token

Include the token in the Authorization header:
curl https://api.superbox.ai/v1/servers \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."