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, both as lists of account UUIDs.
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": [
"ed033538-fdab-40be-9ccd-310ca81aa6c0",
"233542de-2ef1-49b4-b823-e26daa41045f",
"c742c3bd-be37-487e-a50b-4e4a0fb2ee0a"
],
"target_type": "network",
"target_uuid": "56b4d048-4e09-4f80-a438-c0b1e49e0c5f"
}'
Request examples
# Headers
X-PLANNR-ACCOUNT-UUID: {YOUR_PLANNR_ACCOUNT_UUID}
# Payload
{
"assignees": [
"ed033538-fdab-40be-9ccd-310ca81aa6c0",
"233542de-2ef1-49b4-b823-e26daa41045f",
"c742c3bd-be37-487e-a50b-4e4a0fb2ee0a"
],
"target_type": "network",
"target_uuid": "56b4d048-4e09-4f80-a438-c0b1e49e0c5f"
}
Response examples (200)
{
"successful": [
"uuid-1",
"uuid-2"
],
"failed": [
"uuid-3"
]
}
Response examples (422)
{
"message": "The given data was invalid.",
"errors": {
"field": [
"The field is invalid."
]
}
}