# Netlify Environment variable

**URL:** <https://answers.netlify.com/t/netlify-environment-variable/98607>\
**Category:** Support\
**Tags:** environment-vars\
**Created:** [August 7, 2023, 1:16pm UTC](https://answers.netlify.com/t/netlify-environment-variable/98607 "2023-08-07T13:16:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Spale96](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/spale96/32/51935_2.png) [@Spale96](https://answers.netlify.com/u/Spale96)\
**Post date:** [August 7, 2023, 1:16pm UTC](https://answers.netlify.com/t/netlify-environment-variable/98607/1 "2023-08-07T13:16:02Z")

</div>

Hello!

My Netlify profile with the site: [Netlify App](https://app.netlify.com/sites/check-your-weather-days/overview)

On the first commit to my GitHub, I forgot to hide my API key, so I removed it from OpenWeatherMap and requested a new one, I added to my vscode new API key and checked if it works, and it is working.

Then I added a fresh API key to env variables to netlify.

![401 unauthorized request , calling wrong API KEY|690x398]  
(upload://6wugYXEICKMcrnzb038n1sZLHhK.png)

 ![Netlify env key](https://global.discourse-cdn.com/netlify/original/3X/0/5/05ebcac74ba03ce56bbd023c6f650efb61f7aefe.png)

But when I try to make a call, netlify still uses the old key which was replaced by me inside vscode and via env variables in netlify site config.

---

<div class="post-metadata">

**Author:** ![Spale96](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/spale96/32/51935_2.png) [@Spale96](https://answers.netlify.com/u/Spale96)\
**Post date:** [August 7, 2023, 3:55pm UTC](https://answers.netlify.com/t/netlify-environment-variable/98607/2 "2023-08-07T15:55:02Z")

</div>

Retry with the latest branch commit fixed my problem.

---

<div class="post-metadata">

**Author:** ![SamO](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/samo/32/41847_2.png) [@SamO](https://answers.netlify.com/u/SamO)\
**Post date:** [August 8, 2023, 6:48pm UTC](https://answers.netlify.com/t/netlify-environment-variable/98607/3 "2023-08-08T18:48:24Z")

</div>

Thanks for coming back and sharing the solution!
