Harness Rules API

The rules API from Harness — 4 operation(s) for rules.

Operations 10

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 /code/api/v1/repos/{repo_identifier}/rules List a repository's protection rules · List repo protection rules #
Ask an LLM
“What branch protection rules apply to one Harness Code repository?”
“Can I include rules a repo inherits from its project or org when listing them?”
Tell an agent
List the protection rules on repo {repo_identifier}.
Show protection rules of type {type} for repo {repo_identifier}, including inherited ones.
POST /code/api/v1/repos/{repo_identifier}/rules Add a protection rule to a repository · Add repo protection rule #
Ask an LLM
“How do I protect the main branch of a single repo from direct pushes?”
“Can a repository rule match branches by pattern?”
Tell an agent
Add a protection rule {identifier} to repo {repo_identifier} matching pattern {pattern}.
Create a {type} rule on repo {repo_identifier} with definition {definition}.
DELETE /code/api/v1/repos/{repo_identifier}/rules/{rule_identifier} Delete a repository protection rule · Delete repo protection rule #
Ask an LLM
“Can I remove a branch protection rule from just one repository?”
“What happens to a repo's protection once its rule is deleted?”
Tell an agent destructive · confirm first
Delete protection rule {rule_identifier} from repo {repo_identifier}.
Remove the repo-level rule {rule_identifier} in {repo_identifier}.
GET /code/api/v1/repos/{repo_identifier}/rules/{rule_identifier} Get a repository protection rule · Get repo protection rule #
Ask an LLM
“What exactly does a given protection rule on my repo enforce?”
“Is a particular repo rule active or disabled?”
Tell an agent
Show protection rule {rule_identifier} on repo {repo_identifier}.
Fetch the definition of repo rule {rule_identifier} in {repo_identifier}.
PATCH /code/api/v1/repos/{repo_identifier}/rules/{rule_identifier} Update a repository protection rule · Update repo protection rule #
Ask an LLM
“Can I temporarily disable a protection rule on a repo without deleting it?”
“How do I change which branches a repository rule covers?”
Tell an agent
Set repo rule {rule_identifier} in {repo_identifier} to state {state}.
Change the branch pattern of rule {rule_identifier} on repo {repo_identifier} to {pattern}.
GET /code/api/v1/rules List protection rules for an account, org or project · List acc/org/proj protection rules #
Ask an LLM
“Which protection rules are defined at the org or project level rather than per repo?”
“Can I search account-wide protection rules by name?”
Tell an agent
List the protection rules defined at account {account} level.
Show protection rules for project {project} matching {query}.
POST /code/api/v1/rules Add a protection rule for an account, org or project · Add acc/org/proj protection rule #
Ask an LLM
“How do I enforce one branch protection rule across every repo in a project?”
“Can an org-wide rule target only some repositories?”
Tell an agent
Add an org-wide protection rule {identifier} matching branches {pattern}.
Create a project-level rule {identifier} in account {account} that targets repos {repo_target}.
DELETE /code/api/v1/rules/{rule_identifier} Delete an account, org or project protection rule · Delete acc/org/proj protection rule #
Ask an LLM
“Can I remove a protection rule that applies across a whole project?”
“Does deleting an org-level rule lift protection from every repo it covered?”
Tell an agent destructive · confirm first
Delete the org or project level protection rule {rule_identifier}.
Remove account-wide rule {rule_identifier} from account {account}.
GET /code/api/v1/rules/{rule_identifier} Get an account, org or project protection rule · Get acc/org/proj protection rule #
Ask an LLM
“What does a particular org-level protection rule enforce?”
“Which repos does a project-wide rule apply to?”
Tell an agent
Show the org or project level protection rule {rule_identifier}.
Fetch account-level rule {rule_identifier} from account {account}.
PATCH /code/api/v1/rules/{rule_identifier} Update an account, org or project protection rule · Update acc/org/proj protection rule #
Ask an LLM
“How do I change the repos targeted by a project-wide protection rule?”
“Can I switch an org-level rule to monitor-only state?”
Tell an agent
Set org or project level rule {rule_identifier} to state {state}.
Update account-wide rule {rule_identifier} to target repos {repo_target}.

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-rules-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-rules-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Harness Rules 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:
- name: Rules
paths:
  /code/api/v1/repos/{repo_identifier}/rules:
    get:
      operationId: repoRuleList
      parameters:
      - description: Account Identifier for the Entity.
        in: query
        name: accountIdentifier
        required: true
        schema:
          type: string
      - description: Organization Identifier for the Entity.
        in: query
        name: orgIdentifier
        required: false
        schema:
          type: string
      - description: Project Identifier for the Entity.
        in: query
        name: projectIdentifier
        required: false
        schema:
          type: string
      - description: The substring by which the repository protection rules are filtered.
        in: query
        name: query
        required: false
        schema:
          type: string
      - description: The order of the output.
        in: query
        name: order
        required: false
        schema:
          default: asc
          enum:
          - asc
          - desc
          type: string
      - description: The field by which the protection rules are sorted.
        in: query
        name: sort
        required: false
        schema:
          default: created_at
          enum:
          - created_at
          - identifier
          - uid
          - updated_at
          type: string
      - description: The types of rules to include.
        explode: true
        in: query
        name: type
        required: false
        schema:
          items:
            enum:
            - branch
            - tag
            - push
            type: string
          type: array
        style: form
      - description: The page to return.
        in: query
        name: page
        required: false
        schema:
          default: 1
          minimum: 1
          type: integer
      - description: The maximum number of results to return.
        in: query
        name: limit
        required: false
        schema:
          default: 30
          maximum: 100
          minimum: 1
          type: integer
      - description: The result should inherit entities from parent spaces.
        in: query
        name: inherited
        required: false
        schema:
          default: false
          type: boolean
      - in: path
        name: repo_identifier
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/OpenapiRule'
                type: array
          description: OK
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Internal Server Error
      summary: List repo protection rules
      tags:
      - Rules
    post:
      operationId: repoRuleAdd
      parameters:
      - description: Account Identifier for the Entity.
        in: query
        name: accountIdentifier
        required: true
        schema:
          type: string
      - description: Organization Identifier for the Entity.
        in: query
        name: orgIdentifier
        required: false
        schema:
          type: string
      - description: Project Identifier for the Entity.
        in: query
        name: projectIdentifier
        required: false
        schema:
          type: string
      - in: path
        name: repo_identifier
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                definition:
                  $ref: '#/components/schemas/OpenapiRuleDefinition'
                description:
                  type: string
                identifier:
                  type: string
                pattern:
                  $ref: '#/components/schemas/ProtectionPattern'
                repo_target:
                  $ref: '#/components/schemas/ProtectionRepoTarget'
                state:
                  $ref: '#/components/schemas/EnumRuleState'
                type:
                  $ref: '#/components/schemas/OpenapiRuleType'
                uid:
                  deprecated: true
                  type: string
              type: object
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenapiRule'
          description: Created
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Internal Server Error
      summary: Add repo protection rule
      tags:
      - Rules
  /code/api/v1/repos/{repo_identifier}/rules/{rule_identifier}:
    delete:
      operationId: repoRuleDelete
      parameters:
      - description: Account Identifier for the Entity.
        in: query
        name: accountIdentifier
        required: true
        schema:
          type: string
      - description: Organization Identifier for the Entity.
        in: query
        name: orgIdentifier
        required: false
        schema:
          type: string
      - description: Project Identifier for the Entity.
        in: query
        name: projectIdentifier
        required: false
        schema:
          type: string
      - in: path
        name: repo_identifier
        required: true
        schema:
          type: string
      - in: path
        name: rule_identifier
        required: true
        schema:
          type: string
      responses:
        '204':
          description: No Content
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Internal Server Error
      summary: Delete repo protection rule
      tags:
      - Rules
    get:
      operationId: repoRuleGet
      parameters:
      - description: Account Identifier for the Entity.
        in: query
        name: accountIdentifier
        required: true
        schema:
          type: string
      - description: Organization Identifier for the Entity.
        in: query
        name: orgIdentifier
        required: false
        schema:
          type: string
      - description: Project Identifier for the Entity.
        in: query
        name: projectIdentifier
        required: false
        schema:
          type: string
      - in: path
        name: repo_identifier
        required: true
        schema:
          type: string
      - in: path
        name: rule_identifier
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenapiRule'
          description: OK
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Internal Server Error
      summary: Get repo protection rule
      tags:
      - Rules
    patch:
      operationId: repoRuleUpdate
      parameters:
      - description: Account Identifier for the Entity.
        in: query
        name: accountIdentifier
        required: true
        schema:
          type: string
      - description: Organization Identifier for the Entity.
        in: query
        name: orgIdentifier
        required: false
        schema:
          type: string
      - description: Project Identifier for the Entity.
        in: query
        name: projectIdentifier
        required: false
        schema:
          type: string
      - in: path
        name: repo_identifier
        required: true
        schema:
          type: string
      - in: path
        name: rule_identifier
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                definition:
                  $ref: '#/components/schemas/OpenapiRuleDefinition'
                description:
                  type:
                  - string
                  - 'null'
                identifier:
                  type:
                  - string
                  - 'null'
                pattern:
                  $ref: '#/components/schemas/ProtectionPattern'
                repo_target:
                  $ref: '#/components/schemas/ProtectionRepoTarget'
                state:
                  $ref: '#/components/schemas/EnumRuleState'
                type:
                  $ref: '#/components/schemas/OpenapiRuleType'
                uid:
                  deprecated: true
                  type:
                  - string
                  - 'null'
              type: object
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenapiRule'
          description: OK
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Internal Server Error
      summary: Update repo protection rule
      tags:
      - Rules
  /code/api/v1/rules:
    get:
      operationId: spaceRuleList
      parameters:
      - description: Account Identifier for the Entity.
        in: query
        name: accountIdentifier
        required: true
        schema:
          type: string
      - description: Organization Identifier for the Entity.
        in: query
        name: orgIdentifier
        required: false
        schema:
          type: string
      - description: Project Identifier for the Entity.
        in: query
        name: projectIdentifier
        required: false
        schema:
          type: string
      - description: The substring by which the repository protection rules are filtered.
        in: query
        name: query
        required: false
        schema:
          type: string
      - description: The types of rules to include.
        explode: true
        in: query
        name: type
        required: false
        schema:
          items:
            enum:
            - branch
            - tag
            - push
            type: string
          type: array
        style: form
      - description: The order of the output.
        in: query
        name: order
        required: false
        schema:
          default: asc
          enum:
          - asc
          - desc
          type: string
      - description: The field by which the protection rules are sorted.
        in: query
        name: sort
        required: false
        schema:
          default: created_at
          enum:
          - created_at
          - identifier
          - uid
          - updated_at
          type: string
      - description: The page to return.
        in: query
        name: page
        required: false
        schema:
          default: 1
          minimum: 1
          type: integer
      - description: The maximum number of results to return.
        in: query
        name: limit
        required: false
        schema:
          default: 30
          maximum: 100
          minimum: 1
          type: integer
      - description: The result should inherit entities from parent spaces.
        in: query
        name: inherited
        required: false
        schema:
          default: false
          type: boolean
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/OpenapiRule'
                type: array
          description: OK
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Internal Server Error
      summary: List acc/org/proj protection rules
      tags:
      - Rules
    post:
      operationId: spaceRuleAdd
      parameters:
      - description: Account Identifier for the Entity.
        in: query
        name: accountIdentifier
        required: true
        schema:
          type: string
      - description: Organization Identifier for the Entity.
        in: query
        name: orgIdentifier
        required: false
        schema:
          type: string
      - description: Project Identifier for the Entity.
        in: query
        name: projectIdentifier
        required: false
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                definition:
                  $ref: '#/components/schemas/OpenapiRuleDefinition'
                description:
                  type: string
                identifier:
                  type: string
                pattern:
                  $ref: '#/components/schemas/ProtectionPattern'
                repo_target:
                  $ref: '#/components/schemas/ProtectionRepoTarget'
                state:
                  $ref: '#/components/schemas/EnumRuleState'
                type:
                  $ref: '#/components/schemas/OpenapiRuleType'
                uid:
                  deprecated: true
                  type: string
              type: object
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenapiRule'
          description: Created
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Internal Server Error
      summary: Add acc/org/proj protection rule
      tags:
      - Rules
  /code/api/v1/rules/{rule_identifier}:
    delete:
      operationId: spaceRuleDelete
      parameters:
      - description: Account Identifier for the Entity.
        in: query
        name: accountIdentifier
        required: true
        schema:
          type: string
      - description: Organization Identifier for the Entity.
        in: query
        name: orgIdentifier
        required: false
        schema:
          type: string
      - description: Project Identifier for the Entity.
        in: query
        name: projectIdentifier
        required: false
        schema:
          type: string
      - in: path
        name: rule_identifier
        required: true
        schema:
          type: string
      responses:
        '204':
          description: No Content
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Internal Server Error
      summary: Delete acc/org/proj protection rule
      tags:
      - Rules
    get:
      operationId: spaceRuleGet
      parameters:
      - description: Account Identifier for the Entity.
        in: query
        name: accountIdentifier
        required: true
        schema:
          type: string
      - description: Organization Identifier for the Entity.
        in: query
        name: orgIdentifier
        required: false
        schema:
          type: string
      - description: Project Identifier for the Entity.
        in: query
        name: projectIdentifier
        required: false
        schema:
          type: string
      - in: path
        name: rule_identifier
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenapiRule'
          description: OK
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Internal Server Error
      summary: Get acc/org/proj protection rule
      tags:
      - Rules
    patch:
      operationId: spaceRuleUpdate
      parameters:
      - description: Account Identifier for the Entity.
        in: query
        name: accountIdentifier
        required: true
        schema:
          type: string
      - description: Organization Identifier for the Entity.
        in: query
        name: orgIdentifier
        required: false
        schema:
          type: string
      - description: Project Identifier for the Entity.
        in: query
        name: projectIdentifier
        required: false
        schema:
          type: string
      - in: path
        name: rule_identifier
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              properties:
                definition:
                  $ref: '#/components/schemas/OpenapiRuleDefinition'
                description:
                  type:
                  - string
                  - 'null'
                identifier:
                  type:
                  - string
                  - 'null'
                pattern:
                  $ref: '#/components/schemas/ProtectionPattern'
                repo_target:
                  $ref: '#/components/schemas/ProtectionRepoTarget'
                state:
                  $ref: '#/components/schemas/EnumRuleState'
                type:
                  $ref: '#/components/schemas/OpenapiRuleType'
                uid:
                  deprecated: true
                  type:
                  - string
                  - 'null'
              type: object
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenapiRule'
          description: OK
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsererrorError'
          description: Internal Server Error
      summary: Update acc/org/proj protection rule
      tags:
      - Rules
components:
  schemas:
    EnumMergeMethod:
      enum:
      - fast-forward
      - merge
      - rebase
      - squash
      type: string
    ProtectionTag:
      properties:
        bypass:
          $ref: '#/components/schemas/ProtectionDefBypass'
        lifecycle:
          $ref: '#/components/schemas/ProtectionDefTagLifecycle'
      type: object
    ProtectionDefComments:
      properties:
        require_resolve_all:
          type: boolean
      type: object
    EnumPrincipalType:
      enum:
      - service
      - serviceaccount
      - user
      type: string
    ProtectionPush:
      properties:
        bypass:
          $ref: '#/components/schemas/ProtectionDefBypass'
        push:
          $ref: '#/components/schemas/ProtectionDefPush'
      type: object
    ProtectionDefMergeQueue:
      properties:
        checks_concurrency:
          type: integer
        group_size:
          type: integer
        max_check_duration_seconds:
          type: integer
        status_checks:
          $ref: '#/components/schemas/ProtectionDefStatusChecks'
      type: object
    TypesUserGroupInfo:
      properties:
        description:
          type: string
        id:
          type: integer
        identifier:
          type: string
        name:
          type: string
        scope:
          type: integer
      type: object
    ProtectionDefApprovals:
      properties:
        require_code_owners:
          type: boolean
        require_latest_commit:
          type: boolean
        require_minimum_count:
          type: integer
        require_minimum_default_reviewer_count:
          type: integer
        require_no_change_request:
          type: boolean
      type: object
    ProtectionBranch:
      properties:
        bypass:
          $ref: '#/components/schemas/ProtectionDefBypass'
        lifecycle:
          $ref: '#/components/schemas/ProtectionDefBranchLifecycle'
        pullreq:
          $ref: '#/components/schemas/ProtectionDefPullReq'
      type: object
    OpenapiRule:
      properties:
        created:
          type: integer
        created_by:
          $ref: '#/components/schemas/TypesPrincipalInfo'
        definition:
          $ref: '#/components/schemas/OpenapiRuleDefinition'
        description:
          type: string
        identifier:
          type: string
        pattern:
          $ref: '#/components/schemas/ProtectionPattern'
        repo_target:
          $ref: '#/components/schemas/ProtectionRepoTarget'
        repositories:
          additionalProperties:
            $ref: '#/components/schemas/TypesRepositoryCore'
          type:
          - object
          - 'null'
        scope:
          type: integer
        state:
          $ref: '#/components/schemas/EnumRuleState'
        type:
          $ref: '#/components/schemas/OpenapiRuleType'
        updated:
          type: integer
        user_groups:
          additionalProperties:
            $ref: '#/components/schemas/TypesUserGroupInfo'
          type:
          - object
          - 'null'
        users:
          additionalProperties:
            $ref: '#/components/schemas/TypesPrincipalInfo'
          type:
          - object
          - 'null'
      type: object
    EnumRuleState:
      enum:
      - active
      - disabled
      - monitor
      type:
      - string
      - 'null'
    ProtectionDefPullReq:
      properties:
        approvals:
          $ref: '#/components/schemas/ProtectionDefApprovals'
        comments:
          $ref: '#/components/schemas/ProtectionDefComments'
        commits:
          $ref: '#/components/schemas/ProtectionDefCommits'
        merge:
          $ref: '#/components/schemas/ProtectionDefMerge'
        merge_queue:
          $ref: '#/components/schemas/ProtectionDefMergeQueue'
        reviewers:
          $ref: '#/components/schemas/ProtectionDefReviewers'
        status_checks:
          $ref: '#/components/schemas/ProtectionDefStatusChecks'
      type: object
    ProtectionPattern:
      properties:
        default:
          type: boolean
        exclude:
          items:
            type: string
          type: array
        include:
          items:
            type: string
          type: array
      type:
      - object
      - 'null'
    ProtectionDefReviewers:
      properties:
        default_reviewer_ids:
          items:
            type: integer
          type: array
        default_user_group_reviewer_ids:
          items:
            type: integer
          type: array
        request_code_owners:
          type: boolean
      type: object
    ProtectionDefMerge:
      properties:
        block:
          type: boolean
        delete_branch:
          type: boolean
        require_bypass_message:
          type: boolean
        strategies_allowed:
          items:
            $ref: '#/components/schemas/EnumMergeMethod'
          type: array
      type: object
    ProtectionDefBranchLifecycle:
      properties:
        create_forbidden:
          type: boolean
        delete_forbidden:
          type: boolean
        update_forbidden:
          type: boolean
        update_force_forbidden:
          type: boolean
      type: object
    ProtectionRepoTargetFilter:
      properties:
        ids:
          items:
            type: integer
          type: array
        patterns:
          items:
            type: string
          type: array
      type: object
    ProtectionDefStatusChecks:
      properties:
        require_identifiers:
          items:
            type: string
          type: array
      type: object
    ProtectionDefBypass:
      properties:
        repo_owners:
          type: boolean
        user_group_ids:
          items:
            type: integer
          type: array
        user_ids:
          items:
            type: integer
          type: array
      type: object
    ProtectionRepoTarget:
      properties:
        exclude:
          $ref: '#/components/schemas/ProtectionRepoTargetFilter'
        include:
          $ref: '#/components/schemas/ProtectionRepoTargetFilter'
      type:
      - object
      - 'null'
    TypesRepositoryCore:
      properties:
        default_branch:
          type: string
        fork_id:
          type: integer
        id:
          type: integer
        identifier:
          type: string
        parent_id:
          type: integer
        path:
          type: string
        type:
          $ref: '#/components/schemas/EnumRepoType'
      type: object
    UsererrorError:
      properties:
        message:
          type: string
        values:
          additionalProperties: {}
          type: object
      type: object
    OpenapiRuleDefinition:
      oneOf:
      - $ref: '#/components/schemas/ProtectionBranch'
      - $ref: '#/components/schemas/ProtectionTag'
      - $ref: '#/components/schemas/ProtectionPush'
      type: object
    ProtectionDefPush:
      properties:
        file_size_limit:
          type: integer
        principal_committer_match:
          type: boolean
        secret_scanning_enabled:
          type: boolean
      type: object
    TypesPrincipalInfo:
      properties:
        created:
          type: integer
        display_name:
          type: string
        email:
          type: string
        id:
          type: integer
        type:
          $ref: '#/components/schemas/EnumPrincipalType'
        uid:
          type: string
        updated:
          type: integer
      type:
      - object
      - 'null'
    ProtectionDefCommits:
      properties:
        require_target_is_ancestor:
          type: boolean
      type: object
    OpenapiRuleType:
      enum:
      - branch
      - tag
      - push
      type: string
    EnumRepoType:
      type: string
    ProtectionDefTagLifecycle:
      properties:
        create_forbidden:
          type: boolean
        delete_forbidden:
          type: boolean
        update_force_forbidden:
          type: boolean
      type: object
  securitySchemes:
    x-api-key:
      name: x-api-key
      type: apiKey
      in: header
      description: API key is a token provided while making the API calls. This is used to authenticate the client at the exposed endpoint.
externalDocs:
  description: Find out more about Swagger
  url: http://swagger.io
x-stoplight:
  id: oc91t4vrfnjyi
x-tagGroups:
- name: Organizations
  tags:
  - Organization
- name: Projects
  tags:
  - Org Project
  - Project
- name: Secrets
  tags:
  - Account Secret
  - Org Secret
  - Project Secret
  - Secrets
- name: Connectors
  tags:
  - Account Connector


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