Skip to content

User Serializer

Description

Handles user creation, update, and profile management.

Fields

Field Description Required
id Auto-generated user ID. Read-only
email Email address of the user. Yes
password User's password. Write-only
confirm_password Password confirmation. Write-only
first_name User's first name. No
last_name User's last name. No
phone User's phone number. No
photo Profile picture upload. No
address User's address. No
gender User's gender. No
country User's country. No
has_initial_profile Boolean to indicate if the user completed the initial profile setup. Read-only
created_at Timestamp for when the record was created. Read-only
updated_at Timestamp for the last modification. Read-only

Validation

  • Password and confirm_password must match.
  • Validates file type for photo uploads.

Examples

Request Payload for Creation:

{
  "email": "example@domain.com",
  "password": "password123",
  "confirm_password": "password123",
  "first_name": "John",
  "last_name": "Doe",
  "phone": "+1234567890"
}