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": [
"58cfec29-7200-4e40-b1f7-b89caa1d8793",
"52b828cb-e5e7-4bff-aa8c-7f2cfa0c4e89",
"ddbc1bb5-44b0-48a2-a220-0e7c8ecc70d1"
],
"target_type": "network",
"target_uuid": "ae160b5c-61a4-4434-8542-eadb65521c39"
}'
Request examples
# Headers
X-PLANNR-ACCOUNT-UUID: {YOUR_PLANNR_ACCOUNT_UUID}
# Payload
{
"assignees": [
"58cfec29-7200-4e40-b1f7-b89caa1d8793",
"52b828cb-e5e7-4bff-aa8c-7f2cfa0c4e89",
"ddbc1bb5-44b0-48a2-a220-0e7c8ecc70d1"
],
"target_type": "network",
"target_uuid": "ae160b5c-61a4-4434-8542-eadb65521c39"
}
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."
]
}
}