Skip to main content

PATCH /api/auth/users/points

Updates the points balance for a specific user identified by email.

Authentication

No authentication required.

Request Body

email
string
required
Email address of the user whose points should be updated.
points
string
required
New points value to set for the user.

Request Example

{
  "email": "[email protected]",
  "points": "2500"
}

Response

message
string
Success message confirming points update.

Success Response (200 OK)

"Correct points update"

Error Responses

404 Not Found - User Does Not Exist

{
  "error": "User not valid"
}

cURL Example

curl -X PATCH https://api.example.com/api/auth/users/points \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "points": "2500"
  }'

Notes

  • Points value is stored as a string in the database
  • This endpoint does not add to existing points; it sets the absolute value
  • No validation is currently applied to the request body
  • Rate limiting is applied to this endpoint
  • Consider adding authentication/authorization for production use

Build docs developers (and LLMs) love