Skip to content
Last updated

POST /v1/auth/register - Register a new user account with email verification. Creates a new user account, sends a 4-digit verification code via email, and creates an EmailVerification record. User must verify their email using the /verify endpoint to complete registration.

POSThttps://api.aitronos.com/v1/auth/register

Request Body

email string required

User email address (primary identifier). Must be 1-255 characters and valid email format.

password string required

Password (min 8 chars with complexity, max 72 chars due to bcrypt limit).

full_name string required

User's full name (1-255 characters).

user_name string optional

Preferred username (defaults to email prefix if omitted, min 3 chars, max 100 chars). Can only contain lowercase letters, numbers, dots, underscores, and hyphens.

organization_id string optional

Organization ID to associate the user with (org_ prefixed, 36 characters total).

device_information object optional

Device tracking information.

Show device_information object properties

device string optional

Device name (e.g., "Chrome Browser", "iPhone").

platform string optional

Platform category (e.g., "web", "mobile", "desktop").

operating_system string optional

Operating system name.

device_id string optional

Unique device identifier.

user_agent string optional

User agent string.

location string optional

Geographic location.

latitude string optional

Latitude coordinate.

longitude string optional

Longitude coordinate.


Returns

A Register Response object containing user details and email verification key.

success boolean

Indicates if registration was successful.

user_id string

User ID (prg_ prefixed for pending registration).

email string

User's email address.

email_key string

Email verification key (UUID).

verification_required boolean

Whether email verification is required.

type string

Verification type. Always "registration".

message string

Human-readable message.

recommended_username string

Recommended username if not provided during registration (optional).

Bash
curl -X POST https://api.aitronos.com/v1/auth/register \
-H "Content-Type: application/json" \
-d '{
  "email": "user@company.com",
  "password": "SecurePassword123!",
  "full_name": "John Doe",
  "user_name": "johndoe",
  "organization_id": "org_1234567890abcdef"
}'

Response

{
  "success": true,
  "user_id": "prg_abc123def456",
  "email": "user@company.com",
  "email_key": "uuid-12345678-1234-1234-1234-123456789abc",
  "verification_required": true,
  "message": "Registration successful. Please check your email for a 4-digit verification code."
}