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: 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' ProtectionDefPush: properties: file_size_limit: type: integer principal_committer_match: type: boolean secret_scanning_enabled: type: boolean type: object ProtectionBranch: properties: bypass: $ref: '#/components/schemas/ProtectionDefBypass' lifecycle: $ref: '#/components/schemas/ProtectionDefBranchLifecycle' pullreq: $ref: '#/components/schemas/ProtectionDefPullReq' type: object 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 ProtectionPattern: properties: default: type: boolean exclude: items: type: string type: array include: items: type: string type: array type: - object - 'null' OpenapiRuleDefinition: oneOf: - $ref: '#/components/schemas/ProtectionBranch' - $ref: '#/components/schemas/ProtectionTag' - $ref: '#/components/schemas/ProtectionPush' type: object ProtectionDefTagLifecycle: properties: create_forbidden: type: boolean delete_forbidden: type: boolean update_force_forbidden: type: boolean type: object ProtectionDefCommits: properties: require_target_is_ancestor: type: boolean type: object OpenapiRuleType: enum: - branch - tag - push type: string ProtectionDefStatusChecks: properties: require_identifiers: items: type: string type: array type: object ProtectionRepoTarget: properties: exclude: $ref: '#/components/schemas/ProtectionRepoTargetFilter' include: $ref: '#/components/schemas/ProtectionRepoTargetFilter' type: - object - 'null' 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 ProtectionDefBypass: properties: repo_owners: type: boolean user_group_ids: items: type: integer type: array user_ids: items: type: integer 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 ProtectionTag: properties: bypass: $ref: '#/components/schemas/ProtectionDefBypass' lifecycle: $ref: '#/components/schemas/ProtectionDefTagLifecycle' type: object 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 EnumRuleState: enum: - active - disabled - monitor type: - string - 'null' EnumMergeMethod: enum: - fast-forward - merge - rebase - squash type: string 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 ProtectionDefMergeQueue: properties: checks_concurrency: type: integer group_size: type: integer max_check_duration_seconds: type: integer status_checks: $ref: '#/components/schemas/ProtectionDefStatusChecks' type: object UsererrorError: properties: message: type: string values: additionalProperties: {} type: object type: object ProtectionPush: properties: bypass: $ref: '#/components/schemas/ProtectionDefBypass' push: $ref: '#/components/schemas/ProtectionDefPush' type: object ProtectionRepoTargetFilter: properties: ids: items: type: integer type: array patterns: items: type: string type: array 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 EnumPrincipalType: enum: - service - serviceaccount - user type: string TypesUserGroupInfo: properties: description: type: string id: type: integer identifier: type: string name: type: string scope: type: integer type: object ProtectionDefComments: properties: require_resolve_all: type: boolean type: object EnumRepoType: type: string 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 - Org Connector - Project Connector - Connectors - GoogleSecretManagerConnector - name: Roles tags: - Account Roles - Organization Roles - Project Roles - Roles - name: Resource Groups tags: - Account Resource Groups - Organization Resource Groups - Project Resource Groups - Filter Resource Groups - Harness Resource Group - Zendesk - name: Role Assignments tags: - Account Role Assignments - Org Role Assignments - Project Role Assignments - Role Assignments - name: Platform tags: - Access Control List - Account Banner - Account Banner - Account Licensed Modules - Account License Type - Account Webhooks - AccountSetting - Accounts - Analyze Account Access Policy - Analyze Organization Access Policy - Analyze Project Access Policy - ApiKey - Audit - AuditFilters - Authentication Settings - Canny - Devops Essentials License Data By Account - EULA - Filter - Harness Resource Type - Invite - IP Allowlist - Nextgen Ldap - Notification Channels - Notification Rules - OIDC - Oidc-Access-Token - Oidc-ID-Token - Org Webhooks - Permissions - Project Webhooks - Secret Managers - Service Account - Setting - SMTP - Source Code Manager - Token - User - User Group - Variables - name: Delegate tags: - Agent mTLS Endpoint Management - Delegate Download Resource - Delegate Group Tags Resource - Delegate Setup Resource - Delegate Token Resource - name: Pipelines tags: - Pipelines - Input Sets - Approvals - Pipeline Execution - Pipeline Dashboard - Pipeline Input Set - Pipeline - Pipeline Execution Details - Pipeline Execute - Pipeline Refresh - Pipeline data retention - Triggers - TriggersEvents - Webhook Triggers - Webhook Event Handler - DryRunPipeline - name: Artifact Registry tags: - Registries - Artifacts - Docker Artifacts - Helm Artifacts - quarantine - Webhooks - Spaces - Replication - Registry V3 - Registries - Registry V3 - Packages - Registry V3 - Versions - Registry V3 - Files - Registry V3 - Metadata - Registry V3 - Firewall - Registry V3 - Transfer - name: Database DevOps tags: - Database Schema - Database Instance - Deployed State - Execution Config - Migration State - name: CD tags: - K8s Release Service Mapping - CustomDeployment - Environments - EnvironmentGroup - Infrastructures - Usage - File Store - Service Dashboard - ServiceOverrides - Rollback - tas - name: Deployment Freeze tags: - Freeze CRUD - Freeze Evaluation - Freeze Schema - name: Services tags: - Account Services - Org Services - Project Services - Services - name: Rancher Infrastructures tags: - Account Rancher Infrastructure - Org Rancher Infrastructure - Project Rancher Infrastructure - name: Templates tags: - Account Template - Org Template - Project Template - Templates - Global Templates - name: GitOps tags: - Agents - Application - Applications - Certificates - Clusters - Dashboard Aggregates - Dashboards - GnuPGP Keys - GPG Keys - Hosts - Project mappings - Projects - Reconciler - Repositories - Repository Certificates - Repository credentials - ValidateHost - name: GitX tags: - GitX Webhooks - Org Gitx Webhooks - Project Gitx Webhooks - name: CACM tags: - Anomalies Ignorelist Rule - Anomalies - BI Dashboards - Budgets - Budget Groups - Cost Categories - Cloud Accounts - K8S Connectors Metadata - Notification Settings v2 - Overview - Data Job Status - Recommendation cost settings - Unit Metric - Anomaly Comments - Cloud and AI cost anomaly details - Cloud and AI cost anomalies v2 - Cost Details - Currency Preferences - External Data Provider - AiEngine - CACM governance cost settings - Governance Enforcement Recommendation APIs - Governance Alert - Governance Overview - Governance Recommendation APIs - RuleEnforcement - Rule Executions - Rule - Rule Sets - Perspectives Folders - Perspective Reports - Perspectives - Cost Category Jira Project Mapping - Recommendations Details - Recommendations - Recommendation Jira - Recommendation Preferences - Recommendation Presets - Recommendation Servicenow - Recommendation Tags - Recommendation Ignore List - AutoStopping Rules - AutoStopping Rules V2 - AutoStopping Load Balancers - AutoStopping Fixed Schedules - AutoStopping Alerts - Commitment Orchestrator Events APIs - name: Feature Flags tags: - API Keys - Feature Flags - Targets - Target Groups - Environment Perspectives - Anomalies - Proxy - Tags - name: SRM tags: - Monitored Services - SLOs dashboard - NG SLOs - SLOs - Downtime - Srm Notification - name: Internal Developer Portal - IDP tags: - Entities - Teams - CatalogCustomProperties - Scores - DataSource - KubernetesDataPoints - AggregationRules - AppConfig - PluginInfo - LayoutProxy - Kinds - LayoutsV3 - LayoutsV4 - name: Environment Management - IDP tags: - Environment - Infrastructure - Instance - name: Custom Dashboards tags: - aida - dashboards - downloads - embed - folders - name: Policy Management tags: - dashboard - examples - policies - evaluate - evaluations - policysets - system - name: Code tags: - repository - status_checks - pullreq - upload - webhook - resource - rules - labels - name: IaCM tags: - usage - approvals - costs - executions - module-registry - workspaces - settings - tf-standard-backend - variables - name: STO tags: - Exemptions - Issues - Scans - Products - Test Targets - Target Variants - name: SEI tags: - Collection categories - Collections - Contributors - DORA - name: Git Sync (deprecated) tags: - Git Branches - Git Full Sync - Git Sync Settings - Git Sync - Git Sync Errors - name: Error Models tags: - Error Response - Governance Metadata - name: Supply Chain Security tags: - integration - PipelineInfraConfig - SBOM - Integration Step Config - Delete Step Config - Delete Repositories - Pipeline Store Config - Evidence Vault [Beta] - name: Release Management tags: - Release Groups - Releases - Orchestration Processes - Orchestration Activities - Orchestration Executions - Conflicts - Freeze - Reports - Uploads - name: Resilience Testing tags: - Actions - Action Templates - Chaos Components - Chaos Hubs - ChaosGuard Conditions - ChaosGuard Rules - DR Tests - Experiments - Experiment Templates - Faults - Fault Templates - Chaos Infrastructure - Health - Network Maps - Onboarding - Probes - Probe Templates - Chaos Recommendations - Risks