# E-Mail kann über API nicht aktualisiert werden – Fehler invalid\_access

**URL:** <https://meta.discourse.org/t/cant-update-email-via-api-invalid-access-error/87260>\
**Category:** Development\
**Created:** [11. Mai 2018 um 13:06 UTC](https://meta.discourse.org/t/cant-update-email-via-api-invalid-access-error/87260 "2018-05-11T13:06:08Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![shahidmir](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@shahidmir](https://meta.discourse.org/u/shahidmir)\
**Post date:** [11. Mai 2018 um 13:06 UTC](https://meta.discourse.org/t/cant-update-email-via-api-invalid-access-error/87260/1 "2018-05-11T13:06:08Z")

</div>

Hi Guys,

Im getting an error when trying to use the API to update email.  
I have looked at the logs and can see the following:

`Started PUT “/discussion/users/davetest/preferences/email.json” for xx.xx.xx.xx at 2018-05-11 12:22:11 +0000`

Processing by UsersEmailController#update as JSON

`Parameters: {“api_key”=>;"[FILTERED]", “api_username”=>;“daveAdmin”, “email”=>;“[new.email@example.com](mailto:new.email@example.com)”, “username”=>;“davetest”}`

Can’t verify CSRF token authenticity.

This is a PUT request, but looking at the scopes below, doesnt seem like PUT is supported for the WRITE scope? surely im misunderstanding, so could someone please assist?

I have re-generated the all-user api-key, also created specific user api-keys to use, but same result.

```
SCOPES = {
read: [:get],
write: [:get, :post, :patch],
message_bus: [[:post, ‘message_bus’]],
push: nil,
notifications: [[:post, ‘message_bus’], [:get, ‘notifications#index’], [:put, ‘notifications#mark_read’]],
session_info: [[:get, ‘session#current’], [:get, ‘users#topic_tracking_state’]]
}

```

---

_[View the full topic](https://meta.discourse.org/t/cant-update-email-via-api-invalid-access-error/87260)._
