> For the complete documentation index, see [llms.txt](https://docs.nected.ai/nected-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nected.ai/nected-docs/management-api/global-variable-api/create-global-variable.md).

# Create Global Variable

Create a new global variable in your workspace. The `name` must be unique. On success, the response includes the full variable object with a `checksum` — store this for subsequent update and delete calls.

## Create global variable

> Create a new global variable in your workspace.\
> \
> \*\*Required fields:\*\* \`name\`, \`dataType\`, \`value\`.\
> \
> \*\*\`dataType\`\*\* must be one of: \`string\`, \`numeric\`, \`boolean\`, \`json\`. The \`value\` must match the declared type.\
> \
> \*\*\`isSecret\`\*\* (default \`false\`) — when true, the value is masked in all subsequent get and list responses.\
> \
> \*\*\`canReset\`\*\* (default \`false\`) — when true, the variable can be reset to its original value via the UI.\
> \
> \*\*On success:\*\* \`data.id\` is the variable's entity ID (use it as \`entity-id\` for get and update calls) and \`data.checksum\` must be stored — it's required to update the variable.

```json
{"openapi":"3.0.3","info":{"title":"Nected Global Variable API (Dev V1)","version":"1.0"},"tags":[{"name":"Global Variable API","description":"The Global Variable API lets you list, create, read and update **global variables** in your workspace. Global variables are reusable, named values referenced across rules and workflows, useful for configuration values, feature flags, rate constants and secrets.\n\nAll endpoints follow the generic `/dev/v1/{entity-type}` path, with `entity-type` set to `variable`.\n\n**Supported operations:** list, create, get and update. Delete is not available in the `/dev/v1` API.\n\n**Supported `dataType` values:** `string`, `numeric`, `boolean`, `json`.\n\n**`checksum` and optimistic locking:** updating a variable requires its current `checksum` in the request body. Get it from the create response or from a get response. If it doesn't match the server's current checksum, the update is rejected.\n\n**Secret variables:** when `isSecret` is `true`, the `value` is masked as `***` in all get and list responses."}],"servers":[{"url":"https://api.nected.ai","description":"Production"}],"security":[{"DevAuth":[]}],"components":{"securitySchemes":{"DevAuth":{"type":"apiKey","in":"header","name":"Nected-API-Key","description":"Your Nected API key. Obtain from workspace settings."}},"schemas":{"NewVariable":{"type":"object","description":"Request body for creating a global variable. `name`, `dataType` and `value` are required. `isSecret` and `canReset` default to `false`.","required":["name","dataType","value"],"properties":{"name":{"type":"string","description":"Unique variable name (alphanumeric and underscores recommended)"},"dataType":{"type":"string","description":"Data type of the value","enum":["string","numeric","boolean","json"]},"value":{"description":"Variable value — type must match `dataType`"},"isSecret":{"type":"boolean","description":"Mask value in all responses (default false)","default":false},"canReset":{"type":"boolean","description":"Allow resetting to original value via UI (default false)","default":false}}},"CreateVariableResponse":{"type":"object","description":"Success response for create","properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"Entity ID of the created variable — use for get and update calls"},"checksum":{"type":"string","description":"Checksum of the created variable — required to update it"}}},"code":{"type":"string"},"message":{"type":"string"}}},"ErrorResponse":{"type":"object","description":"Error response wrapper","properties":{"code":{"type":"string"},"message":{"type":"string","description":"Human-readable error description"},"data":{"type":"object","nullable":true}}}}},"paths":{"/dev/v1/variable":{"post":{"operationId":"createGlobalVariable","tags":["Global Variable API"],"summary":"Create global variable","description":"Create a new global variable in your workspace.\n\n**Required fields:** `name`, `dataType`, `value`.\n\n**`dataType`** must be one of: `string`, `numeric`, `boolean`, `json`. The `value` must match the declared type.\n\n**`isSecret`** (default `false`) — when true, the value is masked in all subsequent get and list responses.\n\n**`canReset`** (default `false`) — when true, the variable can be reset to its original value via the UI.\n\n**On success:** `data.id` is the variable's entity ID (use it as `entity-id` for get and update calls) and `data.checksum` must be stored — it's required to update the variable.","parameters":[{"name":"Nected-Branch","in":"header","required":false,"description":"Branch name (optional)","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewVariable"}}}},"responses":{"201":{"description":"Created — `data.id` is the variable's entity ID and `data.checksum` is needed for updates","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateVariableResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```
