> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blinkops.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create A Variable

Create a new variable in a specified workspace.

<Note>
  External Documentation

  To learn more, visit the [Terraform Cloud documentation](https://developer.hashicorp.com/terraform/cloud-docs/api-docs/variables#create-a-variable).
</Note>

## Parameters

<div className="integrations-table">
  | Parameter      | Description                                                                                                     |
  | -------------- | --------------------------------------------------------------------------------------------------------------- |
  | Category       | Whether this is a Terraform or environment variable.                                                            |
  | Description    | An optional description for the variable (mainly for readability purposes).                                     |
  | HCL            | Whether to evaluate the value of the variable as a string of HCL code. Has no effect for environment variables. |
  | Sensitive      | Whether the value is sensitive. If true then the variable is written once and not visible thereafter.           |
  | Variable Key   | The key of the new variable.                                                                                    |
  | Variable Value | The value of the new variable.                                                                                  |
  | Workspace ID   | Specifies the workspace ID where the var will be created.                                                       |
</div>

## Example Output

```json theme={"dark"}
{
	"data": {
		"id": "var-EavQ1LztoRTQHSNT",
		"type": "vars",
		"attributes": {
			"key": "some_key",
			"value": "some_value",
			"sensitive": false,
			"category": "terraform",
			"hcl": false,
			"created-at": "2023-04-03T18:47:13",
			"description": "some description",
			"version-id": "<string>"
		},
		"relationships": {
			"configurable": {
				"data": {
					"id": "ws-4j8p6jX1w33MiDC7",
					"type": "workspaces"
				},
				"links": {
					"related": "/api/v2/organizations/my-organization/workspaces/my-workspace"
				}
			},
			"workspace": {
				"data": {
					"id": "<string>",
					"type": "<string>"
				},
				"links": {
					"related": "<string>"
				}
			}
		},
		"links": {
			"self": "/api/v2/vars/var-EavQ1LztoRTQHSNT"
		}
	}
}
```

## Workflow Library Example

[Create a Variable with Terraform Cloud and Send Results Via Email](https://library.blinkops.com/workflows/create-a-variable-with-terraform-cloud-and-send-results-via-email)

<div className="iframe-wrapper">
  <div className="iframe-media">
    <img src="https://mintcdn.com/blinkops-2/ojHYuDeYX5FWuN8a/img/Icons/play-box.svg?fit=max&auto=format&n=ojHYuDeYX5FWuN8a&q=85&s=b8af968e71438a9499c3223c9bd29fb2" alt="Workflow Library" width="16" height="16" data-path="img/Icons/play-box.svg" />

    Preview this Workflow on desktop
  </div>

  <iframe className="iframe" src="https://library.blinkops.com/workflows/create-a-variable-with-terraform-cloud-and-send-results-via-email/canvas" />
</div>
