Skip to main content
POST
/
auth
/
register
Register
curl --request POST \
  --url https://api.example.com/auth/register \
  --header 'Content-Type: application/json' \
  --data '
{
  "username": "<string>",
  "email": "<string>",
  "password": "<string>"
}
'
{
  "error": "Error message details"
}

Request

Create a new user account with the provided credentials and information.
username
string
required
The desired username for the new account
email
string
required
The user’s email address
password
string
required
The password for the new account

Response

message
string
Success message confirming user registration

Examples

curl -X POST https://api.maytravel.com/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "username": "jane_smith",
    "email": "jane@example.com",
    "password": "securepassword456"
  }'

Success Response

{
  "message": "User registered succesfully"
}

Error Responses

{
  "error": "Error message details"
}

Error Codes

500
error
Internal server error - An error occurred during registration. This may indicate a duplicate username/email or database error

Notes

  • The role field is optional during registration and will be assigned a default value if not provided
  • Ensure the username and email are unique in the system
  • Password requirements and hashing should be implemented on the server side

Build docs developers (and LLMs) love