Individual users API

will not set primary_owner if selected user is not an owner

PUT /api/v1/users/:id/set_primary_owner

Parameters

Name Description
id id
id id

Request

Headers

Accept: application/json
X-Api-Token: Ecvs7t5KCNs7sx99yZ9Jc6eFxwUfP3Ypxw
X-Api-Email: user-320@example.com

Route

PUT /api/v1/users/1426/set_primary_owner

Body

{}

cURL

curl "http://localhost:3000/api/v1/users/1426/set_primary_owner" -d '{}' -X PUT \
	-H "Accept: application/json" \
	-H "X-Api-Token: Ecvs7t5KCNs7sx99yZ9Jc6eFxwUfP3Ypxw" \
	-H "X-Api-Email: user-320@example.com" \
	-H "Content-Type: application/json" \
	-H "Host: school.worksonmy.computer"

Response

Headers

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

Status

422 Unprocessable Entity

Body

{
  "errors": "The user must be an owner in order to assign this role."
}

Request

Headers

Accept: application/json
X-Api-Token: Ecvs7t5KCNs7sx99yZ9Jc6eFxwUfP3Ypxw
X-Api-Email: user-320@example.com

Route

PUT /api/v1/users/1426/set_primary_owner

Body

{}

cURL

curl "http://localhost:3000/api/v1/users/1426/set_primary_owner" -d '{}' -X PUT \
	-H "Accept: application/json" \
	-H "X-Api-Token: Ecvs7t5KCNs7sx99yZ9Jc6eFxwUfP3Ypxw" \
	-H "X-Api-Email: user-320@example.com" \
	-H "Content-Type: application/json" \
	-H "Host: school.worksonmy.computer"

Response

Headers

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

Status

422 Unprocessable Entity

Body

{
  "errors": "The user must be an owner in order to assign this role."
}