> ## Documentation Index
> Fetch the complete documentation index at: https://docs.drime.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Register

> Create a new user account

## Overview

Creates a new Drime Cloud account and returns the user object with an access token.

<Note>
  This endpoint does not require authentication.
</Note>

## Request Body

<ParamField body="email" type="string" required>
  A valid email address for the new account
</ParamField>

<ParamField body="password" type="string" required>
  Password for the account (minimum 8 characters recommended)
</ParamField>

<ParamField body="device_name" type="string" required>
  A name to identify this device/application
</ParamField>

## Response

<ResponseField name="status" type="string">
  The status of the request (`success` or `error`)
</ResponseField>

<ResponseField name="user" type="object">
  The newly created user object with access token
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://app.drime.cloud/api/v1/auth/register \
    -H "Content-Type: application/json" \
    -d '{
      "email": "newuser@example.com",
      "password": "securepassword123",
      "device_name": "My App"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://app.drime.cloud/api/v1/auth/register', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      email: 'newuser@example.com',
      password: 'securepassword123',
      device_name: 'My App'
    })
  });

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

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

  response = requests.post(
      'https://app.drime.cloud/api/v1/auth/register',
      json={
          'email': 'newuser@example.com',
          'password': 'securepassword123',
          'device_name': 'My App'
      }
  )

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

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "status": "success",
    "user": {
      "id": 15844,
      "email": "newuser@example.com",
      "display_name": "newuser",
      "access_token": "124|xyz789...",
      "created_at": "2024-01-20T10:00:00.000000Z",
      "updated_at": "2024-01-20T10:00:00.000000Z"
    }
  }
  ```

  ```json 422 - Validation Error theme={null}
  {
    "status": "error",
    "message": "The given data was invalid.",
    "errors": {
      "email": "The email has already been taken."
    }
  }
  ```
</ResponseExample>
