question

levon avatar image
levon asked levon commented

change employee role

why I can't change employee role , no errors just not change

Employees
6 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Mike M avatar image Mike M commented ·

Can you please provide more information in your questions? Sample code? Request response code? Are you trying to change the "owner's" role?

0 Likes 0 ·
levon avatar image levon commented ·

Thnaks Mike for responce : I try to use this url v3/merchants/RPEZF3MRM39Z0/employees/RAZ0NC12331Z8

and send this json {"role":"ADMIN"} but api don't change employee role and don't show any errors

0 Likes 0 ·
levon avatar image levon commented ·

Thanks Mike your answer help me

0 Likes 0 ·
Mike M avatar image Mike M levon commented ·

Thank you, please mark my answer as accepted

0 Likes 0 ·
levon avatar image levon levon commented ·

Mike I have one more question How can I add email for employee When I add new employee I can only add following information name,nickname,inviteSent ,pin,role

0 Likes 0 ·
Mike M avatar image Mike M levon commented ·
  1. Then you should make a new question.
  2. Posting `{"email":"test@gmail.com"} to an employee worked just fine for me. The API for creating an employee accepts the email field as well.
0 Likes 0 ·

1 Answer

Mike M avatar image
Mike M answered Jeffrey Blattman commented

So it turns out that the role field is a dynamic field that reads off the system level role of their merchant-configurable default from the roles field.

To update an employee's role, you need to post to the roles field.

{ "roles":[ {"id" : " put role uuid here "} ] }

1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ commented ·

It's a bug that the endpoint fails silently. If it can't set the field it should let the caller know it failed. I will file an internal issue on this.

0 Likes 0 ·

Welcome to the
Clover Developer Community