Changing agents RolePermissionType from custom to LightAgent throught the API

Changing agents RolePermissionType from custom to LightAgent throught the API

Hi,

I have a lot of agents that have a custom roles and I need to change them to a Light Agent using the API 

Payload I'm using is:

{
    "roleId": "16281000000016005",
    "rolePermissionType": "Light",
    "profileId": "16281000000016003"
}

I got the roleID  and ProfileID by manually changing the Agent to LightAgent and getting the agent information throught the "agents/{agent_id}" endpoint, and they are both relative to the "LightAgent"


If the agent is altready a LightAgent the request is executed successfully, but i fthe agent has a custom "RolePermissionType" i'm getting this error:
{
    "errorCode": "INTERNAL_SERVER_ERROR",
    "message": "An internal server error occurred while performing this operation."
}

The same happens the otherway arround. If the agent is a LightAgent and I want to change to a custom, I get the same error.

Also, if the agent has a custom RolesPermissionType, I can change between different roles without any problem.