Skip to main content
This endpoint requires authentication and administrator privileges. Requests from non-admin users are rejected with 403.

Request body

targetUserId
string
required
UUID of the user account to block or unblock.
bloqueado
boolean
required
Set to true to block the account or false to unblock it.

Examples

curl --request PATCH \
  --url 'https://yourdomain.com/api/perfil/bloquear' \
  --cookie 'sb-access-token=<admin-session-cookie>' \
  --header 'Content-Type: application/json' \
  --data '{
    "targetUserId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "bloqueado": true
  }'

200 — success

{
  "message": "Operación exitosa"
}

400 — database error

{
  "error": "<database error message>"
}

401 — unauthenticated

{
  "error": "No autorizado"
}

403 — insufficient privileges

{
  "error": "No tienes permisos de administrador"
}

500 — internal server error

{
  "error": "Error interno"
}

Build docs developers (and LLMs) love