# Changing a user's email address via api

**URL:** <https://meta.discourse.org/t/changing-a-users-email-address-via-api/41027>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [14 Marzo, 2016 16:43 UTC](https://meta.discourse.org/t/changing-a-users-email-address-via-api/41027 "2016-03-14T16:43:27Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [14 Marzo, 2016 16:48 UTC](https://meta.discourse.org/t/changing-a-users-email-address-via-api/41027/3 "2016-03-14T16:48:41Z")

</div>

> [@paully21](#):
>
> Does anyone know the URL of the endpoint to change a user’s email address (using the api key and api username method)?

If you look at the [`routes.rb`](https://github.com/discourse/discourse/blob/master/config/routes.rb#L296) file you will see this line

```ruby
put "users/:username/preferences/email" => "users_email#update", constraints: {username: USERNAME_ROUTE_FORMAT}

```

which means you need to `PUT https://your.discourse.org/users/<username>/preferences/email`

_Got ninja-ed by @Falco 😉_

---

_[View the full topic](https://meta.discourse.org/t/changing-a-users-email-address-via-api/41027)._
