I'm trying to synchronize user names and primary emails with AD via the Github API. I make a call to /user/emails using an oAuth token with scope user:email and I get back their primary email. I then try to use PATCH /user per this doc with the payload:
{
email: [email protected]
}
And I get back a 404.
Is this the correct method to set the primary emails for users?
You can change the email address associated with your personal account at any time. Note: You cannot change your primary email address to an email that is already set to be your backup email address.
This is due to your API request is not properly authenticated or your OAuth token does not have the required scopes. As per your question, you have set user:email
scope which does not allow modification of the profile. Use user
scope intead.
See more: Why am I getting a 404 error on a repository that exists?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With