Harness Workspaces API

Workspaces Service handles the API for managing workspaces and triggering workflows against them.

Operations 41

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /iacm/api/orgs/{org}/projects/{project}/tags List tags used across workspaces in a project · List all workspace tags #
Ask an LLM
“Which tags are applied to the infrastructure workspaces in my project?”
“Can I see every workspace tag in use before I filter workspaces by tag?”
Tell an agent
List all workspace tags in project {project} of org {org}.
Show me the distinct tags my IaCM workspaces use in {project}.
GET /iacm/api/orgs/{org}/projects/{project}/workspace-metrics Show workspace metrics for a project · Show workspace metrics #
Ask an LLM
“What metrics does Harness IaCM report for the workspaces in a project?”
“Can I get workspace metrics for a specific time window?”
Tell an agent
Show workspace metrics for project {project} in org {org}.
Get workspace metrics for {project} between {start_time} and {end_time}.
GET /iacm/api/orgs/{org}/projects/{project}/workspaces List infrastructure workspaces in a project · List workspaces #
Ask an LLM
“How do I list all the IaCM workspaces in a project?”
“Can I filter my workspaces by status or tag?”
Tell an agent
List the workspaces in project {project} of org {org}.
Find workspaces in {project} matching {searchTerm}.
POST /iacm/api/orgs/{org}/projects/{project}/workspaces Create an infrastructure workspace · Create workspace #
Ask an LLM
“How do I create a new Terraform or OpenTofu workspace in Harness IaCM?”
“What do I need to provide to set up a workspace, like provisioner and provider connector?”
Tell an agent
Create workspace {name} with identifier {identifier} in project {project} of org {org}.
Set up a new {provisioner} workspace {name} using provider connector {provider_connector}.
DELETE /iacm/api/orgs/{org}/projects/{project}/workspaces/{identifier} Delete a workspace · Destroy workspace #
Ask an LLM
“How do I delete an IaCM workspace I no longer need?”
“Can I remove a workspace entirely from a project?”
Tell an agent destructive · confirm first
Delete workspace {identifier} from project {project} in org {org}.
Remove the workspace {identifier} permanently.
GET /iacm/api/orgs/{org}/projects/{project}/workspaces/{identifier} Show one workspace's details · Show workspace #
Ask an LLM
“How do I look up the configuration of a single IaCM workspace?”
“What provisioner and repository is a given workspace configured with?”
Tell an agent
Show workspace {identifier} in project {project} of org {org}.
Get the details of workspace {identifier}.
PUT /iacm/api/orgs/{org}/projects/{project}/workspaces/{identifier} Update an existing workspace's settings · Update workspace #
Ask an LLM
“How do I change the repository branch or provisioner version on an existing workspace?”
“Can I turn on cost estimation for a workspace I already created?”
Tell an agent
Update workspace {identifier} in project {project} of org {org} with the new settings.
Point existing workspace {identifier} at branch {repository_branch}.
POST /iacm/api/orgs/{org}/projects/{project}/workspaces/{identifier}/actions/force-unlock Force-unlock a locked workspace · Unlock workspace #
Ask an LLM
“How do I clear a stuck lock on a workspace, even one set automatically?”
“Is it safe to call unlock on a workspace that is not locked?”
Tell an agent
Force unlock workspace {identifier} in project {project} of org {org}.
Remove whatever lock is on workspace {identifier}.
POST /iacm/api/orgs/{org}/projects/{project}/workspaces/{identifier}/actions/lock Place a manual lock on a workspace · Lock workspace #
Ask an LLM
“How do I lock a workspace so nobody runs changes against it?”
“Can I record a reason when I manually lock a workspace?”
Tell an agent
Lock workspace {identifier} in project {project} of org {org}.
Put a manual lock on workspace {identifier} with reason {reason}.
GET /iacm/api/orgs/{org}/projects/{project}/workspaces/{identifier}/modules List modules used by a workspace · List modules #
Ask an LLM
“Which Terraform modules does a particular workspace use?”
“Can I see the modules associated with one workspace?”
Tell an agent
List the modules associated with workspace {identifier} in project {project} of org {org}.
Show which modules workspace {identifier} depends on.
GET /iacm/api/orgs/{org}/projects/{project}/workspaces/{identifier}/resources List resources managed by a workspace · List resources #
Ask an LLM
“What cloud resources does a workspace currently manage?”
“Can I filter a workspace's resources by resource type and page through them?”
Tell an agent
List the resources managed by workspace {identifier} in project {project} of org {org}.
List resources of type {resource_types} in workspace {identifier}.
POST /iacm/api/orgs/{org}/projects/{project}/workspaces/{identifier}/resources/search Search a workspace's resources using selectors · List resources using selectors #
Ask an LLM
“Can I query a workspace's resources with selectors instead of just listing them all?”
“What happens if I search workspace resources without a page or limit?”
Tell an agent
Search resources in workspace {identifier} of project {project} in org {org} using selectors {selectors}.
Find resources in workspace {identifier} that match selectors {selectors}, {limit} per page.
POST /iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/clone Clone a workspace under a new name · Clone workspace #
Ask an LLM
“How do I copy an existing workspace to make a new one?”
“Can I duplicate a workspace and give the copy its own identifier?”
Tell an agent
Clone workspace {workspace} in project {project} of org {org} as {name} with identifier {identifier}.
Make a copy of workspace {workspace} called {name}.
GET /iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/data List stored plan and state data for a workspace · List data #
Ask an LLM
“Where can I see the plan and state files stored for a workspace?”
“Can I filter a workspace's stored data by pipeline execution or data type?”
Tell an agent
List all stored data for workspace {workspace} in project {project} of org {org}.
List {data_type} data stored for workspace {workspace} from execution {pipeline_execution_id}.
POST /iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/data Store provisioner plan or state data · Create data #
Ask an LLM
“How do I upload a plan or state file the provisioner generated to a workspace?”
“What pipeline and stage details must I pass when storing workspace data?”
Tell an agent
Store {data_type} data for workspace {workspace} in project {project} of org {org} from pipeline {pipeline_id} stage {stage_id}.
Save the provisioner output for workspace {workspace} under execution {pipeline_execution_id}.
GET /iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/data/{id} Download one stored plan or state file · Show data #
Ask an LLM
“How do I fetch a specific plan or state file stored on a workspace?”
“Can I download the binary data for one stored workspace record?”
Tell an agent
Get stored data {id} from workspace {workspace} in project {project} of org {org}.
Download the state file with id {id} for workspace {workspace}.
GET /iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/data/{id}/evaluate-policy Evaluate policy against stored workspace data · Evaluate data #
Ask an LLM
“Can I run OPA policies against a plan file that is already stored?”
“How do I check whether a stored state file passes a policy action?”
Tell an agent
Evaluate policy action {policy_action} against data {id} in workspace {workspace} of project {project} in org {org}.
Run policy checks for {policy_action} on stored plan {id}.
POST /iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/dependency-graph Upload a dependency graph for a plan · Upload dependency graph data #
Ask an LLM
“How do I attach a resource dependency graph to an existing plan file?”
“What execution details does uploading a dependency graph require?”
Tell an agent
Upload the dependency graph for workspace {workspace} in project {project} of org {org} from pipeline {pipeline_id} stage {stage_id}.
Attach dependency graph data to the plan from execution {pipeline_execution_id} on workspace {workspace}.
DELETE /iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/drift-config Disable drift automation on a workspace · Disable drift automation for a workspace #
Ask an LLM
“How do I stop scheduled drift detection on a workspace?”
“Can I remove the drift schedule without deleting the workspace?”
Tell an agent destructive · confirm first
Disable drift automation for workspace {workspace} in project {project} of org {org}.
Turn off drift detection on workspace {workspace}.
GET /iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/drift-config Check drift automation status for a workspace · Get drift automation status for a workspace #
Ask an LLM
“Is drift detection turned on for a workspace?”
“How can I see the drift automation schedule a workspace uses?”
Tell an agent
Get the drift automation status for workspace {workspace} in project {project} of org {org}.
Tell me whether drift detection is enabled on workspace {workspace}.
PUT /iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/drift-config Enable scheduled drift detection on a workspace · Enable drift automation for a workspace #
Ask an LLM
“How do I schedule drift detection to run on a workspace?”
“Can I choose which pipeline runs drift checks and how often?”
Tell an agent
Enable drift detection on workspace {workspace} in project {project} of org {org} using pipeline {pipeline_id}.
Run drift checks on workspace {workspace} every {run_every} {run_every_unit}.
DELETE /iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/ephemeral-config Remove the ephemeral TTL from a workspace · Disable ephemeral TTL for a workspace #
Ask an LLM
“How do I cancel a scheduled auto-destroy on an ephemeral workspace?”
“Can I make an ephemeral workspace permanent again?”
Tell an agent destructive · confirm first
Disable ephemeral TTL for workspace {workspace} in project {project} of org {org}.
Stop workspace {workspace} from being destroyed automatically.
GET /iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/ephemeral-config Check ephemeral TTL settings for a workspace · Get ephemeral TTL status for a workspace #
Ask an LLM
“Does a workspace have a time-to-live that will destroy its infrastructure?”
“How can I see when an ephemeral workspace is scheduled to be torn down?”
Tell an agent
Get the ephemeral TTL status of workspace {workspace} in project {project} of org {org}.
Show whether workspace {workspace} is set to auto-destroy.
PUT /iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/ephemeral-config Set a TTL to auto-destroy a workspace's infrastructure · Enable ephemeral TTL for a workspace #
Ask an LLM
“Can I make a workspace ephemeral so its infrastructure is destroyed automatically?”
“Is it possible to also delete the workspace itself after the TTL expires?”
Tell an agent
Enable ephemeral TTL on workspace {workspace} in project {project} of org {org} using pipeline {pipeline_id}.
Destroy the infrastructure in workspace {workspace} on {destroy_on_date}.
POST /iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/events Send a provisioner event to a workspace · Send event #
Ask an LLM
“How do I record an event against a workspace from a pipeline run?”
“What event type and metadata can I send to a workspace?”
Tell an agent
Send a {event_type} event to workspace {workspace} in project {project} of org {org}.
Post event {event_type} for workspace {workspace} tied to execution {pipeline_execution_id}.
GET /iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/pipelines List pipelines that use a workspace · List pipelines #
Ask an LLM
“Which pipelines reference a given workspace?”
“Before changing a workspace, can I see every pipeline it is used in?”
Tell an agent
List the pipelines that use workspace {workspace} in project {project} of org {org}.
Show where workspace {workspace} is used in pipelines.
POST /iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/remote-executions Start a remote execution for a workspace · Create remote execution #
Ask an LLM
“How do I create a remote plan run for a workspace from my local code?”
“Can I pass custom arguments when creating a remote execution?”
Tell an agent
Create a remote execution for workspace {workspace} in project {project} of org {org}.
Create a remote execution on workspace {workspace} with arguments {custom_arguments}.
GET /iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/remote-executions/{id} Show a remote execution · Show remote execution #
Ask an LLM
“How do I check on a remote execution I created for a workspace?”
“What details are returned for a single remote execution?”
Tell an agent
Show remote execution {id} for workspace {workspace} in project {project} of org {org}.
Look up remote execution {id}.
GET /iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/remote-executions/{id}/download Download source code for a remote execution · Download remote execution #
Ask an LLM
“Can I download the source code that was uploaded for a remote plan?”
“Where do I get the code bundle behind a remote execution?”
Tell an agent
Download the source for remote execution {id} on workspace {workspace} in project {project} of org {org}.
Fetch the code bundle for remote plan {id}.
POST /iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/remote-executions/{id}/execute Run a remote execution · execute-remote-execution workspaces #
Ask an LLM
“Once the source is uploaded, how do I kick off the remote execution?”
“Can I run a remote plan against a workspace after creating it?”
Tell an agent
Execute remote execution {id} on workspace {workspace} in project {project} of org {org}.
Start running remote execution {id} now.
POST /iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/remote-executions/{id}/upload Upload source code for a remote execution · Upload remote execution source #
Ask an LLM
“How do I upload my local code for a remote execution?”
“Does uploading remote execution source require a content digest?”
Tell an agent
Upload source code for remote execution {id} on workspace {workspace} in project {project} of org {org}.
Upload the code bundle to remote execution {id} with digest {Content-Digest}.
GET /iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/resource-types List resource types in a workspace · List workspace resource types #
Ask an LLM
“What kinds of resource types exist in a workspace's state?”
“Can I get just the list of resource types a workspace manages, without the attributes?”
Tell an agent
List resource types used by workspace {workspace} in project {project} of org {org}.
Show the resource types in workspace {workspace}.
GET /iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/resource-types-and-attributes Map a workspace's resource types to their attributes · Map of resource types and their attributes #
Ask an LLM
“Can I get every resource type in a workspace together with its attributes in one call?”
“Which attributes does each resource type in my workspace expose?”
Tell an agent
Get the map of resource types and attributes for workspace {workspace} in project {project} of org {org}.
Show all resource types with their attributes for workspace {workspace}.
GET /iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/resource-types/{resource_type}/attributes List attributes of one resource type in a workspace · List workspace resource type attributes #
Ask an LLM
“What attributes does a single resource type have in my workspace?”
“How do I see the attributes of aws_s3_bucket resources in a workspace?”
Tell an agent
List attributes of resource type {resource_type} in workspace {workspace} of project {project} in org {org}.
Show the attributes for {resource_type} resources in workspace {workspace}.
DELETE /iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/resources Delete destroyed resources from a workspace · Delete resources #
Ask an LLM
“How do I clean up resource records that were already destroyed?”
“Can I remove specific destroyed resources from a workspace's inventory?”
Tell an agent destructive · confirm first
Delete destroyed resources {resources} from workspace {workspace} in project {project} of org {org}.
Remove the destroyed resource records {resources} from workspace {workspace}.
PATCH /iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/resources Update the resources recorded for a workspace · Update resources #
Ask an LLM
“How do I push an updated resource inventory to a workspace?”
“Can I tag a resource update with a session id and update mode?”
Tell an agent
Update resources {resources} for workspace {workspace} in project {project} of org {org}.
Record resources {resources} on workspace {workspace} for session {session_id}.
DELETE /iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/resources/stale Delete stale resources outside the current session · Delete stale resources #
Ask an LLM
“How do I purge workspace resources left over from earlier sessions?”
“Can I delete every resource that doesn't belong to my current session?”
Tell an agent destructive · confirm first
Delete stale resources from workspace {workspace} in project {project} of org {org} not in session {session_id}.
Purge resources on workspace {workspace} that aren't from session {session_id}.
POST /iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/risk-assessment Upload risk assessment data for a plan · Upload risk assessment data #
Ask an LLM
“How do I attach per-resource risk scores to an existing plan file?”
“Can I upload an overall risk summary for a workspace plan?”
Tell an agent
Upload risk assessment data for workspace {workspace} in project {project} of org {org} from pipeline {pipeline_id} stage {stage_id}.
Attach the risk summary to the plan from execution {pipeline_execution_id} on workspace {workspace}.
POST /iacm/api/orgs/{org}/projects/{project}/workspaces/{workspace}/state-versions/{data_id}/rollback Roll back workspace state to a previous version · Roll back workspace state to a previous version #
Ask an LLM
“How do I restore a workspace's Terraform state to an earlier version?”
“Can I roll back state while a pipeline is still running on the workspace?”
Tell an agent
Roll back workspace {workspace} in project {project} of org {org} to state version {data_id}.
Restore state version {data_id} on workspace {workspace} because {rollback_reason}.
GET /iacm/api/orgs/{org}/projects/{project}/workspaces/provisioners-ratio Show the mix of provisioners across workspaces · List provisioners ratio #
Ask an LLM
“What share of my workspaces use Terraform versus OpenTofu or other provisioners?”
“Can I see the provisioner ratio for a given time range?”
Tell an agent
Show the provisioner ratio for workspaces in project {project} of org {org}.
Get the provisioner breakdown in {project} from {start_time} to {end_time}.
GET /iacm/api/workspace/templates/{template_id} List workspaces created from a template · List workspaces associated with a template ID #
Ask an LLM
“Which workspaces across my account were built from a particular template?”
“Can I narrow the workspaces for a template down to one template version?”
Tell an agent
List all workspaces associated with template {template_id} across the account.
Find workspaces using version {version} of template {template_id}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/harness:harness-workspaces-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

harness-workspaces-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Harness Workspaces API
  version: '1.0'
  description: The Harness Software Delivery Platform uses OpenAPI Specification v3.0.
  contact:
    name: API Support
    email: contact@harness.io
    url: https://harness.io/
  x-logo:
    url: https://mma.prnewswire.com/media/779232/Harnes_logo_horizontal.jpg?p=facebook
    altText: Harness
  termsOfService: https://harness.io/terms-of-use/
servers:
- url: https://app.harness.io
  description: Harness host URL
- url: https://{vanity}
  description: Vanity URL
  variables:
    vanity:
      default: app.harness.io
security:
- x-api-key: []
tags:


# --- truncated at 32 KB (539 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/harness/refs/heads/main/openapi/harness-workspaces-api-openapi.yml