curl -X POST 'https://api.weir.ai/auth/register' \
-H 'Content-Type: application/json' \
-d '{
"fullname": "John Doe",
"email": "john.doe@example.com",
"password": "SecurePassword123!",
"organization": {
"name": "Acme Corporation",
"type": "Platform",
"description": "A business platform for NIL management"
}
}'
{
"data": {
"otpSession": "otp_session_123456789",
"email": "john.doe@example.com",
"expiresIn": 300
},
"message": "Registration successful. Please verify your email with the OTP sent.",
"status": "success"
}
Register new users with organization creation
curl -X POST 'https://api.weir.ai/auth/register' \
-H 'Content-Type: application/json' \
-d '{
"fullname": "John Doe",
"email": "john.doe@example.com",
"password": "SecurePassword123!",
"organization": {
"name": "Acme Corporation",
"type": "Platform",
"description": "A business platform for NIL management"
}
}'
{
"data": {
"otpSession": "otp_session_123456789",
"email": "john.doe@example.com",
"expiresIn": 300
},
"message": "Registration successful. Please verify your email with the OTP sent.",
"status": "success"
}
curl -X POST 'https://api.weir.ai/auth/register' \
-H 'Content-Type: application/json' \
-d '{
"fullname": "John Doe",
"email": "john.doe@example.com",
"password": "SecurePassword123!",
"organization": {
"name": "Acme Corporation",
"type": "Platform",
"description": "A business platform for NIL management"
}
}'
{
"data": {
"otpSession": "otp_session_123456789",
"email": "john.doe@example.com",
"expiresIn": 300
},
"message": "Registration successful. Please verify your email with the OTP sent.",
"status": "success"
}
Show Organization Properties
400 Bad Request
{
"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"
}
409 Conflict
{
"error": {
"code": "EMAIL_EXISTS",
"message": "Email already registered",
"details": "An account with this email already exists"
},
"status": "error"
}
429 Too Many Requests
{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Too many registration attempts",
"details": "Rate limit exceeded. Please try again later."
},
"status": "error"
}
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: "john.doe@example.com",
password: "SecurePassword123!",
organization: {
name: "Acme Corporation",
type: "Platform",
description: "A business platform for NIL management"
}
});
console.log('OTP Session:', registrationData.otpSession);
Minimum Requirements
Recommended Practices
Platform
Agency
Brand
Was this page helpful?