Datas
  • Forside
  • App-udvikling
  • Hosting
  • Support
  • Kontakt os
Kontakt mig
113 Fulton Street, Suite 721
New York, NY 10010
[email protected]
+88 (0) 101 0000 000
  • facebook
  • twitter
  • youtube
  • instagram

Purchase

General

6
  • user
  • Tags
  • Sorting
  • Roles API
  • Categories
  • Auth
View Categories
  • Home
  • Docs
  • General
  • Roles API

Roles API

< 1 min read

Roles API #

Base path: /roles


GET /roles
Returns a list of roles. Supports filtering, sorting, and includes.


GET /roles/{id}
Returns a single role by ID.


POST /roles
Creates a new role.
Returns the created role.
Possible errors: 422 (validation error)


PUT/PATCH /roles/{id}
Updates an existing role.
Returns the updated role.
Possible errors: 422 (validation error), 404 (role not found)


DELETE /roles/{id}
Deletes a role.
Returns no content on success.
Possible errors: 404 (role not found)


POST /roles/search
Searches roles using filters and query parameters.


GET /roles/{id}/relationships/permissions
Returns permissions related to a role.


GET /roles/{id}/permissions
Returns permissions assigned to a role.


GET /roles/belongs-to/{permission} (custom endpoint)
Returns roles that have a specific permission.


Notes:
Roles include permissions by default in responses.
Filtering and sorting can be applied via query parameters.
Available filters include id, name, active, and guard_name.
Available sorting fields include id, name, and created_at.
Custom scopes such as active and withPermissions can be used for advanced queries.

Updated on March 29, 2026

What are your Feelings

  • Happy
  • Normal
  • Sad

Share This Article :

  • Facebook
  • X
  • LinkedIn
  • Pinterest
SortingCategories

Powered by BetterDocs

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Table of Contents
  • Roles API

Copyrights 2019 Ninetheme

113 Fulton Street, Suite 721 New York, NY 10010
[email protected]
+88 (0) 101 0000 000
datas_logo_white_sm

Datas / Digitalis
Cvr. 35953787

Energivej 30
2750 Ballerup

Kontakt mig

  • [email protected]
  • +45 93307121

Links

  • Hosting kontrakt
  • Api dokumentation