Payload validation error: 'Expected type array but found type object'

I am trying to add users to a role by calling ‘Auth0::getSdk()->management()->roles()->addUsers($roleId, $userIds);’ in the Laravel SDK, where I confirmed that $userIds is an array, but for some reason it fails to add the users with the specified error message. Is there a way to check why this still fails?

Hey there!

In order to handle that most effectively I would encourage you to raise a GitHub issue in the Laravel SDK repo to discuss it directly with the repo maintainers. Once you have it please make sure to share it here so we can ping them. Thank you!

It was an issue of an associative array being turned into a json object, so it seems that that is the reason it kept failing.

1 Like

Oh got it! Thank you for sharing it with the rest of community!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.