Templates
This contains a list of APIs specific to the Templates Validations and Refresh
Returns the current status of a bulk reconciliation run, along with the reconciliation status of every referenced entity, identified by its bulk reconciliation UUID.
Bulk reconciliation uuid for the Entity.
Account Identifier for the Entity.
Organization Identifier for the Entity.
Project Identifier for the Entity.
Bad Request
This is Failure entity as defied in Harness
Internal Server Error
Returns the bulk reconciliation status and details of each referenced entity
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"
}
]
}Returns YAML with updated Template Inputs for a given YAML
Account Identifier for the Entity.
Organization Identifier for the Entity.
Project Identifier for the Entity.
Name of the branch.
Git Sync Config Id. [Applicable for Old Git Sync only]
if true, return all the default entities
Harness YAML Version
0falseBad Request
This is Failure entity as defied in Harness
Internal Server Error
Returns YAML with updated Template Inputs, when an underlying Template has been updated and a reconciliation is pending in a given 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"
}
]
}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.
Template Identifier for the entity
Version Label
Account Identifier for the Entity.
Organization Identifier for the Entity.
Project Identifier for the Entity.
Is Stable Template
Name of the branch.
Git Sync Config Id. [Applicable for Old Git Sync only]
if true, return all the default entities
Bad Request
This is Failure entity as defied in Harness
Internal Server Error
Returns the bulk reconciliation UUID and the status of each referenced entity
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"
}
]
}Validates the Template Inputs in a pipeline's YAML specification. If the Template Inputs are invalid, the operation returns an error summary.
Account Identifier for the Entity.
Organization Identifier for the Entity.
Project Identifier for the Entity.
Template Identifier for the entity
Template version
Name of the branch.
Git Sync Config Id. [Applicable for Old Git Sync only]
if true, return all the default entities
falseBad Request
This is Failure entity as defied in Harness
Internal Server Error
Returns a validation result for Template Inputs present in a YAML specification.
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"
}
]
}Name of the branch.
Git Sync Config Id. [Applicable for Old Git Sync only]
if true, return all the default entities
falsefalseBad Request
This is Failure entity as defied in Harness
Internal Server Error
Gets complete yaml with templateRefs resolved
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"
}
]
}Account Identifier for the Entity.
Organization Identifier for the Entity.
Project Identifier for the Entity.
Optional labels for this version (repeat). Requires template labels FF.
Name of the branch.
Git Sync Config Id. [Applicable for Old Git Sync only]
Path to the root folder of the Entity. [Applicable for Old Git Sync only]
File Path of the Entity.
File Path of the Entity.
Checks the new branch
falseName of the default branch.
Identifier of Connector needed for CRUD operations on the respective Entity
Tells whether the Entity is to be saved on Git or not
Name of the repository.
Is Harness code repo enabled
Specify true if Default Template is to be set
falseComments
When isNewTemplate flag is set user will not be able to create a new version for an existing template
falseSet to true for Pipeline templates with DAG (Directed Acyclic Graph) execution
falseBad Request
This is Failure entity as defied in Harness
Internal Server Error
Returns the created Template
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"
}
]
}Template Identifier for the entity
Version Label
Account Identifier for the Entity.
Organization Identifier for the Entity.
Project Identifier for the Entity.
Name of the branch.
Git Sync Config Id. [Applicable for Old Git Sync only]
Path to the root folder of the Entity. [Applicable for Old Git Sync only]
File Path of the Entity.
Commit Message to use for the merge commit.
Last Object Id
If true, the Entity will be forced delete, without checking any references/usages
falseBad Request
This is Failure entity as defied in Harness
Internal Server Error
Returns true if the Template is deleted
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"
}
]
}Template Identifier for the entity
Account Identifier for the Entity.
Organization Identifier for the Entity.
Project Identifier for the Entity.
Label
Version Label
Specifies whether Template is deleted or not
falseName of the branch.
Git Sync Config Id. [Applicable for Old Git Sync only]
if true, return all the default entities
falsefalseBad Request
This is Failure entity as defied in Harness
Internal Server Error
Returns the saved Template
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"
}
]
}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.
Account Identifier for the Entity.
Name of the branch.
Git Sync Config Id. [Applicable for Old Git Sync only]
if true, return all the default entities
falsefalseRequest to fetch multiple templates in a single batch operation
Bad Request
This is Failure entity as defied in Harness
Internal Server Error
Returns batch response with successful and failed template fetches
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"
}
]
}Template Identifier for the entity
Account Identifier for the Entity.
Organization Identifier for the Entity.
Project Identifier for the Entity.
Template Label
Template Version Label
Name of the branch.
Git Sync Config Id. [Applicable for Old Git Sync only]
if true, return all the default entities
falseBad Request
This is Failure entity as defied in Harness
Internal Server Error
Returns the Template Input Set YAML
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"
}
]
}Per-version labels; optional version filter.
Template Identifier for the entity
Account Identifier for the Entity.
Organization Identifier for the Entity.
Project Identifier for the Entity.
Optional. Repeat to limit which versions are included.
Bad Request
This is Failure entity as defied in Harness
Internal Server Error
account, org, project, identifier, versionToLabelsMapping, stableVersionLabel
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"
}
]
}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.
Template Identifier for the entity
Organization Identifier for the Entity.
Project Identifier for the Entity.
Version Label
Is Stable Template
falseName of the branch.
Name of the repository.
0100Specifies sorting criteria of the list. Like sorting based on the last updated entity, alphabetical sorting in an ascending or descending order
Bad Request
This is Failure entity as defied in Harness
Internal Server Error
Returns Entities list referring this template, with reconciliation status
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"
}
]
}Template Identifier for the entity
0100Organization Identifier for the Entity.
Project Identifier for the Entity.
Version Label
Is Stable Template
falseTemplate label; lists the entities referring the template through this label
Bad Request
This is Failure entity as defied in Harness
Internal Server Error
Returns Entities list referring this template
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"
}
]
}Account Identifier for the Entity.
Organization Identifier for the Entity.
Project Identifier for the Entity.
Page Index of the results to fetch.Default Value: 0
0Results per page
25Specifies sorting criteria of the list. Like sorting based on the last updated entity, alphabetical sorting in an ascending or descending order
The word to be searched and included in the list response
Filter Identifier
Template List Type
Specify true if all accessible Templates are to be included
Specify true to check whether template is referenced
falsefalseThis contains details of the Template Filter
This specifies the corresponding Entity of the filter.
Filter expression for template metadata. Type is inferred from structure.
Store type used to filter template list APIs
Bad Request
This is Failure entity as defied in Harness
Internal Server Error
Returns a list of all the metadata of all Templates
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"
}
]
}Template Identifier for the entity
Account Identifier for the Entity.
Organization Identifier for the Entity.
Project Identifier for the Entity.
Identifier of Connector needed for CRUD operations on the respective Entity
Name of the repository.
Name of the branch.
File Path of the Entity.
Commit Message to use for the merge commit.
Checks the new branch
falseName of the default branch.
Tells weather the entity has to be moved from inline to remote or remote to inline
Version Label
Bad Request
This is Failure entity as defied in Harness
Internal Server Error
Fetches Template YAML from Harness DB and creates a remote entity
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"
}
]
}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.
Template Identifier for the entity
Account Identifier for the Entity.
Organization Identifier for the Entity.
Project Identifier for the Entity.
Label
Version Label
Name of the branch.
Bad Request
This is Failure entity as defied in Harness
Internal Server Error
Returns Template YAML fetched fresh from git
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 labels for one version. Invalid label tokens or other errors throw 4xx.
Template Identifier for the entity
Account Identifier for the Entity.
Organization Identifier for the Entity.
Project Identifier for the Entity.
Labels to associate with a specific template version (batch replace for that version).
List of labels for the given versionLabel. May be empty to clear mappings.
Target template versionLabel these labels resolve to.
Bad Request
This is Failure entity as defied in Harness
Internal Server Error
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"
}
]
}Template Identifier for the entity
Version Label
Account Identifier for the Entity.
Organization Identifier for the Entity.
Project Identifier for the Entity.
Name of the branch.
Git Sync Config Id. [Applicable for Old Git Sync only]
Path to the root folder of the Entity. [Applicable for Old Git Sync only]
File Path of the Entity.
Commit Message to use for the merge commit.
Its required field during update call request. It can be fetched from the response of GET API call for the entity
If the entity is git-synced, this parameter represents the commit id against which file conflicts are resolved
Name of the default branch.
Identifier of Connector needed for CRUD operations on the respective Entity
last commit id of the file
Checks the new branch
falseIs Harness code repo enabled
Specify true if Default Template is to be set
falseComments
Bad Request
This is Failure entity as defied in Harness
Internal Server Error
Returns the updated Template Version
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"
}
]
}Template Identifier for the entity
Version Label
Account Identifier for the Entity.
Organization Identifier for the Entity.
Project Identifier for the Entity.
Lists down request params for template update git details request
filepath to be updated
repo name to be updated
connector ref to be updated
Bad Request
This is Failure entity as defied in Harness
Internal Server Error
Update git metadata details for a remote template
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"
}
]
}Template Identifier for the entity
Version Label
Account Identifier for the Entity.
Organization Identifier for the Entity.
Project Identifier for the Entity.
Name of the branch.
Git Sync Config Id. [Applicable for Old Git Sync only]
if true, return all the default entities
Comments
Bad Request
This is Failure entity as defied in Harness
Internal Server Error
Returns the updated Template Version
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?