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":["0db9a693-6c95-449e-8b06-9539dca984b3","75f090f2-c888-435f-87c6-9443f844e177","6213824a-3ae2-4b78-8761-7957eca1d092"],"target_type":"network","target_uuid":"03de6e34-0f60-45f3-8c51-8d6e9bba4496"}'
Request examples
# Headers
X-PLANNR-ACCOUNT-UUID: {YOUR_PLANNR_ACCOUNT_UUID}
# Payload
{
"assignees": [
"0db9a693-6c95-449e-8b06-9539dca984b3",
"75f090f2-c888-435f-87c6-9443f844e177",
"6213824a-3ae2-4b78-8761-7957eca1d092"
],
"target_type": "network",
"target_uuid": "03de6e34-0f60-45f3-8c51-8d6e9bba4496"
}
Response examples (200)
{
"failed": [],
"successful": [
"uuid-1",
"uuid-2"
]
}