Skip to main content
POST
/
api
/
PermisoPerfil
/
guardar-permisos
curl --request POST \
  --url https://your-api-host/api/PermisoPerfil/guardar-permisos \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "IdPerfil": 2,
    "Modulos": [
      {
        "IdModulo": 3,
        "BitAgregar": true,
        "BitEditar": true,
        "BitConsulta": true,
        "BitEliminar": false,
        "BitDetalle": true
      },
      {
        "IdModulo": 5,
        "BitAgregar": false,
        "BitEditar": false,
        "BitConsulta": true,
        "BitEliminar": false,
        "BitDetalle": true
      }
    ]
  }'
{
  "message": "Permisos Actualizados Correctamente"
}
Replaces all existing permission records for the specified profile with the submitted set. This is the primary way to manage what a profile can do — send one request with every module the profile should have access to.

Authentication

Requires a valid Bearer token.
Authorization: Bearer <token>

Permissions

Requires the permisosperfil.editar permission. Returns 403 Forbidden if the authenticated user’s profile does not have this permission.
This operation replaces the profile’s existing permissions entirely. Any module not included in the request body will lose its permissions for that profile. Always send the complete desired permission set, not just the changes.

Request body

IdPerfil
integer
required
ID of the profile whose permissions will be replaced.
Modulos
object[]
required
List of module permission objects. Must contain at least one entry.

Response fields

message
string
Confirmation message on success.

Examples

curl --request POST \
  --url https://your-api-host/api/PermisoPerfil/guardar-permisos \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "IdPerfil": 2,
    "Modulos": [
      {
        "IdModulo": 3,
        "BitAgregar": true,
        "BitEditar": true,
        "BitConsulta": true,
        "BitEliminar": false,
        "BitDetalle": true
      },
      {
        "IdModulo": 5,
        "BitAgregar": false,
        "BitEditar": false,
        "BitConsulta": true,
        "BitEliminar": false,
        "BitDetalle": true
      }
    ]
  }'
{
  "message": "Permisos Actualizados Correctamente"
}
To read the current permissions for a profile before overwriting them, use List profile permissions.

Build docs developers (and LLMs) love