Update group balance

POST /user/balance/update


Description

The method updates the balance of the specified group by a given amount. Used for manual deposit or deduction of group balance.


Request format

  • HTTP method: POST
  • URL: /user/balance/update
  • Content-Type: application/json
  • Authorization: required

Request parameters

ParameterTypeWhere passedRequiredDescription
tokenstringHeaderUser JWT token

Request body (JSON)

FieldTypeRequiredDescription
groupIdintegerIdentifier of the group
amountnumberAmount to modify the balance (may be negative)

Example request (cURL)

curl -X POST "https://api.enface.ai/user/balance/update" 
  -H "Content-Type: application/json" 
  -H "Authorization: Bearer jwt.temporary.token" 
  -d '{
    "groupId": 1,
    "amount": 1000
  }'

Response examples

Success (200 OK)
{
  "status": "ok"
}
Error (400 Bad Request)
{
  "message": "invalid schema",
  "status": "error"
}
Error (401 Unauthorized)
{
  "message": "access denied",
  "status": "error"
}
Error (404 Not Found)
{
  "message": "item with this id does not found",
  "status": "error"
}