Template

This endpoint is used to create, update, search or delete teamplates inside an organization.

Entity fields:

Path
Type
Description

data.type

string

Should be "template"

data.attributes.tcl

string

Terraform Configuration Language job template

data.attribute.name

string

Template name

data.attribute.description

string

Template description

data.attribute.version

string

Template version

To better understand Terrakube Configuration Language job templates please refer to the following GitHub repository.

Example:

{
  "data": {
    "type": "template",
    "attributes": {
      "name": "Some name",
      "description": "Some description",
      "version": "1.0.0",
      "tcl": "{{templateSample}}"
    }
  }
}

Supported Operations

Returns an instance of type template

get

/organization/{organizationId}/template/{templateId}

Path parameters
organizationIdstringrequired

organization Identifier

templateIdstringrequired

template Identifier

Query parameters
fields[template]enum[]

Selects the set of template fields that should be returned in the result.

includeenum[]

Selects the set of relationships that should be expanded as a compound document in the result.

Responses
curl -L \
  --url '/api/v1/organization/{organizationId}/template/{templateId}'
{
  "data": {
    "type": "text",
    "id": "text",
    "attributes": {
      "createdBy": "text",
      "createdDate": "2025-02-12T01:03:56.730Z",
      "description": "text",
      "name": "text",
      "tcl": "text",
      "updatedBy": "text",
      "updatedDate": "2025-02-12T01:03:56.730Z",
      "version": "text"
    },
    "relationships": {
      "organization": {
        "id": "text",
        "type": "organization"
      }
    }
  },
  "included": [
    {
      "attributes": {},
      "id": "text",
      "relationships": {},
      "type": "text"
    }
  ]
}

Creates an item of type template and adds it to template

post

/organization/{organizationId}/template

Path parameters
organizationIdstringrequired

organization Identifier

Body
dataobject
Responses
curl -L \
  --request POST \
  --url '/api/v1/organization/{organizationId}/template' \
  --header 'Content-Type: application/vnd.api+json'
{
  "data": {
    "type": "text",
    "id": "text",
    "attributes": {
      "createdBy": "text",
      "createdDate": "2025-02-12T01:03:56.730Z",
      "description": "text",
      "name": "text",
      "tcl": "text",
      "updatedBy": "text",
      "updatedDate": "2025-02-12T01:03:56.730Z",
      "version": "text"
    },
    "relationships": {
      "organization": {
        "id": "text",
        "type": "organization"
      }
    }
  }
}

Deletes an instance of type template

delete

/organization/{organizationId}/template/{templateId}

Path parameters
organizationIdstringrequired

organization Identifier

templateIdstringrequired

template Identifier

Responses
curl -L \
  --request DELETE \
  --url '/api/v1/organization/{organizationId}/template/{templateId}'

No body

Modifies an instance of type template

patch

/organization/{organizationId}/template/{templateId}

Path parameters
organizationIdstringrequired

organization Identifier

templateIdstringrequired

template Identifier

Body
dataobject
Responses
curl -L \
  --request PATCH \
  --url '/api/v1/organization/{organizationId}/template/{templateId}' \
  --header 'Content-Type: application/vnd.api+json'

No body

For a complete list of organization operation please visit the OpenAPI specification

Was this helpful?