POST /auth/signup

Registers a new user and returns a JWT token.

application/json

Body Required

  • email string(email)

    User's email address

  • password string

    User's password

  • firstName string

    User's first name

  • lastName string

    User's last name

  • dateOfBirth string(date)

    User's date of birth

  • phoneNumber string

    User's phone number (optional)

Responses

  • 201 application/json

    Successful registration

    Hide response attributes Show response attributes object
    • success boolean
    • code integer(int32)
    • message string
    • data object
      Hide data attributes Show data attributes object
      • id string

        Unique identifier for the user

      • email string(email)

        User's email address

      • firstName string

        User's first name

      • lastName string

        User's last name

      • dateOfBirth string(date)

        User's date of birth

      • avatarUrl string | null

        URL of the user's profile avatar

      • createdAt string(date-time)

        Timestamp when the user profile was created

      • updatedAt string(date-time)

        Timestamp when the user profile was last updated

      • phoneNumber string | null

        User's phone number (optional)

  • 400 application/json

    Bad Request - Invalid input data

    Hide response attributes Show response attributes object
    • success boolean
    • code integer
    • errorCode string
    • message string
    • timestamp string(date-time)
  • 500 application/json

    Internal Server Error

    Hide response attributes Show response attributes object
    • success boolean
    • code integer
    • errorCode string
    • message string
    • timestamp string(date-time)
POST /auth/signup
curl \
 --request POST 'https://api.huy-devops.site/api/auth/signup' \
 --header "Content-Type: application/json" \
 --data '{"email":"user@example.com","password":"Password@123","firstName":"John","lastName":"Doe","dateOfBirth":"1990-01-01","phoneNumber":"+1234567890"}'
Request examples
{
  "email": "user@example.com",
  "password": "Password@123",
  "firstName": "John",
  "lastName": "Doe",
  "dateOfBirth": "1990-01-01",
  "phoneNumber": "+1234567890"
}
Response examples (201)
{
  "success": true,
  "code": 200,
  "message": "string",
  "data": {
    "id": "user_12345",
    "email": "user@example.com",
    "firstName": "John",
    "lastName": "Doe",
    "dateOfBirth": "1990-01-01",
    "avatarUrl": "https://cdn.example.com/avatars/user_12345.jpg",
    "createdAt": "2025-08-30T10:30:00Z",
    "updatedAt": "2025-08-30T15:45:00Z",
    "phoneNumber": "+1234567890"
  }
}
Response examples (400)
{
  "success": false,
  "code": 42,
  "errorCode": "string",
  "message": "string",
  "timestamp": "2025-05-04T09:42:00Z"
}
Response examples (500)
{
  "success": false,
  "code": 42,
  "errorCode": "string",
  "message": "string",
  "timestamp": "2025-05-04T09:42:00Z"
}