Skip to main content
POST /api/perfil Creates a new profile record. If bitAdministrador is true, full permissions (bitAgregar, bitEditar, bitConsulta, bitEliminar, bitDetalle) are automatically created in the permisos_perfil table for every existing module.

Request body

strNombrePerfil
string
required
Name of the new profile. Cannot be empty or whitespace-only.
bitAdministrador
boolean
default:"false"
Whether this profile has administrator-level access. When true, full permissions are automatically granted for all existing modules.

Response

success
boolean
required
true when the profile is created successfully.
data
object
required
The newly created profile record as returned by the database.

Error responses

StatusMessageCause
400El nombre del perfil es obligatoriostrNombrePerfil is missing or is an empty/whitespace string.
500No se pudo obtener el perfil recién creadoThe INSERT statement succeeded but the RETURNING clause returned no rows.
500Ocurrió un error interno al crear el perfilAny other unhandled database error.

Examples

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

Success response

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

Error response (400)

400
{
  "statusCode": 400,
  "message": "El nombre del perfil es obligatorio"
}

Build docs developers (and LLMs) love