I am trying to update a user account using User Provisioning REST API mentioned in the https://developer.atlassian.com/cloud/admin/user-provisioning/rest/api-group-users/#api-scim-directory-directoryid-users-userid-put document.
I want to change the email of the user only when the user requests for a change otherwise I want the details to get updated having the same email. Is there any work-around or is this a bug?
Hello Mrinalini,
Welcome to Atlassian Community! It's nice to have you join us.
Can you show us the query you're sending in REST-API? Please make sure to block out any private information since this is a public forum.
You might also want to try the Atlassian Developer Community. The main community is more end users, but the Developer community works with API regularly and may know what the problem is.
Thank you!
Shannon
Hi Shannon,
I am calling the following API :
curl --request PUT \
--url 'https://api.atlassian.com/scim/directory/{directoryId}/Users/{userId}' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"userName": "<string>",
"emails": [
{
"value": "<string>",
"type": "<string>",
"primary": true
}
],
"name": {
"formatted": "<string>",
"familyName": "<string>",
"givenName": "<string>",
"middleName": "<string>",
"honorificPrefix": "<string>",
"honorificSuffix": "<string>"
},
"displayName": "<string>",
"nickName": "<string>",
"title": "<string>",
"preferredLanguage": "<string>",
"department": "<string>",
"organization": "<string>",
"timezone": "<string>",
"phoneNumbers": [
{
"value": "<string>",
"type": "<string>",
"primary": true
}
],
"active": true
}'
The data passed in emails.value is same as in the existing account with userId
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Mrinalini,
Thank you for your reply. If you need to update the user details without changing the email, you can use PATCH instead.
Can you try that and let me know if you have any trouble?
Shannon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mrinalini,
That's great. Thank you for confirming. I'm happy to hear it worked.
Take care, and have a pleasant rest of your week.
Shannon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
When we update a mail adres by the patch instead, we've get an 405 error: Method is not allowed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tom,
Good afternoon. Thanks for following up on this question. First, I edited your API call to remove identifying information. Please note this is an open forum, and the public can view anything you post here.
I understand you're getting a 405 Method Not Allowed error when you try to patch (change) an email address from one of your managed accounts.
Can you confirm you're using the organization admin API key? See Manage an organization with the admin APIs. This is different from the key you generate for your user account.
If you can confirm you're using the org admin API key and not your user API key, I recommend raising a ticket with the Atlassian Access support team.
Let me know if you have any trouble with that.
Take care,
Shannon S | Atlassian Cloud support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.