Skip to main content
POST
/
api
/
auth
/
signup
Signup
curl --request POST \
  --url https://api.example.com/api/auth/signup \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "<string>",
  "password": "<string>"
}
'
{
  "msg": "Signup is only allowed with an @adgitmdelhi.ac.in email or a valid user ID."
}
This endpoint creates a new user account using email and password authentication. Only users with @adgitmdelhi.ac.in email addresses or valid user IDs are allowed to sign up.

Request Body

email
string
required
User’s email address. Must be an @adgitmdelhi.ac.in email or a valid user ID (5+ alphanumeric characters)
password
string
required
User’s password. Must be at least 6 characters long

Request Example

curl -X POST https://api.meetmates.com/api/auth/signup \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "password": "securepassword123"
  }'
{
  "email": "[email protected]",
  "password": "securepassword123"
}

Response

msg
string
Success or error message

Response Example

201 - Success
{
  "msg": "Signup successful."
}

Error Responses

msg
string
Error message describing what went wrong
error
string
System error message (for 500 errors)

Error Codes

{
  "msg": "Signup is only allowed with an @adgitmdelhi.ac.in email or a valid user ID."
}

Authentication

This endpoint does not require authentication. It is used to create a new account.

Validation Rules

Email Validation

The email must meet one of these criteria:
  • End with @adgitmdelhi.ac.in
  • Be a valid user ID (at least 5 alphanumeric characters)
Emails are normalized (trimmed and converted to lowercase) before validation.

Password Validation

  • Minimum length: 6 characters
  • No maximum length or complexity requirements

Notes

  • Passwords are hashed before storage using bcrypt
  • Email addresses are stored in lowercase
  • Duplicate emails are not allowed
  • After successful signup, users must use the /api/auth/login endpoint to obtain an authentication token
  • The password hashing happens automatically via the User model’s pre-save hook

Build docs developers (and LLMs) love