Skip to main content

POST /api/auth/register

Creates a new user account with Supabase Auth, creates a profile, and enrolls the user in Loops.so for email campaigns.

Request Body

{
  "email": "[email]",
  "password": "securePassword123",
  "firstName": "John",
  "surname": "Doe",
  "username": "johndoe",
  "location": "New York, USA",
  "bio": "Fujifilm enthusiast",
  "instagramHandle": "johndoe_photo",
  "avatarFile": "<base64 encoded image>"
}
FieldTypeRequiredValidation
emailstringYesValid email
passwordstringYesMin 8 characters
firstNamestringYes3-20 characters
surnamestringYes3-20 characters
usernamestringYes3-20 characters, unique
locationstringYes
biostringYesMax 120 characters
instagramHandlestringNo
avatarFilestringNoBase64 image

Response (201)

{
  "user": {
    "id": "uuid",
    "email": "[email]",
    "username": "johndoe"
  },
  "message": "Account created successfully"
}

Errors

StatusCodeReason
400VALIDATION_ERRORMissing or invalid fields
409CONFLICTEmail or username already exists