Harness Policies API

Create, edit and delete Governance policies written in rego

Operations 7

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 /pm/api/v1/policies List OPA policies · Policies#list #
Ask an LLM
“Which governance policies are defined in my Harness project?”
“Can I list policies without their Rego and with a count of policy sets each belongs to?”
Tell an agent
List policies in project {project} of org {org}.
Search policies for {term} in account {account}.
POST /pm/api/v1/policies Create an OPA policy · Policies#create #
Ask an LLM
“How do I write a new Rego policy in Harness?”
“Can I create a policy that's stored in a Git repository instead of inline?”
Tell an agent
Create policy {name} with identifier {identifier} and this Rego: {rego}
Create policy {name} ({identifier}) stored at {git_path} in repo {git_repo}.
POST /pm/api/v1/policies/move-policy/{identifier} Move an inline policy to Git · Policies#move policy #
Ask an LLM
“Can I move a policy I wrote inline into a Git repository?”
“What commit message and path are needed to convert a policy to remote storage?”
Tell an agent
Move inline policy {identifier} to {git_path} in repo {git_repo} on branch {branch}, commit message {message}.
Convert policy {identifier} to remote Git storage in {git_repo} at {git_path} on {branch}: {message}
DELETE /pm/api/v1/policies/{identifier} Delete a policy · Policies#delete #
Ask an LLM
“Why can't I delete a policy that policy sets still reference?”
“Can I force-delete a policy even when it's used in policy sets?”
Tell an agent destructive · confirm first
Delete policy {identifier}.
Force delete policy {identifier} even if policy sets reference it.
GET /pm/api/v1/policies/{identifier} Get one policy by identifier · Policies#find #
Ask an LLM
“What Rego does a specific policy contain?”
“Can I read a Git-backed policy from a particular branch?”
Tell an agent
Get policy {identifier}.
Show policy {identifier} as it exists on Git branch {branch}.
PATCH /pm/api/v1/policies/{identifier} Update a policy's name or Rego · Policies#update #
Ask an LLM
“How do I change the Rego of an existing policy?”
“Can I rename a policy and commit the change to Git at the same time?”
Tell an agent
Replace the Rego of policy {identifier} with: {rego}
Rename policy {identifier} to {name} with commit message {message}.
GET /pm/api/v1/policies/{identifier}/policysets List policy sets that use a policy · Policies#list policy sets #
Ask an LLM
“Which policy sets reference a given policy?”
“What would be affected if I changed or removed this policy?”
Tell an agent
List the policy sets that reference policy {identifier}.
Search policy sets using policy {identifier} for {term}.

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-policies-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-policies-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Harness Policies 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 (96 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/harness/refs/heads/main/openapi/harness-policies-api-openapi.yml