Rollenverwaltung

GET https://leads.qreq.com/api/roles
curl --request GET \
--url 'https://leads.qreq.com/api/roles' \
--header 'Authorization: Bearer {api_key}'
{ "message": "Roles retrieved successfully.", "roles": { "current_page": 1, "data": [ { "id": 3, "name": "staff", "guard_name": "web", "label": "staff", "description": "staff", "created_by": 9, "created_at": "2025-11-01T06:50:16.000000Z", "updated_at": "2025-11-01T06:50:16.000000Z", "is_system_role": false, "permissions": [ { "id": 1, "module": "dashboard", "name": "manage-dashboard", "guard_name": "web", "label": "Manage Dashboard", "description": "Can view dashboard", "created_at": "2025-09-25T05:00:16.000000Z", "updated_at": "2025-09-25T05:00:16.000000Z", "pivot": { "role_id": 3, "permission_id": 1 } }, { "id": 2, "module": "dashboard", "name": "view-dashboard", "guard_name": "web", "label": "View Dashboard", "description": "Can view dashboard", "created_at": "2025-09-25T05:00:16.000000Z", "updated_at": "2025-09-25T05:00:16.000000Z", "pivot": { "role_id": 3, "permission_id": 2 } } ], "creator": { "id": 9, "name": "marshall", "email": "[email protected]", "email_verified_at": "2025-10-31T10:59:33.000000Z", "lang": "en", "avatar": null, "type": "company", "plan_id": 1, "plan_expire_date": null, "requested_plan": 0, "created_by": 0, "mode": "light", "plan_is_active": 1, "storage_limit": 0, "is_enable_login": 1, "google2fa_enable": 0, "status": "active", "is_trial": null, "trial_day": 0, "trial_expire_date": null, "active_module": null, "referral_code": 634410, "used_referral_code": 0, "commission_amount": 0, "created_at": "2025-10-31T10:59:06.000000Z", "updated_at": "2025-10-31T10:59:33.000000Z" } } ] } }
POST https://leads.qreq.com/api/roles
Parameter Einzelheiten Beschreibung
label Erforderlich Zeichenfolge Role display name
description Optional Zeichenfolge Role description
permissions Optional Array Array of permission names
curl --request POST \
--url 'https://leads.qreq.com/api/roles' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data '{ "label": "Manager", "description": "Manager role", "permissions": ["create-lead","update-lead"] }'
{ "message": "Role created successfully with permissions.", "role": { "guard_name": "web", "label": "manager", "name": "manager", "description": "manager", "created_by": 9, "updated_at": "2025-11-01T11:15:55.000000Z", "created_at": "2025-11-01T11:15:55.000000Z", "id": 4, "is_system_role": false, "permissions": [ { "id": 1, "module": "dashboard", "name": "manage-dashboard", "guard_name": "web", "label": "Manage Dashboard", "description": "Can view dashboard", "created_at": "2025-09-25T05:00:16.000000Z", "updated_at": "2025-09-25T05:00:16.000000Z", "pivot": { "role_id": 4, "permission_id": 1 } }, { "id": 2, "module": "dashboard", "name": "view-dashboard", "guard_name": "web", "label": "View Dashboard", "description": "Can view dashboard", "created_at": "2025-09-25T05:00:16.000000Z", "updated_at": "2025-09-25T05:00:16.000000Z", "pivot": { "role_id": 4, "permission_id": 2 } } ] } }
GET https://leads.qreq.com/api/roles/{role_id}
curl --request GET \
--url 'https://leads.qreq.com/api/roles/{role_id}' \
--header 'Authorization: Bearer {api_key}'
{ "message": "Role retrieved successfully.", "role": { "id": 4, "name": "manager", "guard_name": "web", "label": "manager", "description": "manager", "created_by": 9, "created_at": "2025-11-01T11:15:55.000000Z", "updated_at": "2025-11-01T11:15:55.000000Z", "is_system_role": false, "permissions": [ { "id": 1, "module": "dashboard", "name": "manage-dashboard", "guard_name": "web", "label": "Manage Dashboard", "description": "Can view dashboard", "created_at": "2025-09-25T05:00:16.000000Z", "updated_at": "2025-09-25T05:00:16.000000Z", "pivot": { "role_id": 4, "permission_id": 1 } }, { "id": 2, "module": "dashboard", "name": "view-dashboard", "guard_name": "web", "label": "View Dashboard", "description": "Can view dashboard", "created_at": "2025-09-25T05:00:16.000000Z", "updated_at": "2025-09-25T05:00:16.000000Z", "pivot": { "role_id": 4, "permission_id": 2 } } ] } }
PUT https://leads.qreq.com/api/roles/{role_id}
curl --request PUT \
--url 'https://leads.qreq.com/api/roles/{role_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--data-raw '{ "label": "Staff", "description": "Staff role updated", "permissions": ["manage-dashboard","view-dashboard"] }'
{ "message": "Role updated successfully.", "role": { "id": 4, "name": "supervisor", "guard_name": "web", "label": "supervisor", "description": "supervisor", "created_by": 9, "created_at": "2025-11-01T11:15:55.000000Z", "updated_at": "2025-11-01T11:23:14.000000Z", "is_system_role": false, "permissions": [ { "id": 1, "module": "dashboard", "name": "manage-dashboard", "guard_name": "web", "label": "Manage Dashboard", "description": "Can view dashboard", "created_at": "2025-09-25T05:00:16.000000Z", "updated_at": "2025-09-25T05:00:16.000000Z", "pivot": { "role_id": 4, "permission_id": 1 } }, { "id": 2, "module": "dashboard", "name": "view-dashboard", "guard_name": "web", "label": "View Dashboard", "description": "Can view dashboard", "created_at": "2025-09-25T05:00:16.000000Z", "updated_at": "2025-09-25T05:00:16.000000Z", "pivot": { "role_id": 4, "permission_id": 2 } } ] } }
DELETE https://leads.qreq.com/api/roles/{role_id}
curl --request DELETE \
--url 'https://leads.qreq.com/api/roles/{role_id}' \
--header 'Authorization: Bearer {api_key}'
{ "message": "Role deleted successfully." }