Skip to content

Latest commit

 

History

History
49 lines (33 loc) · 1.28 KB

_environment_vars.md

File metadata and controls

49 lines (33 loc) · 1.28 KB

Environment Variables

List Environment Variables

curl https://circleci.com/api/v1.1/project/:vcs-type/:username/:project/envvar -H "Circle-Token: <circle-token>"
[{"name":"foo","value":"xxxx1234"}]

GET Request: Returns four 'x' characters plus the last four ASCII characters of the value, consistent with the display of environment variable values in the CircleCI website.

Add Environment Variables

curl -X POST --header "Content-Type: application/json" -d '{"name":"foo", "value":"bar"}' https://circleci.com/api/v1.1/project/:vcs-type/:username/:project/envvar -H "Circle-Token: <circle-token>"
{"name":"foo","value":"xxxx"}

POST Request Creates a new environment variable.

Get Single Environment Variable

curl https://circleci.com/api/v1.1/project/:vcs-type/:username/:project/envvar/:name -H "Circle-Token: <circle-token>"
{"name":"foo","value":"xxxx"}

GET Request: Returns the hidden value of environment variable :name.

Delete Environment Variables

curl -X DELETE https://circleci.com/api/v1.1/project/:vcs-type/:username/:project/envvar/:name -H "Circle-Token: <circle-token>"
{"message":"ok"}

DELETE Request Deletes the environment variable named :name.