> ## Documentation Index
> Fetch the complete documentation index at: https://acm-aa28ebf6.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Register

> Create a new SuperBox account with email and password

## Endpoint

```
POST /api/v1/auth/register
```

<Info>
  Registration uses a two-step OTP verification flow. Call `/auth/register/send-otp` first to trigger email verification, then call this endpoint after the user verifies.
</Info>

## Request Body

<ParamField body="email" type="string" required>
  User email address
</ParamField>

<ParamField body="password" type="string" required>
  Account password (minimum 8 characters)
</ParamField>

<ParamField body="display_name" type="string">
  Display name shown in the UI
</ParamField>

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.superbox.ai/api/v1/auth/register \
    -H "Content-Type: application/json" \
    -d '{
      "email": "user@example.com",
      "password": "SecurePass123!",
      "display_name": "Your Name"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.superbox.ai/api/v1/auth/register", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      email: "user@example.com",
      password: "SecurePass123!",
      display_name: "Your Name",
    }),
  });

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api.superbox.ai/api/v1/auth/register",
      json={
          "email": "user@example.com",
          "password": "SecurePass123!",
          "display_name": "Your Name",
      },
  )

  data = response.json()
  ```
</CodeGroup>

## Response

<ResponseField name="id_token" type="string">
  Firebase ID token (JWT). Use this as `Authorization: Bearer <id_token>` for API requests.
</ResponseField>

<ResponseField name="refresh_token" type="string">
  Long-lived refresh token used to obtain new ID tokens via `/auth/refresh`.
</ResponseField>

<ResponseField name="expires_in" type="number">
  Seconds until the ID token expires (3600 = 1 hour).
</ResponseField>

<ResponseField name="email" type="string">
  Registered email address.
</ResponseField>

<ResponseField name="local_id" type="string">
  Firebase user ID.
</ResponseField>

### Success Response (201)

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

### Error Responses

<CodeGroup>
  ```json 400 - Validation Error theme={null}
  {
    "status": "error",
    "detail": "Invalid request: email is required"
  }
  ```

  ```json 409 - Conflict theme={null}
  {
    "status": "error",
    "detail": "Email already registered"
  }
  ```
</CodeGroup>
