
## Roles resource [/api/roles]
It requires your user to have permissions to fetch, create, update or delete roles in the system depending on the request you want to make

### List roles [GET]

This endpoint will allow you to get the roles registered in the system

+ Request (application/json)

    + Headers

            Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjBlOGVhOGY0YWY2Yjg3NzU0YjZjZDBjNjdkNzBmMjdhYTZkMmRjNjU3YzIwYTU0MjQ3NWRlZGU4Y2VkNTc1N2IwZDcwMWFmNTAyMGU4MGE4In0.eyJhdWQiOiIxIiwianRpIjoiMGU4ZWE4ZjRhZjZiODc3NTRiNmNkMGM2N2Q3MGYyN2FhNmQyZGM2NTdjMjBhNTQyNDc1ZGVkZThjZWQ1NzU3YjBkNzAxYWY1MDIwZTgwYTgiLCJpYXQiOjE0NzYyOTk1NTQsIm5iZiI6MTQ3NjI5OTU1NCwiZXhwIjoxNDc3NTk1NTU0LCJzdWIiOiIxIiwic2NvcGVzIjpbXX0. 

+ Response 200 (application/json)

    + Attributes
        + data (array)
            + (Role Object)
            + (Role Object)
            + (Role Object)
            + (Role Object)
        + meta
            + pagination (Role Pagination)

+ Response 401 (application/json)

    + Attributes (Error 401)

+ Response 403 (application/json)

    + Attributes (Error 403)

+ Response 404 (application/json)

    + Attributes (Error 404)

### Create Role [POST]
This endpoint will allow you to create a role in the system

+ Request (application/json)

    + Headers

            Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjBlOGVhOGY0YWY2Yjg3NzU0YjZjZDBjNjdkNzBmMjdhYTZkMmRjNjU3YzIwYTU0MjQ3NWRlZGU4Y2VkNTc1N2IwZDcwMWFmNTAyMGU4MGE4In0.eyJhdWQiOiIxIiwianRpIjoiMGU4ZWE4ZjRhZjZiODc3NTRiNmNkMGM2N2Q3MGYyN2FhNmQyZGM2NTdjMjBhNTQyNDc1ZGVkZThjZWQ1NzU3YjBkNzAxYWY1MDIwZTgwYTgiLCJpYXQiOjE0NzYyOTk1NTQsIm5iZiI6MTQ3NjI5OTU1NCwiZXhwIjoxNDc3NTk1NTU0LCJzdWIiOiIxIiwic2NvcGVzIjpbXX0. 

    + Attributes (Role Create)

+ Response 201 (application/json)

    + Attributes
        + data (Role Object)

+ Response 422 (application/json)

    + Attributes (Error 422)

+ Response 401 (application/json)

    + Attributes (Error 401)

+ Response 403 (application/json)

    + Attributes (Error 403)

+ Response 404 (application/json)

    + Attributes (Error 404)

### Get single role [GET /api/roles/{id}]

This endpoint will allow you to get a single role

+ Parameters
    + id: `d4d42ea0-ee77-11e6-b823-6d63c6504afc` (string, required) The role ID

+ Request (application/json)

    + Headers

            Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjBlOGVhOGY0YWY2Yjg3NzU0YjZjZDBjNjdkNzBmMjdhYTZkMmRjNjU3YzIwYTU0MjQ3NWRlZGU4Y2VkNTc1N2IwZDcwMWFmNTAyMGU4MGE4In0.eyJhdWQiOiIxIiwianRpIjoiMGU4ZWE4ZjRhZjZiODc3NTRiNmNkMGM2N2Q3MGYyN2FhNmQyZGM2NTdjMjBhNTQyNDc1ZGVkZThjZWQ1NzU3YjBkNzAxYWY1MDIwZTgwYTgiLCJpYXQiOjE0NzYyOTk1NTQsIm5iZiI6MTQ3NjI5OTU1NCwiZXhwIjoxNDc3NTk1NTU0LCJzdWIiOiIxIiwic2NvcGVzIjpbXX0. 

+ Response 200 (application/json)

    + Attributes
        + data (Role Object)


+ Response 401 (application/json)

    + Attributes (Error 401)

+ Response 403 (application/json)

    + Attributes (Error 403)

+ Response 404 (application/json)

    + Attributes (Error 404)

### Update Role [PUT /api/roles/{id}]

This endpoint will allow you to update the role's information, in this case the payload will have to contain all the entity to be updated.
+ Parameters
    + id: `d4d42ea0-ee77-11e6-b823-6d63c6504afc` (string, required) The role ID

+ Request (application/json)

    + Headers

            Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjBlOGVhOGY0YWY2Yjg3NzU0YjZjZDBjNjdkNzBmMjdhYTZkMmRjNjU3YzIwYTU0MjQ3NWRlZGU4Y2VkNTc1N2IwZDcwMWFmNTAyMGU4MGE4In0.eyJhdWQiOiIxIiwianRpIjoiMGU4ZWE4ZjRhZjZiODc3NTRiNmNkMGM2N2Q3MGYyN2FhNmQyZGM2NTdjMjBhNTQyNDc1ZGVkZThjZWQ1NzU3YjBkNzAxYWY1MDIwZTgwYTgiLCJpYXQiOjE0NzYyOTk1NTQsIm5iZiI6MTQ3NjI5OTU1NCwiZXhwIjoxNDc3NTk1NTU0LCJzdWIiOiIxIiwic2NvcGVzIjpbXX0. 

    + Attributes (Role Update Full)

+ Response 200 (application/json)

    + Attributes
        + data (Role Object)

+ Response 422 (application/json)

    + Attributes (Error 422)

+ Response 401 (application/json)

    + Attributes (Error 401)

+ Response 403 (application/json)

    + Attributes (Error 403)

+ Response 404 (application/json)

    + Attributes (Error 404)

### Partial update Role [PATCH /api/roles/{id}]
This endpoint will allow you to update the role's information, please note that the attributes are optional meaning you can send only one per request and only that field will be updated.

+ Parameters
    + id: `d4d42ea0-ee77-11e6-b823-6d63c6504afc` (string, required) The role ID

+ Request (application/json)

    + Headers

            Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjBlOGVhOGY0YWY2Yjg3NzU0YjZjZDBjNjdkNzBmMjdhYTZkMmRjNjU3YzIwYTU0MjQ3NWRlZGU4Y2VkNTc1N2IwZDcwMWFmNTAyMGU4MGE4In0.eyJhdWQiOiIxIiwianRpIjoiMGU4ZWE4ZjRhZjZiODc3NTRiNmNkMGM2N2Q3MGYyN2FhNmQyZGM2NTdjMjBhNTQyNDc1ZGVkZThjZWQ1NzU3YjBkNzAxYWY1MDIwZTgwYTgiLCJpYXQiOjE0NzYyOTk1NTQsIm5iZiI6MTQ3NjI5OTU1NCwiZXhwIjoxNDc3NTk1NTU0LCJzdWIiOiIxIiwic2NvcGVzIjpbXX0. 

    + Attributes (Role Update)

+ Response 200 (application/json)

    + Attributes
        + data (Role Object)

+ Response 422 (application/json)

    + Attributes (Error 422)

+ Response 401 (application/json)

    + Attributes (Error 401)

+ Response 403 (application/json)

    + Attributes (Error 403)

+ Response 404 (application/json)

    + Attributes (Error 404)


### Delete Role [DELETE /api/roles/{id}]
This endpoint will allow you to delete a role from the system

+ Parameters
    + id: `d4d42ea0-ee77-11e6-b823-6d63c6504afc` (string, required) The Role ID

+ Request (application/json)

    + Headers

            Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjBlOGVhOGY0YWY2Yjg3NzU0YjZjZDBjNjdkNzBmMjdhYTZkMmRjNjU3YzIwYTU0MjQ3NWRlZGU4Y2VkNTc1N2IwZDcwMWFmNTAyMGU4MGE4In0.eyJhdWQiOiIxIiwianRpIjoiMGU4ZWE4ZjRhZjZiODc3NTRiNmNkMGM2N2Q3MGYyN2FhNmQyZGM2NTdjMjBhNTQyNDc1ZGVkZThjZWQ1NzU3YjBkNzAxYWY1MDIwZTgwYTgiLCJpYXQiOjE0NzYyOTk1NTQsIm5iZiI6MTQ3NjI5OTU1NCwiZXhwIjoxNDc3NTk1NTU0LCJzdWIiOiIxIiwic2NvcGVzIjpbXX0. 

+ Response 204 (application/json)

+ Response 422 (application/json)

    + Attributes (Error 422)

+ Response 401 (application/json)

    + Attributes (Error 401)

+ Response 403 (application/json)

    + Attributes (Error 403)

+ Response 404 (application/json)

    + Attributes (Error 404)
