# Device config variable

## Get all device config variables for a device

> \## Device config variable Resource Fields\
> \
> \| Field |\
> \| :--- |\
> \| \`id\` |\
> \| \`device\` |\
> \| \`value\` |\
> \| \`name\` |\
> \
> \
> \---\
> \
> \`GET /v7/device\_config\_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/device_config_variable":{"get":{"tags":["Device config variable"],"summary":"Get all device config variables for a device","description":"## Device config variable Resource Fields\n\n| Field |\n| :--- |\n| `id` |\n| `device` |\n| `value` |\n| `name` |\n\n\n---\n\n`GET /v7/device_config_variable`"}}}}
```

## Create a device config variable

> \`POST /v7/device\_config\_variable\`\
> \
> \*\*Request Body:\*\*\
> \`\`\`json\
> {\
> &#x20;   "device": \<DEVICE 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/device_config_variable":{"post":{"tags":["Device config variable"],"summary":"Create a device config variable","description":"`POST /v7/device_config_variable`\n\n**Request Body:**\n```json\n{\n    \"device\": <DEVICE ID>,\n    \"name\": <NAME>,\n    \"value\": <VALUE>\n}\n```","requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}}}}}}
````

## Remove a device config variable

> \`DELETE /v7/device\_config\_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/device_config_variable({ID})":{"delete":{"tags":["Device config variable"],"summary":"Remove a device config variable","description":"`DELETE /v7/device_config_variable(<ID>)`","parameters":[{"name":"ID","in":"path","required":true}]}}}}
```

## Update a device config variable

> \`PATCH /v7/device\_config\_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/device_config_variable({ID})":{"patch":{"tags":["Device config variable"],"summary":"Update a device config variable","description":"`PATCH /v7/device_config_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"}}}}}}}}
````
