Assign or revoke a role Run in API Explorer
Ask AI
Assign or revoke a role for one or more accounts. The action is determined by the URL parameter. Optionally scope the assignment to a specific target resource (e.g. a network). Processing is best-effort: each assignee is processed independently and the response reports which succeeded and which failed.
POST
/api/v2/roles/{role_uuid}/{action}
curl \
--request POST 'https://api.plannrcrm.com/api/v2/roles/6ff8f7f6-1eb3-3525-be4a-3932c805afed/assign' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--header "X-PLANNR-ACCOUNT-UUID: {YOUR_PLANNR_ACCOUNT_UUID}" \
--data '{
"assignees": [
"fb6f66b2-d5ca-4d7a-b31c-bc686142aae4",
"9e4545b8-49e0-48c2-8b98-4bccdfa4ccd1",
"4c118a60-f786-4eef-9785-2b64bcde61ff"
],
"target_type": "network",
"target_uuid": "c05cc181-3356-419b-8944-842e27e0204d"
}'
Request examples
# Headers
X-PLANNR-ACCOUNT-UUID: {YOUR_PLANNR_ACCOUNT_UUID}
# Payload
{
"assignees": [
"fb6f66b2-d5ca-4d7a-b31c-bc686142aae4",
"9e4545b8-49e0-48c2-8b98-4bccdfa4ccd1",
"4c118a60-f786-4eef-9785-2b64bcde61ff"
],
"target_type": "network",
"target_uuid": "c05cc181-3356-419b-8944-842e27e0204d"
}
Response examples (200)
{
"successful": [
"uuid-1",
"uuid-2"
],
"failed": []
}
Response examples (422)
{
"message": "The given data was invalid.",
"errors": {
"field": [
"The field is invalid."
]
}
}