Skip to main content
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
integer
required
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

[]
PermisosPerfilModel[]
Array of permission records.

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

IdModulo
integer
required
ID of the module to grant permissions for.
IdPerfil
integer
required
ID of the profile to assign this permission record to.
BitAgregar
boolean
required
Grant create access.
BitEditar
boolean
required
Grant edit access.
BitConsulta
boolean
required
Grant read/list access.
BitEliminar
boolean
required
Grant delete access.
BitDetalle
boolean
required
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
  }'
{
  "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
integer
required
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
  }'
true

DELETE /api/PermisoPerfil/

Deletes a single permission record by its ID. Requires the permisosperfil.eliminar permission.

Path parameters

id
integer
required
ID of the permission record (IdPperfil) to delete.
curl --request DELETE \
  --url https://your-api-host/api/PermisoPerfil/10 \
  --header 'Authorization: Bearer <token>'
true

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

perfilId
integer
required
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>'
HTTP/1.1 200 OK

Build docs developers (and LLMs) love