Skip to main content
POST
https://api-dev.weir.ai/
/
auth
/
register
curl -X POST 'https://api.weir.ai/auth/register' \
  -H 'Content-Type: application/json' \
  -d '{
    "fullname": "John Doe",
    "email": "[email protected]",
    "password": "SecurePassword123!",
    "organization": {
      "name": "Acme Corporation",
      "type": "Platform",
      "description": "A business platform for NIL management"
    }
  }'
{
  "data": {
    "otpSession": "otp_session_123456789",
    "email": "[email protected]",
    "expiresIn": 300
  },
  "message": "Registration successful. Please verify your email with the OTP sent.",
  "status": "success"
}

User Registration

Register new users with automatic organization creation for platform or agency accounts.
curl -X POST 'https://api.weir.ai/auth/register' \
  -H 'Content-Type: application/json' \
  -d '{
    "fullname": "John Doe",
    "email": "[email protected]",
    "password": "SecurePassword123!",
    "organization": {
      "name": "Acme Corporation",
      "type": "Platform",
      "description": "A business platform for NIL management"
    }
  }'
{
  "data": {
    "otpSession": "otp_session_123456789",
    "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).
organization
object
required
Organization information for the new account.

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 with uppercase, lowercase, number, and special character",
      "organization.name": "Organization name is required"
    }
  },
  "status": "error"
}
Causes:
  • Invalid email format
  • Weak password
  • Missing required fields
  • Invalid organization type
{
  "error": {
    "code": "EMAIL_EXISTS",
    "message": "Email already registered",
    "details": "An account with this email already exists"
  },
  "status": "error"
}
Causes:
  • Email already registered in the system
  • Duplicate registration attempt
{
  "error": {
    "code": "RATE_LIMIT_EXCEEDED",
    "message": "Too many registration attempts",
    "details": "Rate limit exceeded. Please try again later."
  },
  "status": "error"
}
Solution: Wait for the rate limit window to reset before trying again.

Usage Examples

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

// Usage
const registrationData = await register({
  fullname: "John Doe",
  email: "[email protected]",
  password: "SecurePassword123!",
  organization: {
    name: "Acme Corporation",
    type: "Platform",
    description: "A business platform for NIL management"
  }
});
console.log('OTP Session:', registrationData.otpSession);

Registration Flow

User Registration

User submits registration form with email, password, and organization details.

OTP Sent

System sends OTP to the provided email address and returns OTP session ID.

Email Verification

User enters OTP using the validate registration endpoint with the OTP session ID.

Account Activated

Upon successful verification, the account is activated and user can login.

Password Requirements

  • Minimum 8 characters
  • At least one uppercase letter (A-Z)
  • At least one lowercase letter (a-z)
  • At least one number (0-9)
  • At least one special character (!@#$%^&*)

Organization Types

For platform businesses that host content and need NIL management capabilities.
For talent agencies managing multiple talent rosters and licensing.
For brands that need to manage NIL rights for advertising and marketing.

Best Practices

Validate Input

Validate all input fields on the client side before submission.

Secure Password

Implement password strength indicators and requirements.

Handle Errors

Display clear error messages for validation failures.

Complete Verification

Guide users through the email verification process.
Pro Tip: Store the OTP session ID securely and guide users to check their email immediately after registration. The OTP expires in 5 minutes.