# Fleet environment variable

## Get all fleet environment variables for a fleet

> \## Fleet environment variable Resource Fields\
> \
> \| Field |\
> \| :--- |\
> \| \`id\` |\
> \| \`created\_at\` |\
> \| \`application\` |\
> \| \`name\` |\
> \| \`value\` |\
> \
> \
> \---\
> \
> \`GET /v7/application\_environment\_variable\`

```json
{"openapi":"3.0.0","info":{"title":"Balena API Spec","version":"7.0.0"},"servers":[{"url":"https://api.balena-cloud.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}}},"paths":{"/v7/application_environment_variable":{"get":{"tags":["Fleet environment variable"],"summary":"Get all fleet environment variables for a fleet","description":"## Fleet environment variable Resource Fields\n\n| Field |\n| :--- |\n| `id` |\n| `created_at` |\n| `application` |\n| `name` |\n| `value` |\n\n\n---\n\n`GET /v7/application_environment_variable`"}}}}
```

## Create a fleet environment variable

> \`POST /v7/application\_environment\_variable\`\
> \
> \*\*Request Body:\*\*\
> \`\`\`json\
> {\
> &#x20;   "application": \<FLEET ID>,\
> &#x20;   "name": \<NAME>,\
> &#x20;   "value": \<VALUE>\
> }\
> \`\`\`

````json
{"openapi":"3.0.0","info":{"title":"Balena API Spec","version":"7.0.0"},"servers":[{"url":"https://api.balena-cloud.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}}},"paths":{"/v7/application_environment_variable":{"post":{"tags":["Fleet environment variable"],"summary":"Create a fleet environment variable","description":"`POST /v7/application_environment_variable`\n\n**Request Body:**\n```json\n{\n    \"application\": <FLEET ID>,\n    \"name\": <NAME>,\n    \"value\": <VALUE>\n}\n```","requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}}}}}}
````

## Remove a fleet environment variable

> \`DELETE /v7/application\_environment\_variable(\<ID>)\`

```json
{"openapi":"3.0.0","info":{"title":"Balena API Spec","version":"7.0.0"},"servers":[{"url":"https://api.balena-cloud.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}}},"paths":{"/v7/application_environment_variable({ID})":{"delete":{"tags":["Fleet environment variable"],"summary":"Remove a fleet environment variable","description":"`DELETE /v7/application_environment_variable(<ID>)`","parameters":[{"name":"ID","in":"path","required":true}]}}}}
```

## Update a fleet environment variable

> \`PATCH /v7/application\_environment\_variable(\<ID>)\`\
> \
> \*\*Request Body:\*\*\
> \`\`\`json\
> {\
> &#x20;   "value": \<NEW VALUE>\
> }\
> \`\`\`

````json
{"openapi":"3.0.0","info":{"title":"Balena API Spec","version":"7.0.0"},"servers":[{"url":"https://api.balena-cloud.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}}},"paths":{"/v7/application_environment_variable({ID})":{"patch":{"tags":["Fleet environment variable"],"summary":"Update a fleet environment variable","description":"`PATCH /v7/application_environment_variable(<ID>)`\n\n**Request Body:**\n```json\n{\n    \"value\": <NEW VALUE>\n}\n```","parameters":[{"name":"ID","in":"path","required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}}}}}}
````
