Skip to main content

Add/Remove Score to a User

This endpoint adds or removes score points from a user.

The score change is registered as a manual reputation adjustment.

info

This operation requires admin or moderation role.

HTTP Request

POST /api/v2/score/

Parameters

NameInTypeRequiredDescription
user_idbodyintegerfalseA unique integer value identifying the user
usernamebodystringfalseUsername identifying the user
scorebodyintegertruePositive or negative integer value
reputation_contextbodystringfalsePipe-separated values used to classify and filter the score change
commentbodystringfalseA comment about this operation

Notes

  • You must specify either user_id or username.
  • You cannot specify both user_id and username.
  • score can be positive or negative.
  • score cannot be 0.
  • You must specify either reputation_context or comment.
  • reputation_type is automatically set to manual.

Example Body Parameters

{
"username": "mario.rossi",
"score": 10,
"reputation_context": "contest|first_place|apis",
"comment": "Winner of the APIS contest"
}

Example Request

curl -X POST /api/v2/score/ \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {access_token}" \
--data-raw '{
"username": "mario.rossi",
"score": 10,
"reputation_context": "contest|first_place|apis",
"comment": "Winner of the APIS contest"
}'

Responses

StatusMeaningDescription
201CreatedScore change created
400Bad RequestInvalid request body
401UnauthorizedMissing or invalid access token
403ForbiddenUser does not have moderation permissions

Example response

{
"id": 456,
"user": {
"id": 123,
"username": "mario.rossi",
"real_name": "Mario Rossi",
"avatar": "https://example.com/avatar.jpg",
"reputation": 110
},
"score": 10,
"reputation_type": 10,
"reputation_type_description": "manual",
"comment": "Winner of the APIS contest",
"reputation_context": "contest|first_place|apis",
"created_by": {
"id": 1,
"username": "moderator",
"avatar": "https://example.com/avatar.jpg"
},
"reputed_at": "2026-05-20T10:30:00Z"
}