Create a permission group

A verified admin is able to create a new permission group.

{info} Only an admin can create groups


Method Uri Auth Role
POST /v1/groups Bearer JWT-Token admin

Headers

{
    "Accept": "application/json",
    "Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3M..." 
}

Data constraints

{
  "name": "required",
  "permissions": "required, array:string"
}

Success Responses

Condition : User must be an admin.

Code : 201 Created

Content example : Response will reflect back the created group.

{
  "id": "029fcd7a-5d69-40d7-9bbd-618bee21275b",
  "name": "group name",
  "permissions": [
    "view"
  ]
}

Error Responses

Condition : If the current user does not have the role admin attached.

Code : 403 Forbidden

Content example :

{
  "message": "User does not have the right permissions."
}

Condition : If the current user is not logged in

Code : 401 Unauthorized

Content example :

{
  "message": "Je moet zijn ingelogd om dit te kunnen doen.",
  "errors": [
    "Unauthenticated."
  ]
}