Custom Roles API

cannot destroy custom role which still has users

DELETE /api/v1/custom_roles/:id

Parameters

Name Description
id id
name role's name

Request

Headers

Accept: application/json
X-Api-Token: tcyxEMHnLb558zb3vxt7g5TEgwMSa91qzg
X-Api-Email: user-323@example.com

Route

DELETE /api/v1/custom_roles/21

Body

{}

cURL

curl "http://localhost:3000/api/v1/custom_roles/21" -d '{}' -X DELETE \
	-H "Accept: application/json" \
	-H "X-Api-Token: tcyxEMHnLb558zb3vxt7g5TEgwMSa91qzg" \
	-H "X-Api-Email: user-323@example.com" \
	-H "Content-Type: application/json" \
	-H "Host: school.worksonmy.computer"

Response

Headers

Content-Type: application/json; charset=utf-8
Content-Length: 74

Status

422 Unprocessable Entity

Body

{
  "errors": {
    "base": [
      "Cannot be destroyed while it is assigned to users."
    ]
  }
}