# HTTP 404, E0000007 when updating a user's email with Java SDK

**URL:** <https://devforum.okta.com/t/http-404-e0000007-when-updating-a-users-email-with-java-sdk/22133>\
**Category:** Questions\
**Tags:** java\
**Created:** [October 12, 2022, 7:14pm UTC](https://devforum.okta.com/t/http-404-e0000007-when-updating-a-users-email-with-java-sdk/22133 "2022-10-12T19:14:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![slemly](https://avatars.discourse-cdn.com/v4/letter/s/ee59a6/32.png) [@slemly](https://devforum.okta.com/u/slemly)\
**Post date:** [October 12, 2022, 7:14pm UTC](https://devforum.okta.com/t/http-404-e0000007-when-updating-a-users-email-with-java-sdk/22133/1 "2022-10-12T19:14:00Z")

</div>

We are implementing a feature that allows a user to update their email with our service.

In order to keep Okta’s user management in sync with our tables, we are attempting to use the Java Okta SDK to update the user with Okta as well (see the ‘Update a User’ section of [this](https://github.com/okta/okta-sdk-java)).

We are aware that you can also update a user via the API as detailed [here](https://developer.okta.com/docs/reference/api/users/#response-example-18) but we’d prefer to use the SDK if possible.

Here is what we are attempting:

```auto
    Client client = client(oktaProperties.getApiToken());
    User oktaUser = client.getUser(oktaId);
    oktaUser.getProfile().setEmail(email);
    oktaUser.update();

```

The console message when this is run:

```auto
HTTP 404, Okta E0000007 (Not found: Resource not found: newemail@email.com (User)), ErrorId <errorId>

```

Our theory is that the SDK is attempting the `update()` call on a user with the `email@email.com` address, only to find none existing in the client. This issue does not happen when updating names or phone numbers, as we are successfully able to update those.

---

<div class="post-metadata">

**Author:** ![erik](https://avatars.discourse-cdn.com/v4/letter/e/b5ac83/32.png) [@erik](https://devforum.okta.com/u/erik)\
**Post date:** [October 20, 2022, 11:27pm UTC](https://devforum.okta.com/t/http-404-e0000007-when-updating-a-users-email-with-java-sdk/22133/2 "2022-10-20T23:27:44Z")

</div>

Hello,  
Are you using an old version of the SDK?  
The [update call made by the SDK](https://developer.okta.com/docs/reference/api/users/#update-user) is based off of the userId.

---

<div class="post-metadata">

**Author:** ![slemly](https://avatars.discourse-cdn.com/v4/letter/s/ee59a6/32.png) [@slemly](https://devforum.okta.com/u/slemly)\
**Post date:** [October 24, 2022, 6:29pm UTC](https://devforum.okta.com/t/http-404-e0000007-when-updating-a-users-email-with-java-sdk/22133/3 "2022-10-24T18:29:05Z")

</div>

We were using 1.4.0, but after seeing your comment, upgraded to 2.1.6 and that appears to have fixed our issue.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [November 28, 2022, 6:45pm UTC](https://devforum.okta.com/t/http-404-e0000007-when-updating-a-users-email-with-java-sdk/22133/4 "2022-11-28T18:45:05Z")

</div>

Closed on November 28, 2022, 6:45pm UTC

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