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 |
{
"Accept": "application/json",
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3M..."
}
{
"name": "required",
"permissions": "required, array:string"
}
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"
]
}
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."
]
}