openapi: 3.2.0 info: title: Harness Targets 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: - description: APIs to create and manage Feature Flag Targets name: Targets paths: /cf/admin/targets: get: description: Returns all the Targets for the given Account ID operationId: GetAllTargets parameters: - $ref: '#/components/parameters/accountQueryParam' - $ref: '#/components/parameters/orgQueryParam' - $ref: '#/components/parameters/projectQueryParam' - $ref: '#/components/parameters/environmentQueryParam' - $ref: '#/components/parameters/pageNumber' - $ref: '#/components/parameters/pageSize' - $ref: '#/components/parameters/targetSortOrder' - $ref: '#/components/parameters/targetSortByField' - $ref: '#/components/parameters/targetNameQueryParam' - $ref: '#/components/parameters/targetIdentifierQueryParam' responses: '200': $ref: '#/components/responses/TargetsResponse' '401': $ref: '#/components/responses/Unauthenticated' '403': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/InternalServerError' summary: Returns all Targets tags: - Targets post: description: Create Targets for the given identifier operationId: CreateTarget parameters: - $ref: '#/components/parameters/accountQueryParam' - $ref: '#/components/parameters/orgQueryParam' requestBody: $ref: '#/components/requestBodies/TargetRequest' responses: '201': description: Created '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthenticated' '403': $ref: '#/components/responses/Unauthorized' '409': $ref: '#/components/responses/Conflict' '500': $ref: '#/components/responses/InternalServerError' summary: Creates a Target tags: - Targets /cf/admin/targets/upload: post: description: Add targets by uploading a CSV file operationId: UploadTargets parameters: - $ref: '#/components/parameters/accountQueryParam' - $ref: '#/components/parameters/orgQueryParam' - $ref: '#/components/parameters/projectQueryParam' - $ref: '#/components/parameters/environmentQueryParam' requestBody: content: multipart/form-data: schema: properties: fileName: format: binary type: string type: object responses: '200': description: Created '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthenticated' '403': $ref: '#/components/responses/Unauthorized' '409': $ref: '#/components/responses/Conflict' '500': $ref: '#/components/responses/InternalServerError' summary: Add Target details tags: - Targets /cf/admin/targets/{identifier}: delete: description: Deletes a Target for the given identifier operationId: DeleteTarget parameters: - $ref: '#/components/parameters/identifier' - $ref: '#/components/parameters/accountQueryParam' - $ref: '#/components/parameters/orgQueryParam' - $ref: '#/components/parameters/projectQueryParam' - $ref: '#/components/parameters/environmentQueryParam' responses: '204': description: No content '401': $ref: '#/components/responses/Unauthenticated' '403': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/InternalServerError' summary: Deletes a Target tags: - Targets get: description: Returns details of a Target for the given identifier operationId: GetTarget parameters: - $ref: '#/components/parameters/identifier' - $ref: '#/components/parameters/accountQueryParam' - $ref: '#/components/parameters/orgQueryParam' - $ref: '#/components/parameters/projectQueryParam' - $ref: '#/components/parameters/environmentQueryParam' responses: '200': $ref: '#/components/responses/TargetResponse' '401': $ref: '#/components/responses/Unauthenticated' '403': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/InternalServerError' summary: Returns details of a Target tags: - Targets patch: description: Updates a Target for the given identifier operationId: PatchTarget parameters: - $ref: '#/components/parameters/accountQueryParam' - $ref: '#/components/parameters/orgQueryParam' - $ref: '#/components/parameters/projectQueryParam' - $ref: '#/components/parameters/environmentQueryParam' - $ref: '#/components/parameters/identifier' requestBody: $ref: '#/components/requestBodies/TargetPatchRequest' responses: '200': $ref: '#/components/responses/TargetResponse' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthenticated' '403': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' '409': $ref: '#/components/responses/Conflict' '500': $ref: '#/components/responses/InternalServerError' summary: Updates a Target tags: - Targets put: description: Modifies a Target for the given account identifier operationId: ModifyTarget parameters: - $ref: '#/components/parameters/identifier' - $ref: '#/components/parameters/accountQueryParam' - $ref: '#/components/parameters/orgQueryParam' - $ref: '#/components/parameters/projectQueryParam' - $ref: '#/components/parameters/environmentQueryParam' requestBody: $ref: '#/components/requestBodies/TargetRequest' responses: '200': $ref: '#/components/responses/TargetResponse' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthenticated' '403': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' '409': $ref: '#/components/responses/Conflict' '500': $ref: '#/components/responses/InternalServerError' summary: Modifies a Target tags: - Targets /cf/admin/targets/{identifier}/segments: get: description: Returns the Target Groups that the specified Target belongs to. operationId: GetTargetSegments parameters: - $ref: '#/components/parameters/identifier' - $ref: '#/components/parameters/accountQueryParam' - $ref: '#/components/parameters/orgQueryParam' - $ref: '#/components/parameters/projectQueryParam' - $ref: '#/components/parameters/environmentQueryParam' responses: '200': $ref: '#/components/responses/TargetDetailResponse' '401': $ref: '#/components/responses/Unauthenticated' '403': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/InternalServerError' summary: Returns Target Groups for the given Target tags: - Targets components: responses: Conflict: content: application/json: schema: $ref: '#/components/schemas/CfError' description: The specified resource already exists TargetsResponse: content: application/json: schema: $ref: '#/components/schemas/Targets' description: OK BadRequest: content: application/json: schema: $ref: '#/components/schemas/CfError' description: Bad request Unauthenticated: content: application/json: schema: $ref: '#/components/schemas/CfError' description: Unauthenticated TargetResponse: content: application/json: schema: $ref: '#/components/schemas/Target' description: OK Unauthorized: content: application/json: schema: $ref: '#/components/schemas/CfError' description: Unauthorized InternalServerError: content: application/json: schema: $ref: '#/components/schemas/CfError' description: Internal server error TargetDetailResponse: content: application/json: schema: $ref: '#/components/schemas/TargetDetail' description: OK NotFound: content: application/json: schema: $ref: '#/components/schemas/CfError' description: The specified resource was not found schemas: GitSyncPatchOperation: properties: comment: description: A comment explaining the reason for this patch operation example: This is a comment string type: string executionTime: description: Time of execution in unix epoch milliseconds when the scheduled changes will be applied type: integer gitDetails: $ref: '#/components/schemas/CfGitDetails' instructions: $ref: '#/components/schemas/PatchInstruction' required: - instructions type: object TargetDetailSegment: properties: identifier: description: The unique identifier type: string name: description: The name type: string type: object TargetDetail: description: Details of which Target Groups (Segments) a target is included in or excluded from properties: excludedSegments: description: A list of target groups (segments) that the target is excluded from. items: $ref: '#/components/schemas/TargetDetailSegment' type: array identifier: description: The unique identifier for the target type: string includedSegments: description: A list of target groups (segments) that the target is included in. items: $ref: '#/components/schemas/TargetDetailSegment' type: array ruleSegments: description: A list of target groups (segments) that the target is included in via group rules. items: $ref: '#/components/schemas/TargetDetailSegment' type: array required: - identifier - environment - project - account - org type: object Pagination: properties: itemCount: description: The total number of items example: 1 type: integer pageCount: description: The total number of pages example: 100 type: integer pageIndex: description: The current page example: 0 type: integer pageSize: description: The number of items per page example: 1 type: integer version: description: The version of this object. The version will be incremented each time the object is modified example: 5 type: integer required: - pageCount - itemCount - pageSize - pageIndex type: object PatchInstruction: description: A list of Patch Instructions items: properties: kind: description: The name of the modification you would like to perform on a resource. example: enableFeatureFlag type: string parameters: example: ruleId: TestRule variationID: TestVariation type: object required: - kind - parameters type: array Targets: allOf: - $ref: '#/components/schemas/Pagination' - properties: targets: items: $ref: '#/components/schemas/Target' type: array description: A list of Targets type: object CfError: properties: code: description: The http error code example: 404 type: string details: description: Additional details about the error type: object message: description: The reason the request failed example: Error retrieving projects, organization 'default_org' does not exist type: string required: - code - message type: object Tag: description: A Tag object used to tag feature flags - consists of name and identifier properties: identifier: description: The identifier of the tag example: feature-flag-tag-1 type: string name: description: The name of the tag example: feature-flag-tag-1 type: string required: - name - identifier type: object CfGitDetails: description: The commit message to use as part of a gitsync operation properties: commitMsg: description: A description of the change or action example: Turning on flag test-flag for production type: string required: - commitMsg type: object Segment: description: A Target Group (Segment) response properties: createdAt: description: The data and time in milliseconds when the group was created format: int64 type: integer environment: description: The environment this target group belongs to example: Production type: string excluded: description: A list of Targets who are excluded from this target group items: $ref: '#/components/schemas/Target' type: array identifier: description: Unique identifier for the target group. type: string included: description: A list of Targets who belong to this target group items: $ref: '#/components/schemas/Target' type: array modifiedAt: description: The data and time in milliseconds when the group was last modified format: int64 type: integer name: description: Name of the target group. example: Beta Testers type: string rules: items: $ref: '#/components/schemas/Clause' type: array servingRules: description: An array of rules that can cause a user to be included in this segment. items: $ref: '#/components/schemas/GroupServingRule' type: array tags: description: Tags for this target group items: $ref: '#/components/schemas/Tag' type: array version: description: The version of this group. Each time it is modified the version is incremented example: 1 format: int64 type: integer required: - identifier - name type: object GroupServingRule: description: The rule used to determine what variation to serve to a target properties: clauses: description: A list of clauses to use in the rule items: $ref: '#/components/schemas/Clause' type: array priority: description: The rules priority relative to other rules. The rules are evaluated in order with 1 being the highest example: 1 type: integer ruleId: description: The unique identifier for this rule type: string required: - ruleId - clauses - priority type: object Target: description: A Target object properties: account: description: The account ID that the target belongs to example: abcXDdffdaffd type: string anonymous: description: Indicates if this target is anonymous type: boolean attributes: description: a JSON representation of the attributes for this target example: age: 20 location: Belfast type: object createdAt: description: The date and time in milliseconds when this Target was created format: int64 type: integer environment: description: The identifier for the environment that the target belongs to type: string identifier: description: The unique identifier for this target example: john-doe type: string name: description: The name of this Target example: John Doe type: string org: description: The identifier for the organization that the target belongs to type: string project: description: The identifier for the project that this target belongs to type: string segments: description: A list of Target Groups (Segments) that this Target belongs to items: $ref: '#/components/schemas/Segment' type: array required: - identifier - name - environment - project - account - org type: object Clause: description: A clause describes what conditions are used to evaluate a flag properties: attribute: description: The attribute to use in the clause. This can be any target attribute example: identifier type: string id: description: The unique ID for the clause example: 32434243 type: string negate: description: Is the operation negated? example: false type: boolean op: description: The type of operation such as equals, starts_with, contains example: starts_with type: string values: description: The values that are compared against the operator items: type: string type: array required: - attribute - op - negate - values type: object parameters: targetSortOrder: allowEmptyValue: true description: SortOrder in: query name: sortOrder schema: enum: - ASC - DESC type: string accountQueryParam: description: Account Identifier examples: default: value: default in: query name: accountIdentifier required: true schema: type: string pageSize: description: PageSize in: query name: pageSize schema: type: integer environmentQueryParam: allowEmptyValue: true description: Environment Identifier in: query name: environmentIdentifier required: true schema: type: string targetIdentifierQueryParam: allowEmptyValue: true description: Identifier of the target in: query name: targetIdentifier schema: type: string orgQueryParam: description: Organization Identifier examples: default: value: default_org in: query name: orgIdentifier required: true schema: type: string projectQueryParam: description: The Project identifier in: query name: projectIdentifier required: true schema: type: string targetSortByField: allowEmptyValue: true description: SortByField in: query name: sortByField schema: enum: - createdAt - name - identifier type: string pageNumber: description: PageNumber in: query name: pageNumber schema: type: integer identifier: description: Unique identifier for the object in the API. in: path name: identifier required: true schema: type: string targetNameQueryParam: allowEmptyValue: true description: Name of the target in: query name: targetName schema: type: string requestBodies: TargetPatchRequest: content: application/json: example: gitDetails: commitMsg: Making some changes instructions: - kind: addToIncludeList parameters: segments: - alpha-testers - beta-testers - kind: removeFromIncludeList parameters: segments: - alpha-testers - beta-testers - kind: addToExcludeList parameters: segments: - alpha-testers - beta-testers - kind: removeFromExcludeList parameters: segments: - alpha-testers - beta-testers - kind: addTargetToFlagsVariationTargetMap parameters: features: - identifier: flag1 variation: 'true' - identifier: flag2 variation: 'false' - kind: removeTargetFromFlagsVariationTargetMap parameters: features: - identifier: flag1 variation: 'true' - identifier: flag2 variation: 'false' schema: $ref: '#/components/schemas/GitSyncPatchOperation' TargetRequest: content: application/json: schema: $ref: '#/components/schemas/Target' required: true 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