# Create workspace variable

Creates a new workspace variable

Endpoint: POST /iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/variables
Version: 1.0
Security: x-api-key

## Path parameters:

  - `org` (string, required)
    Org is the organisation identifier.
    Example: "w"

  - `project` (string, required)
    Project is the project identifier.
    Example: "f7"

  - `workspace` (string, required)
    Workspace is the resource workspace this variable is associated with.
    Example: "Neque dolore."

## Header parameters:

  - `Harness-Account` (string, required)
    Account is the internal customer account ID.
    Example: "y"

## Request fields (application/json):

  - `key` (string, required)
    Key is the identifier for the secret.
    Example: "ynl"

  - `kind` (string, required)
    Kind is the classfcation of the variable.
    Enum: "env", "tf"

  - `value` (string, required)
    Value is the value of the secret.
    Example: "Temporibus sed sint perspiciatis."

  - `value_type` (string, required)
    Type indecates the value type of the secret. In the case of secret this is a
reference to an item in the secret store
    Enum: "string", "secret"

## Response 200 fields (application/json):

  - `account` (string, required)
    Account is the internal customer account ID.
    Example: "m"

  - `created` (integer, required)
    Created is the unix timestamp at which the resource was originally created in milliseconds.
    Example: 8104352952604446000

  - `key` (string, required)
    Key is the identifier for the secret.
    Example: "9"

  - `kind` (string, required)
    Kind is the classfcation of the variable.
    Enum: "env", "tf"

  - `org` (string, required)
    Org is the organisation identifier.
    Example: "87"

  - `policy_evaluation` (object)
    The result of a single evaluation
    Example: {"account_id":"XRQAjvT37acOiXx9PRaQMF","action":"onrun","created":1636370209475,"details":[{"account_id":"eBqAoNchMLKigC_qZ5EdC","action":"onrun","created":1636669297674,"description":"Captures critical production policies","details":[{"deny_messages":["deployment stage 'example-stage' does not have a HarnessApproval step","deployment stage 'example-stage' has step 'run-script' that is forbidden type 'ShellScript'"],"output":"{\n    \"deny\": [\n        \"deployment stage 'deploy' does not have a HarnessApproval step\"\n    ],\n    \"stages_with_approval\": []\n}","policy":{"account_id":"eBqAoNchMLKigC_qZ5EdC","created":1636669297674,"identifier":"policy-1","name":"Pipeline Approval","org_id":"test-org","project_id":"test-project","rego":"","updated":1636669297674},"rego_error":"policy.rego:25: rego_parse_error: non-terminated string m == \"test","status":"error"},{"deny_messages":["deployment stage 'example-stage' does not have a HarnessApproval step","deployment stage 'example-stage' has step 'run-script' that is forbidden type 'ShellScript'"],"output":"{\n    \"deny\": [\n        \"deployment stage 'deploy' does not have a HarnessApproval step\"\n    ],\n    \"stages_with_approval\": []\n}","policy":{"account_id":"eBqAoNchMLKigC_qZ5EdC","created":1636669297674,"identifier":"policy-1","name":"Pipeline Approval","org_id":"test-org","project_id":"test-project","rego":"","updated":1636669297674},"rego_error":"policy.rego:25: rego_parse_error: non-terminated string m == \"test","status":"error"}],"enabled":true,"identifier":"policyset-1","name":"Production Policies","org_id":"test-org","project_id":"test-project","status":"error","type":"pipeline","updated":1636669297674},{"account_id":"eBqAoNchMLKigC_qZ5EdC","action":"onrun","created":1636669297674,"description":"Captures critical production policies","details":[{"deny_messages":["deployment stage 'example-stage' does not have a HarnessApproval step","deployment stage 'example-stage' has step 'run-script' that is forbidden type 'ShellScript'"],"output":"{\n    \"deny\": [\n        \"deployment stage 'deploy' does not have a HarnessApproval step\"\n    ],\n    \"stages_with_approval\": []\n}","policy":{"account_id":"eBqAoNchMLKigC_qZ5EdC","created":1636669297674,"identifier":"policy-1","name":"Pipeline Approval","org_id":"test-org","project_id":"test-project","rego":"","updated":1636669297674},"rego_error":"policy.rego:25: rego_parse_error: non-terminated string m == \"test","status":"error"},{"deny_messages":["deployment stage 'example-stage' does not have a HarnessApproval step","deployment stage 'example-stage' has step 'run-script' that is forbidden type 'ShellScript'"],"output":"{\n    \"deny\": [\n        \"deployment stage 'deploy' does not have a HarnessApproval step\"\n    ],\n    \"stages_with_approval\": []\n}","policy":{"account_id":"eBqAoNchMLKigC_qZ5EdC","created":1636669297674,"identifier":"policy-1","name":"Pipeline Approval","org_id":"test-org","project_id":"test-project","rego":"","updated":1636669297674},"rego_error":"policy.rego:25: rego_parse_error: non-terminated string m == \"test","status":"error"}],"enabled":true,"identifier":"policyset-1","name":"Production Policies","org_id":"test-org","project_id":"test-project","status":"error","type":"pipeline","updated":1636669297674}],"entity":"7bbca5d4-e9f2-4955-9b2a-019ec4d3645e","entity_metadata":"7bbca5d4-e9f2-4955-9b2a-019ec4d3645e","id":123,"input":"","org_id":"test-org","project_id":"test-project","status":"error","type":"pipeline,service"}

  - `policy_evaluation.account_id` (string, required)
    The Harness account in which the evaluation was performed
    Example: "XRQAjvT37acOiXx9PRaQMF"

  - `policy_evaluation.action` (string, required)
    The action that triggered evaluation
    Example: "onrun"

  - `policy_evaluation.created` (integer, required)
    The time at which the evaluation was performed in Unix time milliseconds
    Example: 1636370209475

  - `policy_evaluation.details` (array, required)
    The detailed results of te evaluation
    Example: [{"account_id":"eBqAoNchMLKigC_qZ5EdC","action":"onrun","created":1636669297674,"description":"Captures critical production policies","details":[{"deny_messages":["deployment stage 'example-stage' does not have a HarnessApproval step","deployment stage 'example-stage' has step 'run-script' that is forbidden type 'ShellScript'"],"output":"{\n    \"deny\": [\n        \"deployment stage 'deploy' does not have a HarnessApproval step\"\n    ],\n    \"stages_with_approval\": []\n}","policy":{"account_id":"eBqAoNchMLKigC_qZ5EdC","created":1636669297674,"identifier":"policy-1","name":"Pipeline Approval","org_id":"test-org","project_id":"test-project","rego":"","updated":1636669297674},"rego_error":"policy.rego:25: rego_parse_error: non-terminated string m == \"test","status":"error"},{"deny_messages":["deployment stage 'example-stage' does not have a HarnessApproval step","deployment stage 'example-stage' has step 'run-script' that is forbidden type 'ShellScript'"],"output":"{\n    \"deny\": [\n        \"deployment stage 'deploy' does not have a HarnessApproval step\"\n    ],\n    \"stages_with_approval\": []\n}","policy":{"account_id":"eBqAoNchMLKigC_qZ5EdC","created":1636669297674,"identifier":"policy-1","name":"Pipeline Approval","org_id":"test-org","project_id":"test-project","rego":"","updated":1636669297674},"rego_error":"policy.rego:25: rego_parse_error: non-terminated string m == \"test","status":"error"}],"enabled":true,"identifier":"policyset-1","name":"Production Policies","org_id":"test-org","project_id":"test-project","status":"error","type":"pipeline","updated":1636669297674},{"account_id":"eBqAoNchMLKigC_qZ5EdC","action":"onrun","created":1636669297674,"description":"Captures critical production policies","details":[{"deny_messages":["deployment stage 'example-stage' does not have a HarnessApproval step","deployment stage 'example-stage' has step 'run-script' that is forbidden type 'ShellScript'"],"output":"{\n    \"deny\": [\n        \"deployment stage 'deploy' does not have a HarnessApproval step\"\n    ],\n    \"stages_with_approval\": []\n}","policy":{"account_id":"eBqAoNchMLKigC_qZ5EdC","created":1636669297674,"identifier":"policy-1","name":"Pipeline Approval","org_id":"test-org","project_id":"test-project","rego":"","updated":1636669297674},"rego_error":"policy.rego:25: rego_parse_error: non-terminated string m == \"test","status":"error"},{"deny_messages":["deployment stage 'example-stage' does not have a HarnessApproval step","deployment stage 'example-stage' has step 'run-script' that is forbidden type 'ShellScript'"],"output":"{\n    \"deny\": [\n        \"deployment stage 'deploy' does not have a HarnessApproval step\"\n    ],\n    \"stages_with_approval\": []\n}","policy":{"account_id":"eBqAoNchMLKigC_qZ5EdC","created":1636669297674,"identifier":"policy-1","name":"Pipeline Approval","org_id":"test-org","project_id":"test-project","rego":"","updated":1636669297674},"rego_error":"policy.rego:25: rego_parse_error: non-terminated string m == \"test","status":"error"}],"enabled":true,"identifier":"policyset-1","name":"Production Policies","org_id":"test-org","project_id":"test-project","status":"error","type":"pipeline","updated":1636669297674}]

  - `policy_evaluation.details.account_id` (string, required)
    Harness account ID associated with this policy set
    Example: "eBqAoNchMLKigC_qZ5EdC"

  - `policy_evaluation.details.action` (string, required)
    Action that triggers the policy set
    Example: "onrun"

  - `policy_evaluation.details.created` (integer, required)
    Time the policy set was created
    Example: 1636669297674

  - `policy_evaluation.details.description` (string)
    Description of the policy set
    Example: "Captures critical production policies"

  - `policy_evaluation.details.details` (array, required)
    Example: [{"deny_messages":["deployment stage 'example-stage' does not have a HarnessApproval step","deployment stage 'example-stage' has step 'run-script' that is forbidden type 'ShellScript'"],"output":"{\n    \"deny\": [\n        \"deployment stage 'deploy' does not have a HarnessApproval step\"\n    ],\n    \"stages_with_approval\": []\n}","policy":{"account_id":"eBqAoNchMLKigC_qZ5EdC","created":1636669297674,"identifier":"policy-1","name":"Pipeline Approval","org_id":"test-org","project_id":"test-project","rego":"","updated":1636669297674},"rego_error":"policy.rego:25: rego_parse_error: non-terminated string m == \"test","status":"error"},{"deny_messages":["deployment stage 'example-stage' does not have a HarnessApproval step","deployment stage 'example-stage' has step 'run-script' that is forbidden type 'ShellScript'"],"output":"{\n    \"deny\": [\n        \"deployment stage 'deploy' does not have a HarnessApproval step\"\n    ],\n    \"stages_with_approval\": []\n}","policy":{"account_id":"eBqAoNchMLKigC_qZ5EdC","created":1636669297674,"identifier":"policy-1","name":"Pipeline Approval","org_id":"test-org","project_id":"test-project","rego":"","updated":1636669297674},"rego_error":"policy.rego:25: rego_parse_error: non-terminated string m == \"test","status":"error"}]

  - `policy_evaluation.details.details.deny_messages` (array, required)
    The values of any deny rego rules as returned by the rego engine
    Example: ["deployment stage 'example-stage' does not have a HarnessApproval step","deployment stage 'example-stage' has step 'run-script' that is forbidden type 'ShellScript'"]

  - `policy_evaluation.details.details.output` (any, required)
    The output returned by the rego engine when this policy was evaluated
    Example: "{\n    \"deny\": [\n        \"deployment stage 'deploy' does not have a HarnessApproval step\"\n    ],\n    \"stages_with_approval\": []\n}"

  - `policy_evaluation.details.details.policy` (object, required)
    Example: {"account_id":"eBqAoNchMLKigC_qZ5EdC","created":1636669297674,"identifier":"policy-1","name":"Pipeline Approval","org_id":"test-org","project_id":"test-project","rego":"","updated":1636669297674}

  - `policy_evaluation.details.details.policy.account_id` (string, required)
    Harness account ID associated with this policy
    Example: "eBqAoNchMLKigC_qZ5EdC"

  - `policy_evaluation.details.details.policy.created` (integer, required)
    Time the policy was created
    Example: 1636669297674

  - `policy_evaluation.details.details.policy.identifier` (string, required)
    identifier of the policy
    Example: "policy-1"

  - `policy_evaluation.details.details.policy.name` (string, required)
    Name of the policy
    Example: "Pipeline Approval"

  - `policy_evaluation.details.details.policy.org_id` (string, required)
    Harness organization ID associated with this policy
    Example: "test-org"

  - `policy_evaluation.details.details.policy.project_id` (string, required)
    Harness project ID associated with this policy
    Example: "test-project"

  - `policy_evaluation.details.details.policy.rego` (string, required)
    Rego that defines the policy

  - `policy_evaluation.details.details.policy.updated` (integer, required)
    Time the policy was last updated
    Example: 1636669297674

  - `policy_evaluation.details.details.rego_error` (string, required)
    Any errors returned by the rego engine when this policy was evaluated
    Example: "policy.rego:25: rego_parse_error: non-terminated string m == \"test"

  - `policy_evaluation.details.details.status` (string, required)
    The overall status for this individual policy indicating whether it passed
    Enum: "error", "warning", "pass"

  - `policy_evaluation.details.enabled` (boolean, required)
    Only enabled policy sets are evaluated when evaluating by type/action
    Example: true

  - `policy_evaluation.details.identifier` (string, required)
    Identifier of the policy set
    Example: "policyset-1"

  - `policy_evaluation.details.name` (string, required)
    Name of the policy set
    Example: "Production Policies"

  - `policy_evaluation.details.org_id` (string, required)
    Harness organization ID associated with this policy set
    Example: "test-org"

  - `policy_evaluation.details.project_id` (string, required)
    Harness project ID associated with this policy set
    Example: "test-project"

  - `policy_evaluation.details.status` (string, required)
    The overall status for this policy set indicating whether it passed
    Enum: "error", "warning", "pass"

  - `policy_evaluation.details.type` (string, required)
    Type of input suitable for the policy set
    Example: "pipeline"

  - `policy_evaluation.details.updated` (integer, required)
    Time the policy set was last updated
    Example: 1636669297674

  - `policy_evaluation.entity` (string, required)
    An arbitrary user-supplied string that globally identifies the entity under evaluation
    Example: "7bbca5d4-e9f2-4955-9b2a-019ec4d3645e"

  - `policy_evaluation.entity_metadata` (string, required)
    Additional arbitrary user-supplied metadata about the entity under evaluation
    Example: "7bbca5d4-e9f2-4955-9b2a-019ec4d3645e"

  - `policy_evaluation.id` (integer, required)
    The ID of this evaluation
    Example: 123

  - `policy_evaluation.input` (any, required)
    The input provided at evaluation time

  - `policy_evaluation.org_id` (string, required)
    The Harness organisation in which the evaluation was performed
    Example: "test-org"

  - `policy_evaluation.project_id` (string, required)
    The Harness project in which the evaluation was performed
    Example: "test-project"

  - `policy_evaluation.status` (string, required)
    The overall status of the evaluation indicating whether it passed
    Enum: "error", "warning", "pass"

  - `policy_evaluation.type` (string, required)
    The types of the entity under evaluation
    Example: "pipeline,service"

  - `project` (string, required)
    Project is the project identifier.
    Example: "5"

  - `updated` (integer, required)
    Modified is the unix timestamp at which the resource was last modified in milliseconds.
    Example: 2381449638828638700

  - `value` (string, required)
    Value is the value of the secret.
    Example: "Deleniti mollitia sed laudantium."

  - `value_type` (string, required)
    Type indecates the value type of the secret. In the case of secret this is a
reference to an item in the secret store
    Enum: "string", "secret"

  - `workspace` (string, required)
    Workspace is the resource workspace this variable is associated with.
    Example: "Voluptas cumque consequatur nam voluptas explicabo et."

## Response 400 fields (application/vnd.goa.error):

  - `fault` (boolean, required)
    Is the error a server-side fault?
    Example: true

  - `id` (string, required)
    ID is a unique identifier for this particular occurrence of the problem.
    Example: "123abc"

  - `message` (string, required)
    Message is a human-readable explanation specific to this occurrence of the problem.
    Example: "parameter 'p' must be an integer"

  - `name` (string, required)
    Name is the name of this class of errors.
    Example: "bad_request"

  - `policy_evaluation` (object)
    The result of a single evaluation
    Example: {"account_id":"XRQAjvT37acOiXx9PRaQMF","action":"onrun","created":1636370209475,"details":[{"account_id":"eBqAoNchMLKigC_qZ5EdC","action":"onrun","created":1636669297674,"description":"Captures critical production policies","details":[{"deny_messages":["deployment stage 'example-stage' does not have a HarnessApproval step","deployment stage 'example-stage' has step 'run-script' that is forbidden type 'ShellScript'"],"output":"{\n    \"deny\": [\n        \"deployment stage 'deploy' does not have a HarnessApproval step\"\n    ],\n    \"stages_with_approval\": []\n}","policy":{"account_id":"eBqAoNchMLKigC_qZ5EdC","created":1636669297674,"identifier":"policy-1","name":"Pipeline Approval","org_id":"test-org","project_id":"test-project","rego":"","updated":1636669297674},"rego_error":"policy.rego:25: rego_parse_error: non-terminated string m == \"test","status":"error"},{"deny_messages":["deployment stage 'example-stage' does not have a HarnessApproval step","deployment stage 'example-stage' has step 'run-script' that is forbidden type 'ShellScript'"],"output":"{\n    \"deny\": [\n        \"deployment stage 'deploy' does not have a HarnessApproval step\"\n    ],\n    \"stages_with_approval\": []\n}","policy":{"account_id":"eBqAoNchMLKigC_qZ5EdC","created":1636669297674,"identifier":"policy-1","name":"Pipeline Approval","org_id":"test-org","project_id":"test-project","rego":"","updated":1636669297674},"rego_error":"policy.rego:25: rego_parse_error: non-terminated string m == \"test","status":"error"}],"enabled":true,"identifier":"policyset-1","name":"Production Policies","org_id":"test-org","project_id":"test-project","status":"error","type":"pipeline","updated":1636669297674},{"account_id":"eBqAoNchMLKigC_qZ5EdC","action":"onrun","created":1636669297674,"description":"Captures critical production policies","details":[{"deny_messages":["deployment stage 'example-stage' does not have a HarnessApproval step","deployment stage 'example-stage' has step 'run-script' that is forbidden type 'ShellScript'"],"output":"{\n    \"deny\": [\n        \"deployment stage 'deploy' does not have a HarnessApproval step\"\n    ],\n    \"stages_with_approval\": []\n}","policy":{"account_id":"eBqAoNchMLKigC_qZ5EdC","created":1636669297674,"identifier":"policy-1","name":"Pipeline Approval","org_id":"test-org","project_id":"test-project","rego":"","updated":1636669297674},"rego_error":"policy.rego:25: rego_parse_error: non-terminated string m == \"test","status":"error"},{"deny_messages":["deployment stage 'example-stage' does not have a HarnessApproval step","deployment stage 'example-stage' has step 'run-script' that is forbidden type 'ShellScript'"],"output":"{\n    \"deny\": [\n        \"deployment stage 'deploy' does not have a HarnessApproval step\"\n    ],\n    \"stages_with_approval\": []\n}","policy":{"account_id":"eBqAoNchMLKigC_qZ5EdC","created":1636669297674,"identifier":"policy-1","name":"Pipeline Approval","org_id":"test-org","project_id":"test-project","rego":"","updated":1636669297674},"rego_error":"policy.rego:25: rego_parse_error: non-terminated string m == \"test","status":"error"}],"enabled":true,"identifier":"policyset-1","name":"Production Policies","org_id":"test-org","project_id":"test-project","status":"error","type":"pipeline","updated":1636669297674}],"entity":"7bbca5d4-e9f2-4955-9b2a-019ec4d3645e","entity_metadata":"7bbca5d4-e9f2-4955-9b2a-019ec4d3645e","id":123,"input":"","org_id":"test-org","project_id":"test-project","status":"error","type":"pipeline,service"}

  - `temporary` (boolean, required)
    Is the error temporary?
    Example: true

  - `timeout` (boolean, required)
    Is the error a timeout?
    Example: true

## Response 401 fields (application/vnd.goa.error):

  - `fault` (boolean, required)
    Is the error a server-side fault?
    Example: true

  - `id` (string, required)
    ID is a unique identifier for this particular occurrence of the problem.
    Example: "123abc"

  - `message` (string, required)
    Message is a human-readable explanation specific to this occurrence of the problem.
    Example: "parameter 'p' must be an integer"

  - `name` (string, required)
    Name is the name of this class of errors.
    Example: "bad_request"

  - `temporary` (boolean, required)
    Is the error temporary?
    Example: true

  - `timeout` (boolean, required)
    Is the error a timeout?


