Skip to main content
POST
https://api.superbox.ai
/
v1
/
auth
/
register
User Registration
curl --request POST \
  --url https://api.superbox.ai/v1/auth/register \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "<string>",
  "username": "<string>",
  "password": "<string>"
}
'
{
  "user": {
    "id": "<string>",
    "email": "<string>",
    "username": "<string>",
    "created_at": "<string>"
  },
  "token": "<string>",
  "refresh_token": "<string>"
}

Endpoint

POST /auth/register

Request Body

email
string
required
User email address
username
string
required
Unique username (3-50 characters)
password
string
required
Password (min 8 characters)

Example Request

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

Response

user
object
User object
token
string
JWT authentication token
refresh_token
string
Refresh token for obtaining new access tokens

Success Response (201)

{
  "user": {
    "id": "usr_1234567890",
    "email": "areeb@example.com",
    "username": "areeb",
    "avatar_url": null,
    "created_at": "2024-01-15T10:30:00Z"
  },
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "refresh_token": "rt_abcdef123456..."
}

Error Responses

{
  "error": "Validation failed",
  "details": {
    "email": "Invalid email format",
    "password": "Password must be at least 8 characters"
  }
}