Two endpoints are available. Use the first to retrieve permissions for every profile, or the second to narrow results to a single profile.
Authentication
Both endpoints require a valid Bearer token.
Authorization : Bearer <token>
GET /api/PermisoPerfil
Returns permission records for all profiles across all modules.
curl --request GET \
--url https://your-api-host/api/PermisoPerfil \
--header 'Authorization: Bearer <token>'
[
{
"IdPperfil" : 1 ,
"IdModulo" : 3 ,
"IdPerfil" : 2 ,
"BitAgregar" : true ,
"BitEditar" : true ,
"BitConsulta" : true ,
"BitEliminar" : false ,
"BitDetalle" : true ,
"Modulo" : {
"IdModulo" : 3 ,
"strNombreModulo" : "Usuarios" ,
"Ruta" : "/usuarios" ,
"Clave" : "usuarios"
}
},
{
"IdPperfil" : 2 ,
"IdModulo" : 5 ,
"IdPerfil" : 2 ,
"BitAgregar" : false ,
"BitEditar" : false ,
"BitConsulta" : true ,
"BitEliminar" : false ,
"BitDetalle" : true ,
"Modulo" : {
"IdModulo" : 5 ,
"strNombreModulo" : "Reportes" ,
"Ruta" : "/reportes" ,
"Clave" : "reportes"
}
}
]
GET /api/PermisoPerfil/
Returns permission records for the specified profile only. Returns 404 Not Found if the profile does not exist.
Path parameters
ID of the profile whose permissions you want to retrieve.
curl --request GET \
--url https://your-api-host/api/PermisoPerfil/2 \
--header 'Authorization: Bearer <token>'
[
{
"IdPperfil" : 1 ,
"IdModulo" : 3 ,
"IdPerfil" : 2 ,
"BitAgregar" : true ,
"BitEditar" : true ,
"BitConsulta" : true ,
"BitEliminar" : false ,
"BitDetalle" : true ,
"Modulo" : {
"IdModulo" : 3 ,
"strNombreModulo" : "Usuarios" ,
"Ruta" : "/usuarios" ,
"Clave" : "usuarios"
}
}
]
Response fields
Array of permission records. Hide PermisosPerfilModel properties
Unique ID of this permission record.
ID of the module this record applies to.
ID of the profile this record belongs to.
Whether the profile can create records in this module.
Whether the profile can edit records in this module.
Whether the profile can read/list records in this module.
Whether the profile can delete records in this module.
Whether the profile can view record detail pages in this module.
Module associated with this permission record. Display name of the module.
Front-end route path for this module (e.g., /usuarios).
Internal key used to reference the module in permission checks (e.g., usuario).
POST /api/PermisoPerfil
Creates a single permission record. Requires the permisosperfil.agregar permission.
For most use cases, prefer Save permissions (POST /api/PermisoPerfil/guardar-permisos), which replaces all permissions for a profile in one request. Use this endpoint only when you need to add a single record without touching others.
Request body
ID of the module to grant permissions for.
ID of the profile to assign this permission record to.
Grant detail-view access.
curl --request POST \
--url https://your-api-host/api/PermisoPerfil \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"IdModulo": 3,
"IdPerfil": 2,
"BitAgregar": true,
"BitEditar": true,
"BitConsulta": true,
"BitEliminar": false,
"BitDetalle": true
}'
200 OK
400 Bad Request
403 Forbidden
{
"IdPperfil" : 10 ,
"IdModulo" : 3 ,
"IdPerfil" : 2 ,
"BitAgregar" : true ,
"BitEditar" : true ,
"BitConsulta" : true ,
"BitEliminar" : false ,
"BitDetalle" : true
}
PUT /api/PermisoPerfil/
Updates an existing permission record. Requires the permisosperfil.editar permission.
Path parameters
ID of the permission record (IdPperfil) to update.
Request body
Same fields as the POST body above (IdModulo, IdPerfil, BitAgregar, BitEditar, BitConsulta, BitEliminar, BitDetalle).
curl --request PUT \
--url https://your-api-host/api/PermisoPerfil/10 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"IdModulo": 3,
"IdPerfil": 2,
"BitAgregar": false,
"BitEditar": true,
"BitConsulta": true,
"BitEliminar": false,
"BitDetalle": true
}'
200 OK
403 Forbidden
404 Not Found
DELETE /api/PermisoPerfil/
Deletes a single permission record by its ID. Requires the permisosperfil.eliminar permission.
Path parameters
ID of the permission record (IdPperfil) to delete.
curl --request DELETE \
--url https://your-api-host/api/PermisoPerfil/10 \
--header 'Authorization: Bearer <token>'
200 OK
403 Forbidden
404 Not Found
DELETE /api/PermisoPerfil/perfil/
Deletes all permission records for a given profile. Requires the permisosperfil.eliminar permission.
This removes every module permission for the profile in one operation. The profile’s users will lose all module access on their next login. Use Save permissions immediately after to restore the desired permission set.
Path parameters
ID of the profile whose permission records should all be deleted.
curl --request DELETE \
--url https://your-api-host/api/PermisoPerfil/perfil/2 \
--header 'Authorization: Bearer <token>'