Not able to create ENV variable using API token

HI All,

I was trying to automate creating ENV variables in CI/CD by using API commands, but unfortunately getting 401 Unauthorized error. Earlier I used to do this in same way and was able to do it. But now it’s throwing an error, could anyone please help me to find out.

Command:

curl --request POST --header “PRIVATE-TOKEN: <your_access_token>” “https://gitlab.com/api/v4/projects/1/variables” --form “key=NEW_VARIABLE” --form “value=new value”

Please look into the error message: