> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/infrastructure-as-code-management/iacm-api-reference/variables/get-variables-provider-connectors-and-variable-files.md).

# Get variables, provider connectors, and variable files

Returns all terraform/environment variables, provider connectors, and variable files for a workspace

```json
{"openapi":"3.0.3","info":{"title":"Infrastructure as Code Management","version":"0.1.0"},"tags":[{"name":"variables","description":"Variables Service handles the API for managing workspace variables."}],"servers":[{"url":"http://localhost:80"}],"paths":{"/api/orgs/{org}/projects/{project}/workspaces/{workspace}/variables/merged":{"get":{"tags":["variables"],"summary":"Get variables, provider connectors, and variable files","description":"Returns all terraform/environment variables, provider connectors, and variable files for a workspace","operationId":"variables#get-variables-and-providers","parameters":[{"name":"org","in":"path","description":"Org is the organisation identifier.","required":true,"schema":{"type":"string","description":"Org is the organisation identifier.","minLength":1,"maxLength":128}},{"name":"project","in":"path","description":"Project is the project identifier.","required":true,"schema":{"type":"string","description":"Project is the project identifier.","minLength":1,"maxLength":128}},{"name":"workspace","in":"path","description":"Workspace is the resource workspace this variable is associated with.","required":true,"schema":{"type":"string","description":"Workspace is the resource workspace this variable is associated with."}},{"name":"Harness-Account","in":"header","description":"Account is the internal customer account ID.","allowEmptyValue":true,"required":true,"schema":{"type":"string","description":"Account is the internal customer account ID.","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetVariablesAndProvidersResponse"}}}},"400":{"description":"BadRequestError: Bad Request response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UnauthorizedError: Unauthorized response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"ForbiddenError: Forbidden response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NotFoundError: Not Found response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"408":{"description":"TimeoutError: Request Timeout response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"ConflictError: Conflict response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"description":"LockedError: Locked response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"499":{"description":"ContextCancelledError:  response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"InternalServerError: Internal Server Error response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"BadGatewayError: Bad Gateway response.","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"GetVariablesAndProvidersResponse":{"type":"object","properties":{"environment_variables":{"type":"array","items":{"$ref":"#/components/schemas/VariableWithPermissions"}},"provider_connectors":{"type":"array","items":{"$ref":"#/components/schemas/ProviderConnectorWithPermissions"}},"terraform_variables":{"type":"array","items":{"$ref":"#/components/schemas/VariableWithPermissions"}},"variable_files":{"type":"array","items":{"$ref":"#/components/schemas/VariableFileWithPermissions"}}},"required":["terraform_variables","environment_variables","provider_connectors","variable_files"]},"VariableWithPermissions":{"type":"object","properties":{"associatedTemplate":{"type":"string"},"associatedVariableSet":{"type":"string"},"created":{"type":"integer","format":"int64"},"inUse":{"type":"boolean","description":"Indicates if this variable is the one actively used in the workspace"},"includeInWorkspace":{"type":"boolean"},"isLocked":{"type":"boolean"},"key":{"type":"string"},"kind":{"type":"string"},"permissions":{"$ref":"#/components/schemas/VariablePermissions"},"source":{"type":"string","enum":["workspace","template","variableSet"]},"updated":{"type":"integer","format":"int64"},"uuid":{"type":"string","description":"Unique identifier for this variable"},"value":{"type":"string"},"value_type":{"type":"string"}},"required":["uuid","key","value","value_type","source","kind","includeInWorkspace","isLocked","created","updated","permissions","inUse"]},"VariablePermissions":{"type":"object","properties":{"canDelete":{"type":"boolean"},"canEditKey":{"type":"boolean"},"canEditValue":{"type":"boolean"},"canEditValueType":{"type":"boolean"}},"required":["canDelete","canEditKey","canEditValue","canEditValueType"]},"ProviderConnectorWithPermissions":{"type":"object","properties":{"associatedTemplate":{"type":"string"},"associatedVariableSet":{"type":"string"},"connector_ref":{"type":"string"},"created":{"type":"integer","format":"int64"},"inUse":{"type":"boolean","description":"Indicates if this connector is the one actively used in the workspace"},"isInWorkspace":{"type":"boolean"},"isLocked":{"type":"boolean"},"permissions":{"$ref":"#/components/schemas/ConnectorPermissions"},"source":{"type":"string","enum":["workspace","template","variableSet"]},"type":{"type":"string","enum":["aws","azure","gcp","vault"]},"updated":{"type":"integer","format":"int64"},"uuid":{"type":"string","description":"Unique identifier for this connector"}},"required":["uuid","connector_ref","type","created","updated","source","isInWorkspace","permissions","inUse","isLocked"]},"ConnectorPermissions":{"type":"object","properties":{"canDelete":{"type":"boolean"}},"required":["canDelete"]},"VariableFileWithPermissions":{"type":"object","properties":{"associatedTemplate":{"type":"string"},"associatedVariableSet":{"type":"string"},"inUse":{"type":"boolean","description":"Indicates if this variable file is the one actively used in the workspace"},"isInWorkspace":{"type":"boolean"},"isLocked":{"type":"boolean"},"permissions":{"$ref":"#/components/schemas/VariableFilePermissions"},"repository":{"type":"string"},"repository_branch":{"type":"string"},"repository_commit":{"type":"string"},"repository_connector":{"type":"string"},"repository_path":{"type":"string"},"repository_sha":{"type":"string"},"source":{"type":"string","enum":["workspace","template","variableSet"]},"uuid":{"type":"string","description":"Unique identifier for this file"}},"required":["uuid","repository","source","isInWorkspace","permissions","inUse","repository_path","isLocked"]},"VariableFilePermissions":{"type":"object","properties":{"canDelete":{"type":"boolean"},"canEdit":{"type":"boolean"}},"required":["canDelete","canEdit"]},"Error":{"type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?"},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem."},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem."},"name":{"type":"string","description":"Name is the name of this class of errors."},"temporary":{"type":"boolean","description":"Is the error temporary?"},"timeout":{"type":"boolean","description":"Is the error a timeout?"}},"required":["name","id","message","temporary","timeout","fault"]}}}}
```
