Reputation: 43457
In the old Provisioning API, we were able to rename user accounts. I don't see a pertinent parameter in the new Directory API documentation which would allow for renaming of a user account. Is this still possible?
https://developers.google.com/admin-sdk/directory/v1/reference/users/update
I have a feeling it may be as simple as updating the primaryEmail
field to the new username but I'd like clarification.
Upvotes: 0
Views: 1049
Reputation: 1474
You guess it right. It is just as simple as changing the primaryEmail field. Here is my example below:
Let's say I am a reseller from reseller.com, and I have a resold domain called resold.com. Currently, I have one user created in my resold domain with the email address [email protected]. I am going to update it to [email protected]. Note: I am using my reseller reseller.com's credential.
PUT /admin/directory/v1/users/[email protected]
{
"primaryEmail": "[email protected]"
}
HTTP/1.1 200 OK
{
"kind": "admin#directory#user",
"id": "XXXX",
"primaryEmail": "[email protected]",
"name": {
"givenName": "Emily",
"familyName": "Lam",
"fullName": "Emily Lam"
}
Upvotes: 3