Get Template

The get template endpoint allows you to retrieve information about a specific template.

Request

GET /v1/templates/{template_id}

Path Parameters

ParameterTypeDescription
template_idstringThe unique identifier of the template to retrieve

Response

{
  "id": string,
  "name": string,
  "created_at": string,
  "file_size": number,
  "sha256": string,
  "tags": TagMeta[],
}

The TagMeta type is defined as follows:

{
  name: string;
  shape: "standalone" | "container";
  children?: TagMeta[];
}

Response Fields

FieldTypeDescription
idstringUnique identifier of the template
namestringName of the template
created_atstringISO 8601 timestamp of when the template was created (e.g. "2024-01-01T12:00:00Z")
file_sizenumberSize of the template file in bytes
sha256stringSHA-256 hash of the template file
tagsarrayArray of tag objects containing placeholder information

Examples

const apiKey = "Your_API_Key";
const templateId = "template_123";

const response = await fetch(`https://templatedocs.io/api/v1/templates/${templateId}`, {
    headers: {
        "Authorization": `Bearer ${apiKey}`
    }
});
const template = await response.json();
console.log(template);