I want to update my variable by using gitlab APIs(using curl). But I am getting below error {"message":"401 Unauthorized"}
I have maintainer role. I have also created multiple times access token but nothing is working. Here below is scripts
NEW_VERSION="1234"
curl --request PUT --header "JOB-TOKEN: $CI_JOB_TOKEN" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/variables/TEST" --form "value=$NEW_VERSION"
curl --request PUT --header "PRIVATE-TOKEN:\ $token" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/variables/TEST --form "value=$NEW_VERSION"
curl --request PUT --header "PRIVATE-TOKEN: $token" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/variables/TEST" --form "value=$NEW_VERSION"