For the complete documentation index, see llms.txt. This page is also available as Markdown.

Templates

This contains a list of APIs specific to the Templates Validations and Refresh

Get the status of a bulk reconciliation run

get

Returns the current status of a bulk reconciliation run, along with the reconciliation status of every referenced entity, identified by its bulk reconciliation UUID.

Path parameters
uuidstringRequired

Bulk reconciliation uuid for the Entity.

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
get/refresh-template/bulk-reconcile/{uuid}
GET /gateway/template/api/refresh-template/bulk-reconcile/{uuid}?accountIdentifier=text HTTP/1.1
Host: template-service-65c77697b7-ll9lx
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Get YAML with updated Template Inputs

post

Returns YAML with updated Template Inputs for a given YAML

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

branchstringOptional

Name of the branch.

repoIdentifierstringOptional

Git Sync Config Id. [Applicable for Old Git Sync only]

getDefaultFromOtherRepobooleanOptional

if true, return all the default entities

harnessYamlVersionstringOptional

Harness YAML Version

Default: 0
Header parameters
Load-From-CachestringOptionalDefault: false
Body
yamlstringRequired
Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
post/refresh-template/refreshed-yaml
POST /gateway/template/api/refresh-template/refreshed-yaml?accountIdentifier=text HTTP/1.1
Host: template-service-65c77697b7-ll9lx
Content-Type: application/json
Accept: */*
Content-Length: 15

{
  "yaml": "text"
}
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Start a bulk reconciliation for all entities referring a Template

post

Starts a bulk reconciliation run that refreshes the Template Inputs in every Pipeline and Template referring the given Template version. The list of referenced entities to reconcile is obtained from the listBulkReconciliationTemplateEntityUsage API.

Path parameters
templateIdentifierstringRequired

Template Identifier for the entity

versionLabelstringRequired

Version Label

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringRequired

Organization Identifier for the Entity.

projectIdentifierstringRequired

Project Identifier for the Entity.

isStableTemplatebooleanOptional

Is Stable Template

branchstringOptional

Name of the branch.

repoIdentifierstringOptional

Git Sync Config Id. [Applicable for Old Git Sync only]

getDefaultFromOtherRepobooleanOptional

if true, return all the default entities

Bodyobject · BulkReconciliationReferencedEntityDetail[]
accountIdentifierstringOptional
orgIdentifierstringOptional
projectIdentifierstringOptional
parentUniqueIdstringOptional
statusstring · enumOptionalPossible values:
identifierstringOptional
versionLabelstringOptional
referenceEntityTypestring · enumOptionalPossible values:
storeTypestring · enumOptionalPossible values:
prLinkstringOptional
scopestring · enumOptionalPossible values:
startedAtinteger · int64Optional
lastUpdatedAtinteger · int64Optional
repoNamestringOptional
branchstringOptional
commitMessagestringOptional
bulkReconciliationUUIDstringOptional
Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
post/refresh-template/bulk-reconcile/{templateIdentifier}/version/{versionLabel}
POST /gateway/template/api/refresh-template/bulk-reconcile/{templateIdentifier}/version/{versionLabel}?accountIdentifier=text&orgIdentifier=text&projectIdentifier=text HTTP/1.1
Host: template-service-65c77697b7-ll9lx
Content-Type: application/json
Accept: */*
Content-Length: 501

[
  {
    "accountIdentifier": "text",
    "orgIdentifier": "text",
    "projectIdentifier": "text",
    "parentUniqueId": "text",
    "status": "INITIATED",
    "identifier": "text",
    "versionLabel": "text",
    "referenceEntityType": "PIPELINE",
    "errorMessage": {
      "message": "text",
      "hint": "text",
      "explanation": "text"
    },
    "bulkReconciledBy": {
      "username": "text",
      "emailId": "text"
    },
    "storeType": "INLINE",
    "prLink": "text",
    "scope": "account",
    "startedAt": 1,
    "lastUpdatedAt": 1,
    "repoName": "text",
    "branch": "text",
    "commitMessage": "text",
    "bulkReconciliationUUID": "text"
  }
]
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Validate Template Inputs in a YAML

get

Validates the Template Inputs in a pipeline's YAML specification. If the Template Inputs are invalid, the operation returns an error summary.

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

templateIdentifierstringRequired

Template Identifier for the entity

versionLabelstringRequired

Template version

branchstringOptional

Name of the branch.

repoIdentifierstringOptional

Git Sync Config Id. [Applicable for Old Git Sync only]

getDefaultFromOtherRepobooleanOptional

if true, return all the default entities

Header parameters
Load-From-CachestringOptionalDefault: false
Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
get/refresh-template/validate-template-inputs
GET /gateway/template/api/refresh-template/validate-template-inputs?accountIdentifier=text&templateIdentifier=text&versionLabel=text HTTP/1.1
Host: template-service-65c77697b7-ll9lx
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Gets complete yaml with templateRefs resolved

post
Query parameters
accountIdentifierstringRequired
orgIdentifierstringOptional
projectIdentifierstringOptional
branchstringOptional

Name of the branch.

repoIdentifierstringOptional

Git Sync Config Id. [Applicable for Old Git Sync only]

getDefaultFromOtherRepobooleanOptional

if true, return all the default entities

AppendInputSetValidatorbooleanOptionalDefault: false
Header parameters
Load-From-CachestringOptionalDefault: false
Body
originalEntityYamlstringRequired
checkForAccessbooleanOptional
getMergedYamlWithTemplateFieldbooleanOptional
getOnlyFileContentbooleanOptional
yamlVersionstringOptional
enforceOpaOnExecutionbooleanOptional
skipGlobalTemplateResolutionbooleanOptional
Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
post/templates/v2/applyTemplates
POST /gateway/template/api/templates/v2/applyTemplates?accountIdentifier=text HTTP/1.1
Host: template-service-65c77697b7-ll9lx
Content-Type: application/json
Accept: */*
Content-Length: 201

{
  "originalEntityYaml": "text",
  "checkForAccess": true,
  "getMergedYamlWithTemplateField": true,
  "getOnlyFileContent": true,
  "yamlVersion": "text",
  "enforceOpaOnExecution": true,
  "skipGlobalTemplateResolution": true
}
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Create a Template

post
Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

labelstring[]Optional

Optional labels for this version (repeat). Requires template labels FF.

branchstringOptional

Name of the branch.

repoIdentifierstringOptional

Git Sync Config Id. [Applicable for Old Git Sync only]

rootFolderstringOptional

Path to the root folder of the Entity. [Applicable for Old Git Sync only]

filePathstringOptional

File Path of the Entity.

commitMsgstringOptional

File Path of the Entity.

isNewBranchbooleanOptional

Checks the new branch

Default: false
baseBranchstringOptional

Name of the default branch.

connectorRefstringOptional

Identifier of Connector needed for CRUD operations on the respective Entity

storeTypestring · enumOptional

Tells whether the Entity is to be saved on Git or not

Possible values:
repoNamestringOptional

Name of the repository.

isHarnessCodeRepobooleanOptional

Is Harness code repo enabled

setDefaultTemplatebooleanOptional

Specify true if Default Template is to be set

Default: false
commentsstringOptional

Comments

isNewTemplatebooleanOptional

When isNewTemplate flag is set user will not be able to create a new version for an existing template

Default: false
enableDAGbooleanOptional

Set to true for Pipeline templates with DAG (Directed Acyclic Graph) execution

Default: false
Body
stringOptional
Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
post/templates
POST /gateway/template/api/templates?accountIdentifier=text HTTP/1.1
Host: template-service-65c77697b7-ll9lx
Content-Type: application/json
Accept: */*
Content-Length: 1478

"template:\n  name: pipelineTemplate\n  identifier: pipelineTemplate\n  versionLabel: v1\n  type: Pipeline\n  projectIdentifier: TemplateDemo\n  orgIdentifier: default\n  tags: {}\n  spec:\n    stages:\n      - stage:\n          name: stage1\n          identifier: stage1\n          description: \"\"\n          type: Deployment\n          spec:\n            deploymentType: Kubernetes\n            service:\n              serviceRef: <+input>\n              serviceInputs: <+input>\n            environment:\n              environmentRef: <+input>\n              deployToAll: false\n              environmentInputs: <+input>\n              infrastructureDefinitions: <+input>\n            execution:\n              steps:\n                - step:\n                    type: ShellScript\n                    name: Shell Script_1\n                    identifier: ShellScript_1\n                    spec:\n                      shell: Bash\n                      onDelegate: true\n                      source:\n                        type: Inline\n                        spec:\n                          script: <+input>\n                      environmentVariables: []\n                      outputVariables: []\n                    timeout: 10m\n              rollbackSteps: []\n          tags: {}\n          failureStrategies:\n            - onFailure:\n                errors:\n                  - AllErrors\n                action:\n                  type: StageRollback\n"
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Delete Template Version

delete
Path parameters
templateIdentifierstringRequired

Template Identifier for the entity

versionLabelstringRequired

Version Label

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

branchstringOptional

Name of the branch.

repoIdentifierstringOptional

Git Sync Config Id. [Applicable for Old Git Sync only]

rootFolderstringOptional

Path to the root folder of the Entity. [Applicable for Old Git Sync only]

filePathstringOptional

File Path of the Entity.

commitMsgstringOptional

Commit Message to use for the merge commit.

lastObjectIdstringOptional

Last Object Id

commentsstringOptional
forceDeletebooleanOptional

If true, the Entity will be forced delete, without checking any references/usages

Default: false
Header parameters
If-MatchstringOptional
Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
delete/templates/{templateIdentifier}/{versionLabel}
DELETE /gateway/template/api/templates/{templateIdentifier}/{versionLabel}?accountIdentifier=text HTTP/1.1
Host: template-service-65c77697b7-ll9lx
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Get Template

get
Path parameters
templateIdentifierstringRequired

Template Identifier for the entity

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

labelstringOptional

Label

versionLabelstringOptional

Version Label

deletedbooleanOptional

Specifies whether Template is deleted or not

Default: false
branchstringOptional

Name of the branch.

repoIdentifierstringOptional

Git Sync Config Id. [Applicable for Old Git Sync only]

getDefaultFromOtherRepobooleanOptional

if true, return all the default entities

loadFromFallbackBranchbooleanOptionalDefault: false
Header parameters
Load-From-CachestringOptionalDefault: false
Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
get/templates/{templateIdentifier}
GET /gateway/template/api/templates/{templateIdentifier}?accountIdentifier=text HTTP/1.1
Host: template-service-65c77697b7-ll9lx
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Batch fetch multiple templates

post

Fetches multiple templates in a single HTTP request. Supports up to 100 templates per batch. Returns partial success if some templates succeed and others fail. Supports remote templates via Git Entity parameters.

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

branchstringOptional

Name of the branch.

repoIdentifierstringOptional

Git Sync Config Id. [Applicable for Old Git Sync only]

getDefaultFromOtherRepobooleanOptional

if true, return all the default entities

loadFromFallbackBranchbooleanOptionalDefault: false
Header parameters
Load-From-CachestringOptionalDefault: false
Body

Request to fetch multiple templates in a single batch operation

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
post/templates/batch
POST /gateway/template/api/templates/batch?accountIdentifier=text HTTP/1.1
Host: template-service-65c77697b7-ll9lx
Content-Type: application/json
Accept: */*
Content-Length: 164

{
  "templateRequests": [
    {
      "identifier": "myTemplate",
      "versionLabel": "v1",
      "label": "stable",
      "accountId": "text",
      "orgId": "text",
      "projectId": "text",
      "parentUniqueId": "text"
    }
  ]
}
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Gets Template Input Set YAML

get
Path parameters
templateIdentifierstringRequired

Template Identifier for the entity

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

labelstringOptional

Template Label

versionLabelstringOptional

Template Version Label

branchstringOptional

Name of the branch.

repoIdentifierstringOptional

Git Sync Config Id. [Applicable for Old Git Sync only]

getDefaultFromOtherRepobooleanOptional

if true, return all the default entities

Header parameters
Load-From-CachestringOptionalDefault: false
Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
get/templates/templateInputs/{templateIdentifier}
GET /gateway/template/api/templates/templateInputs/{templateIdentifier}?accountIdentifier=text HTTP/1.1
Host: template-service-65c77697b7-ll9lx
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Get custom labels per template version

get

Per-version labels; optional version filter.

Path parameters
templateIdentifierstringRequired

Template Identifier for the entity

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

versionLabelstring[]Optional

Optional. Repeat to limit which versions are included.

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
get/templates/{templateIdentifier}/labels
GET /gateway/template/api/templates/{templateIdentifier}/labels?accountIdentifier=text HTTP/1.1
Host: template-service-65c77697b7-ll9lx
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Get Entities referring this template, for use as bulk reconciliation input

post

Returns a paginated list of Pipelines and Templates referring the given Template version, along with their current reconciliation status. The result can be used to build the request payload for the bulkReconciliation API.

Path parameters
templateIdentifierstringRequired

Template Identifier for the entity

Query parameters
accountIdentifierstringRequired
orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

versionLabelstringOptional

Version Label

isStableTemplatebooleanOptional

Is Stable Template

searchTermstringOptional
storeTypestring · enumOptionalPossible values:
allVersionsstringOptionalDefault: false
branchstringOptional

Name of the branch.

repoNamestringOptional

Name of the repository.

pageIndexinteger · int32OptionalDefault: 0
pageSizeinteger · int32OptionalDefault: 100
sortstring[]Optional

Specifies sorting criteria of the list. Like sorting based on the last updated entity, alphabetical sorting in an ascending or descending order

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
post/templates/reconciliation-entity/{templateIdentifier}
POST /gateway/template/api/templates/reconciliation-entity/{templateIdentifier}?accountIdentifier=text HTTP/1.1
Host: template-service-65c77697b7-ll9lx
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Get Entities referring this template

get
Path parameters
templateIdentifierstringRequired

Template Identifier for the entity

Query parameters
pageIndexinteger · int32OptionalDefault: 0
pageSizeinteger · int32OptionalDefault: 100
accountIdentifierstringRequired
orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

versionLabelstringOptional

Version Label

isStableTemplatebooleanOptional

Is Stable Template

searchTermstringOptional
allVersionsstringOptionalDefault: false
templateEntityTypestring · enumOptionalPossible values:
labelstringOptional

Template label; lists the entities referring the template through this label

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
get/templates/entitySetupUsage/{templateIdentifier}
GET /gateway/template/api/templates/entitySetupUsage/{templateIdentifier}?accountIdentifier=text HTTP/1.1
Host: template-service-65c77697b7-ll9lx
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Gets all metadata of template list

post
Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

pageinteger · int32Optional

Page Index of the results to fetch.Default Value: 0

Default: 0
sizeinteger · int32Optional

Results per page

Default: 25
sortstring[]Optional

Specifies sorting criteria of the list. Like sorting based on the last updated entity, alphabetical sorting in an ascending or descending order

searchTermstringOptional

The word to be searched and included in the list response

filterIdentifierstringOptional

Filter Identifier

templateListTypestring · enumRequired

Template List Type

Possible values:
includeAllTemplatesAvailableAtScopebooleanOptional

Specify true if all accessible Templates are to be included

checkReferencedbooleanOptional

Specify true to check whether template is referenced

Default: false
getDistinctFromBranchesbooleanOptional
isGlobalbooleanOptionalDefault: false
Body

This contains details of the Template Filter

filterTypestring · enumRequired

This specifies the corresponding Entity of the filter.

Possible values:
templateNamesstring[]Optional
templateIdentifiersstring[]Optional
descriptionstringOptional
childTypesstring[]Optional
repoNamestringOptional
metadataFilterobject · TemplateMetadataFilterExpressionOptional

Filter expression for template metadata. Type is inferred from structure.

storeTypestring · enumOptional

Store type used to filter template list APIs

Possible values:
Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
post/templates/list-metadata
POST /gateway/template/api/templates/list-metadata?accountIdentifier=text&templateListType=Stable HTTP/1.1
Host: template-service-65c77697b7-ll9lx
Content-Type: application/json
Accept: */*
Content-Length: 348

{
  "tags": {
    "ANY_ADDITIONAL_PROPERTY": "text"
  },
  "filterType": "Connector",
  "templateNames": [
    "text"
  ],
  "templateIdentifiers": [
    "text"
  ],
  "description": "text",
  "templateEntityTypes": [
    "Step"
  ],
  "childTypes": [
    "text"
  ],
  "listingScope": {
    "accountIdentifier": "text",
    "orgIdentifier": "text",
    "projectIdentifier": "text"
  },
  "repoName": "text",
  "metadataFilter": {},
  "storeType": "ALL"
}
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Move Template YAML from inline to remote

post
Path parameters
templateIdentifierstringRequired

Template Identifier for the entity

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

connectorRefstringOptional

Identifier of Connector needed for CRUD operations on the respective Entity

repoNamestringOptional

Name of the repository.

branchstringOptional

Name of the branch.

filePathstringOptional

File Path of the Entity.

commitMsgstringOptional

Commit Message to use for the merge commit.

isNewBranchbooleanOptional

Checks the new branch

Default: false
baseBranchstringOptional

Name of the default branch.

moveConfigTypestring · enumOptional

Tells weather the entity has to be moved from inline to remote or remote to inline

Possible values:
versionLabelstringRequired

Version Label

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
post/templates/move-config/{templateIdentifier}
POST /gateway/template/api/templates/move-config/{templateIdentifier}?accountIdentifier=text&versionLabel=text HTTP/1.1
Host: template-service-65c77697b7-ll9lx
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Refresh cache and fetch a Template

get

Force-refreshes the git file cache for a remote Template and returns the freshly fetched entity. Requires the git branch query parameter — repo default branch is not inferred when branch is omitted. Behind the PIPE_GITX_FORCE_REFRESH feature flag.

Path parameters
templateIdentifierstringRequired

Template Identifier for the entity

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

labelstringOptional

Label

versionLabelstringOptional

Version Label

branchstringRequired

Name of the branch.

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
get/templates/refresh-and-get/{templateIdentifier}
GET /gateway/template/api/templates/refresh-and-get/{templateIdentifier}?accountIdentifier=text&branch=text HTTP/1.1
Host: template-service-65c77697b7-ll9lx
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Replace custom labels for one template version

post

Replace labels for one version. Invalid label tokens or other errors throw 4xx.

Path parameters
templateIdentifierstringRequired

Template Identifier for the entity

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

Body

Labels to associate with a specific template version (batch replace for that version).

labelsstring[]Required

List of labels for the given versionLabel. May be empty to clear mappings.

versionLabelstring · min: 1Required

Target template versionLabel these labels resolve to.

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
post/templates/{templateIdentifier}/labels/replace
POST /gateway/template/api/templates/{templateIdentifier}/labels/replace?accountIdentifier=text HTTP/1.1
Host: template-service-65c77697b7-ll9lx
Content-Type: application/json
Accept: */*
Content-Length: 41

{
  "labels": [
    "text"
  ],
  "versionLabel": "text"
}
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Update Template Version

put
Path parameters
templateIdentifierstringRequired

Template Identifier for the entity

versionLabelstringRequired

Version Label

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

branchstringOptional

Name of the branch.

repoIdentifierstringOptional

Git Sync Config Id. [Applicable for Old Git Sync only]

rootFolderstringOptional

Path to the root folder of the Entity. [Applicable for Old Git Sync only]

filePathstringOptional

File Path of the Entity.

commitMsgstringOptional

Commit Message to use for the merge commit.

lastObjectIdstringOptional

Its required field during update call request. It can be fetched from the response of GET API call for the entity

resolvedConflictCommitIdstringOptional

If the entity is git-synced, this parameter represents the commit id against which file conflicts are resolved

baseBranchstringOptional

Name of the default branch.

connectorRefstringOptional

Identifier of Connector needed for CRUD operations on the respective Entity

lastCommitIdstringOptional

last commit id of the file

isNewBranchbooleanOptional

Checks the new branch

Default: false
isHarnessCodeRepobooleanOptional

Is Harness code repo enabled

setDefaultTemplatebooleanOptional

Specify true if Default Template is to be set

Default: false
commentsstringOptional

Comments

Header parameters
If-MatchstringOptional
Body
stringOptional
Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
put/templates/update/{templateIdentifier}/{versionLabel}
PUT /gateway/template/api/templates/update/{templateIdentifier}/{versionLabel}?accountIdentifier=text HTTP/1.1
Host: template-service-65c77697b7-ll9lx
Content-Type: application/json
Accept: */*
Content-Length: 1478

"template:\n  name: pipelineTemplate\n  identifier: pipelineTemplate\n  versionLabel: v1\n  type: Pipeline\n  projectIdentifier: TemplateDemo\n  orgIdentifier: default\n  tags: {}\n  spec:\n    stages:\n      - stage:\n          name: stage1\n          identifier: stage1\n          description: \"\"\n          type: Deployment\n          spec:\n            deploymentType: Kubernetes\n            service:\n              serviceRef: <+input>\n              serviceInputs: <+input>\n            environment:\n              environmentRef: <+input>\n              deployToAll: false\n              environmentInputs: <+input>\n              infrastructureDefinitions: <+input>\n            execution:\n              steps:\n                - step:\n                    type: ShellScript\n                    name: Shell Script_1\n                    identifier: ShellScript_1\n                    spec:\n                      shell: Bash\n                      onDelegate: true\n                      source:\n                        type: Inline\n                        spec:\n                          script: <+input>\n                      environmentVariables: []\n                      outputVariables: []\n                    timeout: 10m\n              rollbackSteps: []\n          tags: {}\n          failureStrategies:\n            - onFailure:\n                errors:\n                  - AllErrors\n                action:\n                  type: StageRollback\n"
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Update git metadata details for a remote template

post
Path parameters
templateIdentifierstringRequired

Template Identifier for the entity

versionLabelstringRequired

Version Label

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

Body

Lists down request params for template update git details request

filePathstringOptional

filepath to be updated

repoNamestringOptional

repo name to be updated

connectorRefstringOptional

connector ref to be updated

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
post/templates/update/git-metadata/{templateIdentifier}/{versionLabel}
POST /gateway/template/api/templates/update/git-metadata/{templateIdentifier}/{versionLabel}?accountIdentifier=text HTTP/1.1
Host: template-service-65c77697b7-ll9lx
Content-Type: application/json
Accept: */*
Content-Length: 59

{
  "filePath": "text",
  "repoName": "text",
  "connectorRef": "text"
}
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Update Stable Template Version

put
Path parameters
templateIdentifierstringRequired

Template Identifier for the entity

versionLabelstringRequired

Version Label

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

branchstringOptional

Name of the branch.

repoIdentifierstringOptional

Git Sync Config Id. [Applicable for Old Git Sync only]

getDefaultFromOtherRepobooleanOptional

if true, return all the default entities

commentsstringOptional

Comments

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
put/templates/updateStableTemplate/{templateIdentifier}/{versionLabel}
PUT /gateway/template/api/templates/updateStableTemplate/{templateIdentifier}/{versionLabel}?accountIdentifier=text HTTP/1.1
Host: template-service-65c77697b7-ll9lx
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Last updated

Was this helpful?