Skip to main content
PUT /api/perfil/:id Updates the strNombrePerfil and bitAdministrador fields of an existing profile. The endpoint also manages permisos_perfil records automatically based on the change in administrator status:
  • Was not admin → now admin: all existing permissions for this profile are deleted and replaced with full permissions for every existing module.
  • Was admin → no longer admin: all permissions for this profile are deleted, leaving the profile with no module access.
  • No change to admin flag: existing permissions are left unchanged.

Path parameters

id
number
required
Primary key of the profile to update.

Request body

strNombrePerfil
string
required
Updated profile name. Cannot be empty or whitespace-only.
bitAdministrador
boolean
required
Updated administrator flag.

Response

success
boolean
required
true when the update completes without error.
data
object
required
The updated profile record as returned by the database.

Error responses

StatusMessageCause
400ID de perfil inválidoThe :id path segment is missing or resolves to 0 or NaN.
400El nombre es obligatoriostrNombrePerfil is missing or is an empty/whitespace string.
404Perfil no encontradoNo record exists with the given id.
500Ocurrió un error interno al actualizar el perfilAny other unhandled database error.

Examples

curl --request PUT \
  --url https://your-domain.com/api/perfil/4 \
  --header 'Content-Type: application/json' \
  --cookie 'auth_token=<your-jwt>' \
  --data '{
    "strNombrePerfil": "Supervisor Senior",
    "bitAdministrador": false
  }'

Success response

200
{
  "success": true,
  "data": {
    "id": 4,
    "strNombrePerfil": "Supervisor Senior",
    "bitAdministrador": false
  }
}

Error response (404)

404
{
  "statusCode": 404,
  "message": "Perfil no encontrado"
}

Build docs developers (and LLMs) love