Is there a way to change or delete the secondary email

Thanks Simon,

I actually knew this, but for some reason, I hit the wrong “wrench” on the User Profile, and it didn’t show me the delete option. Once had the correct option I inspected it found what I needed. I tried it in Postman, it worked!

The curl for this is:

curl --location --request DELETE 'https://[discourse_url]/u/[discourse_user_name]/preferences/email.json?email=[address_to_delete]' \
--header 'Api-Key: [your_api_key]' \
--header 'Api-Username: system' \
--header 'Content-Type: application/json' 

Updated to add: Don’t forget to URL encode the email address. The API will respond with “success”: “OK”, but it won’t actually delete the address if you don’t do this.

Mark

3 Likes