Skip to main content
POST
/
api
/
auth
/
register
Register
curl --request POST \
  --url https://api.example.com/api/auth/register \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "<string>",
  "fullName": "<string>",
  "password": "<string>",
  "phone": "<string>"
}
'
{
  "success": true,
  "data": {
    "user": {
      "id": "<string>",
      "email": "<string>",
      "fullName": "<string>",
      "phone": {},
      "avatar": {},
      "emailVerified": true,
      "createdAt": "<string>"
    },
    "accessToken": "<string>",
    "refreshToken": "<string>"
  }
}
Creates a new user account with email, password, and profile information. Returns the user object along with access and refresh tokens for immediate authentication.

Request Body

email
string
required
User’s email address. Must be a valid email format with maximum 320 characters.
fullName
string
required
User’s full name. Minimum 2 characters, maximum 255 characters.
password
string
required
User’s password. Minimum 8 characters, maximum 100 characters.
phone
string
User’s phone number. Maximum 20 characters. Optional.

Response

success
boolean
Indicates if the request was successful.
data
object
Contains the registration result.

Error Responses

409 Conflict
Email address is already registered.
{
  "success": false,
  "error": {
    "message": "Email already registered",
    "statusCode": 409
  }
}
400 Bad Request
Invalid request body or validation error.
{
  "success": false,
  "error": {
    "message": "Validation error",
    "statusCode": 400,
    "details": []
  }
}

Example Request

curl -X POST https://api.example.com/api/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "fullName": "John Doe",
    "password": "securePassword123",
    "phone": "+1234567890"
  }'

Example Response

{
  "success": true,
  "data": {
    "user": {
      "id": "clx1234567890abcdef",
      "email": "[email protected]",
      "fullName": "John Doe",
      "phone": "+1234567890",
      "avatar": null,
      "emailVerified": false,
      "createdAt": "2026-03-04T10:30:00.000Z"
    },
    "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "refreshToken": "rt_clx1234567890abcdef"
  }
}

Build docs developers (and LLMs) love