'HumanUser' entity type doesn't exist for the 'update' function, but does work for the 'find' function

I’m currently working on automatically updating user information based on some external data. I’d like to use the api to update users.

For some reason, I’m having an issue where a ‘HumanUser’ entity is not found.
I’ve tested the create method with the HumanUser entity and it works just fine, and I can also use the update function with other entities just fine. For example, I can update ‘Task’ entities.
Specifically HumanUser entities just don’t work.

Here’s some sample code that throws an error:

user_id = 227
user_data = sg.find_one(‘HumanUser’, [[‘id’, ‘is’, 227 ]], [‘type’,‘email’, ‘login’])

sg.update(‘HumanUser’, user_id, user_data)

sg.update throws the following error:

Fault: API update() HumanUser.type doesn’t exist:
{“field_name”=>“type”, “value”=>“HumanUser”}

I’ve tested this with active and inactive users, and it doesn’t work for both.
My best guess is that it’s a permissions error?

Any help is much appreciated.

By default there is no type field on the HumanUser entity.

If you have created a custom Type field its codename will likely be sg_type as only SG itself can create fields without this prefix.

1 Like

Ah that fixed it. Thank you :slight_smile:

1 Like