Get all variables from a context using the API

Hello community, im trying to do some automations and at some point I need to use the CircleCI API to see all the variables on my context and then add as needed. Looking at the documentation I see it talks about environment variables on a specific project but does not mention anything about context variables… can anyone share some light, a pointer or an example I can use to remove this blocker?


Hey Santiago! Welcome to Discuss. :slight_smile:

You’re right that there’s currently no way to use variables from Contexts via the API, but you’re not alone in wanting this functionality. We’ve got at least a couple posts on our Ideas board about this very feature, and I’d encourage you to add your vote(s), since we draw from the Ideas page when prioritizing future work.

There might be something you can try here in Discuss, in the meantime (here’s one such post).

Has this feature been added to the API yet?

@santiagomoneta, @rkinwar,

Just to let you know Context-related API endpoints are now available.

Note that this is still in preview.

At the moment, the context endpoint allows you list all variables but it doesn’t allow you to see the last four character of the variable values. Is there any plan for this being added in the near future ?