View an environment variable via API
This method allows you to view a specific environment variable for a project.
URL
/projects/<permalink>/environment_variables/<id>
- Replace
<permalink>with the permalink of the project. - Replace
<id>with the identifier of the environment variable.
HTTP Method
GET
Example cURL request
curl -H "Content-type: application/json" \
-H "Accept: application/json" \
--user your-email@example.com:your-api-key \
-X GET \
https://your-account.deployhq.com/projects/your-project/environment_variables/123
Example response
{
"identifier": 123,
"name": "DATABASE_URL",
"masked_value": "••••••••",
"locked": false,
"build_pipeline": true,
"created_at": "2025-01-27T12:00:00.000Z",
"updated_at": "2025-01-27T12:00:00.000Z"
}
Response Fields
identifier- The unique ID of the environment variablename- The variable namemasked_value- The encrypted value (always shown as ••••••••)locked- Whether the variable is locked and immutablebuild_pipeline- Whether the variable is available in the Build Pipelinecreated_at- When the variable was createdupdated_at- When the variable was last updated