> 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/list responses.\
> \
> \*\*\`canReset\`\*\* (default \`false\`) — when true, the variable can be reset to its original value via the UI.\
> \
> \*\*On success:\*\* the response \`data\` includes the created variable object with its \`checksum\` — store this for update and delete calls.\
> \
> \*\*Canonical request body:\*\* \`Create/create\_variable.json\`

```json
{"openapi":"3.0.3","info":{"title":"Nected Global Variable API","version":"1.0"},"tags":[{"name":"GlobalVariable","description":"Create, read, update, and delete global variables."}],"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}}},"VariableResponse":{"type":"object","description":"Standard response wrapper for single-variable operations (create, get-by-name, update)","properties":{"data":{"$ref":"#/components/schemas/GlobalVariable"},"code":{"type":"string"},"message":{"type":"string"}}},"GlobalVariable":{"type":"object","description":"A global variable object as returned by get and list endpoints","properties":{"name":{"type":"string","description":"Unique variable name within the workspace"},"dataType":{"type":"string","description":"Data type — one of `string`, `numeric`, `boolean`, `json`","enum":["string","numeric","boolean","json"]},"value":{"description":"Variable value. Masked as `***` in responses when `isSecret` is true."},"isSecret":{"type":"boolean","description":"When true, value is masked in all get/list responses"},"canReset":{"type":"boolean","description":"When true, the variable can be reset to its original value via the UI"},"checksum":{"type":"string","description":"Current checksum — required for update and delete operations"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"ErrorResponse":{"type":"object","description":"Error response wrapper","properties":{"code":{"type":"string"},"message":{"type":"string","description":"Human-readable error description"},"data":{"nullable":true}}}}},"paths":{"/dev/variable":{"post":{"operationId":"createGlobalVariable","tags":["GlobalVariable"],"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/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:** the response `data` includes the created variable object with its `checksum` — store this for update and delete calls.\n\n**Canonical request body:** `Create/create_variable.json`","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":{"200":{"description":"OK — variable created, includes `checksum` for update/delete","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VariableResponse"}}}},"400":{"description":"Bad Request — validation error or duplicate name","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

### Example request body (full JSON)

{% file src="/files/teCuyNatZWflyc6WwpbI" %}

### Response (`200`)

```
{
  "data": {
    "name": "tax_rate_gst",
    "dataType": "numeric",
    "value": 18,
    "isSecret": false,
    "canReset": true,
    "checksum": "a3f1b2c4d5e6f7a8b9c0d1e2f3a4b5c6",
    "createdAt": "2026-01-10T10:00:00.000Z",
    "updatedAt": "2026-01-10T10:00:00.000Z"
  },
  "code": "success",
  "message": "Variable created successfully."
}

```

Use the API reference below to try the endpoint.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nected.ai/nected-docs/management-api/global-variable-api/create-global-variable.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
