Add a Template

JFrog REST APIs

Products
JFrog Xray
Content Type
REST API
ft:sourceType
Paligo

Description: Adds a template that can be used to create pipelines.

Security: Requires a valid user

Usage: POST api/v1/templates

Consumes: application/json

URL Parameters: None

Request Parameters:

Parameter

Type

Description

Required/Optional

name

String

Name of the template.

Required

namespace

String

The namespace of the template. This is part of the directory path in which the template is found in the template source.

Required

templateSourceId

Integer

The ID of the templateSource to which the template belongs.

Required

syntaxVersion

String

The semver version of the template, matching the Git tag containing the version, or 'latest'.

Required

latestSha

String

The most recently synchronized SHA for this template.

Optional

Produces: application/json

Sample Request:

curl -L -X POST 'https://icarus.jfrogdev.org/pipelines/api/v1/templates' \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
--data-raw '{
  "name": "foo",
  "syntaxVersion": "latest",
  "templateSourceId": 4,
  "namespace": "foo"
}'

Sample Response:

{
    "id": 4,
    "name": "foo",
    "syntaxVersion": "latest",
    "templateSourceId": 4,
    "namespace": "foo",
    "isSyncing": false,
    "latestSha": null,
    "updatedAt": "2021-05-26T12:31:18.904Z",
    "createdAt": "2021-05-26T12:31:18.904Z",
    "lastSyncStatusCode": null,
    "lastSyncStartedAt": null,
    "lastSyncEndedAt": null,
    "lastSyncLogs": null,
    "retiredAt": null
}

Response Codes:

200: Success