Skip to content

Roles

ayx one role manages role assignments in Alteryx One. You can inspect who holds a role, add a subject to a role, and remove them. Assign and unassign are mutating; add --apply to commit.

Command What it does
role list-assignments <id> List all subjects assigned to a role
role assign <id> <id> Assign a role to a subject
role unassign <id> <id> Remove a role from a subject
Terminal window
# Who holds this role?
ayx one role list-assignments <id>
# Machine-readable
ayx --output json one role list-assignments <id>
Terminal window
# Preview
ayx one role assign <id> <id>
# Commit
ayx one role assign \
<id> \
<id> \
--apply

The subject is typically a person ID. Use ayx one person list --all to find the right ID before assigning.

Terminal window
# Preview
ayx one role unassign <id> <id>
# Commit
ayx one role unassign \
<id> \
<id> \
--apply --yes
Terminal window
# Audit: dump all assignments for a role
ayx --output json one role list-assignments <id> \
| jq '.data'
# Bulk assign: read subject IDs from a file, assign each
while IFS= read -r subject_id; do
ayx one role assign \
<id> \
"$subject_id" \
--apply
done < subject_ids.txt
# Verify a specific user holds a role
ayx --output json one role list-assignments <id> \
| jq -e --arg uid "<person-id>" '.data[] | select(.id == $uid)' \
&& echo "assigned" || echo "not assigned"