Skip to main content
POST
https://api-dev.weir.ai/
/
auth
/
m
/
register
curl -X POST 'https://api.weir.ai/auth/m/register' \
  -H 'Content-Type: application/json' \
  -d '{
    "fullname": "Jane Smith",
    "email": "[email protected]",
    "password": "SecurePassword123!"
  }'
{
  "data": {
    "otpSession": "otp_session_987654321",
    "email": "[email protected]",
    "expiresIn": 300
  },
  "message": "Registration successful. Please verify your email with the OTP sent.",
  "status": "success"
}

Mobile Registration

Simplified registration endpoint designed specifically for mobile applications without organization creation.
curl -X POST 'https://api.weir.ai/auth/m/register' \
  -H 'Content-Type: application/json' \
  -d '{
    "fullname": "Jane Smith",
    "email": "[email protected]",
    "password": "SecurePassword123!"
  }'
{
  "data": {
    "otpSession": "otp_session_987654321",
    "email": "[email protected]",
    "expiresIn": 300
  },
  "message": "Registration successful. Please verify your email with the OTP sent.",
  "status": "success"
}

Authentication

This endpoint does not require authentication as it’s used for new user registration.

Request Body

fullname
string
required
User’s full name. Must be between 2-100 characters.
email
string
required
User’s email address. Must be a valid email format and unique in the system.
password
string
required
User’s password. Must meet security requirements (min 8 characters, uppercase, lowercase, number, special character).

Response Fields

data
object
required
Registration data object containing OTP session information.
message
string
required
Human-readable message describing the result of the operation.
status
string
required
Operation status. Always “success” for successful registration.

Error Responses

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request parameters",
    "details": {
      "email": "Invalid email format",
      "password": "Password must be at least 8 characters"
    }
  },
  "status": "error"
}
{
  "error": {
    "code": "EMAIL_EXISTS",
    "message": "Email already registered",
    "details": "An account with this email already exists"
  },
  "status": "error"
}

Usage Examples

const mobileRegister = async (fullname, email, password) => {
  try {
    const response = await fetch('https://api.weir.ai/auth/m/register', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({ fullname, email, password })
    });
    
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    
    const data = await response.json();
    return data.data;
  } catch (error) {
    console.error('Mobile registration error:', error);
    throw error;
  }
};

// Usage
const registrationData = await mobileRegister(
  'Jane Smith',
  '[email protected]',
  'SecurePassword123!'
);
console.log('OTP Session:', registrationData.otpSession);

Mobile Registration Flow

User Input

Collect user’s fullname, email, and password through mobile UI.

Register

Submit registration data to mobile registration endpoint.

OTP Verification

Guide user to enter OTP received via email.

Complete Setup

After verification, user can complete profile and join/create organization.

Differences from Standard Registration

Mobile registration doesn’t create an organization. Users can join existing organizations or create one later.
Streamlined for mobile UX with fewer required fields.
Uses the same OTP verification process as standard registration.

Best Practices for Mobile Apps

  • Validate email format before submission
  • Show password strength indicator
  • Provide real-time validation feedback
  • Disable submit button until all fields are valid
  • Display user-friendly error messages
  • Handle network failures gracefully
  • Implement retry logic for transient failures
  • Provide offline state handling
  • Store OTP session securely in device keychain
  • Clear sensitive data from memory after use
  • Implement certificate pinning for API calls
  • Use secure storage for user credentials
  • Auto-focus on email field
  • Show loading indicators during API calls
  • Provide clear next steps after registration
  • Implement email verification reminders
Pro Tip: For mobile apps, implement a seamless flow from registration to OTP verification within the same screen sequence for better user experience.