Skip to main content

POST /user

Create a new user account.

Request

email
string
required
User’s email address (must be unique)
password
string
required
User’s password (minimum requirements apply)
name
string
required
User’s full name
phone
string
User’s phone number

Response

success
boolean
Indicates if registration was successful
user
object
Created user object with details
curl -X POST https://api.yourdomain.com/user \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "password": "SecurePass123!",
    "name": "John Doe",
    "phone": "+1234567890"
  }'
{
  "success": true,
  "user": {
    "id": "usr_123456",
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "+1234567890",
    "createdAt": "2026-03-07T10:30:00Z"
  }
}

POST /user/login

Authenticate a user and receive an access token.

Request

email
string
required
User’s email address
password
string
required
User’s password

Response

token
string
JWT authentication token
userdata
object
Authenticated user information
curl -X POST https://api.yourdomain.com/user/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "password": "SecurePass123!"
  }'
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJ1c3JfMTIzNDU2IiwiaWF0IjoxNzA5ODE2NDAwfQ.signature",
  "userdata": {
    "id": "usr_123456",
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "+1234567890"
  }
}

POST /user/request-reset

Request a password reset email.

Request

email
string
required
Email address of the account to reset

Response

message
string
Success message indicating email was sent
curl -X POST https://api.yourdomain.com/user/request-reset \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]"
  }'
{
  "message": "Password reset instructions sent to your email"
}

GET /user/reset/:token

Verify a password reset token is valid.

Path Parameters

token
string
required
Password reset token from email

Response

valid
boolean
Whether the token is valid and not expired
curl -X GET https://api.yourdomain.com/user/reset/abc123token456
{
  "valid": true
}

PUT /user/:userId

Update user profile information.
Requires authentication. Include Bearer token in Authorization header.

Path Parameters

userId
string
required
ID of the user to update

Request Body

name
string
Updated user name
email
string
Updated email address
phone
string
Updated phone number
password
string
New password (if changing)

Response

user
object
Updated user object
curl -X PUT https://api.yourdomain.com/user/usr_123456 \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "John Updated Doe",
    "phone": "+0987654321"
  }'
{
  "user": {
    "id": "usr_123456",
    "email": "[email protected]",
    "name": "John Updated Doe",
    "phone": "+0987654321",
    "updatedAt": "2026-03-07T11:45:00Z"
  }
}

Authentication Flow

Error Codes

StatusDescription
200Success
201User created successfully
400Invalid request data
401Invalid credentials or expired token
404User not found
409Email already exists
500Server error

Build docs developers (and LLMs) love