Assign/reasssign via script to specifc group



I'm trying to create a script that assing/reasssing a device to a specific group

I'm running the following via Powershell:

& "C:\Program Files (x86)\TeamViewer\TeamViewer.exe" assign --api-token=$APITOKEN --reassign --alias $ENV:COMPUTERNAME --group-ID $GROUPID --grant-easy-access

But the log files shows

DeviceAssignmentStarter::Run: device assignment failed - WebAPI failed to perform requested action - invalid_token (2), Access token does not have the required permissions for this function.

What permissions do i need for the apitoken to assign/reassign the device?