curl --request PUT \
--url https://api.craftkit.dev/v1/templates/{slug} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Invoice",
"description": "Standard customer invoice",
"manifest": {
"variables": [
{
"key": "customer.name",
"label": "Customer name",
"dataType": "text",
"required": true
}
],
"loops": []
}
}
'import requests
url = "https://api.craftkit.dev/v1/templates/{slug}"
payload = {
"name": "Invoice",
"description": "Standard customer invoice",
"manifest": {
"variables": [
{
"key": "customer.name",
"label": "Customer name",
"dataType": "text",
"required": True
}
],
"loops": []
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Invoice',
description: 'Standard customer invoice',
manifest: {
variables: [
{key: 'customer.name', label: 'Customer name', dataType: 'text', required: true}
],
loops: []
}
})
};
fetch('https://api.craftkit.dev/v1/templates/{slug}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.craftkit.dev/v1/templates/{slug}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Invoice',
'description' => 'Standard customer invoice',
'manifest' => [
'variables' => [
[
'key' => 'customer.name',
'label' => 'Customer name',
'dataType' => 'text',
'required' => true
]
],
'loops' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.craftkit.dev/v1/templates/{slug}"
payload := strings.NewReader("{\n \"name\": \"Invoice\",\n \"description\": \"Standard customer invoice\",\n \"manifest\": {\n \"variables\": [\n {\n \"key\": \"customer.name\",\n \"label\": \"Customer name\",\n \"dataType\": \"text\",\n \"required\": true\n }\n ],\n \"loops\": []\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.craftkit.dev/v1/templates/{slug}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Invoice\",\n \"description\": \"Standard customer invoice\",\n \"manifest\": {\n \"variables\": [\n {\n \"key\": \"customer.name\",\n \"label\": \"Customer name\",\n \"dataType\": \"text\",\n \"required\": true\n }\n ],\n \"loops\": []\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.craftkit.dev/v1/templates/{slug}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Invoice\",\n \"description\": \"Standard customer invoice\",\n \"manifest\": {\n \"variables\": [\n {\n \"key\": \"customer.name\",\n \"label\": \"Customer name\",\n \"dataType\": \"text\",\n \"required\": true\n }\n ],\n \"loops\": []\n }\n}"
response = http.request(request)
puts response.read_bodyCreate or republish a template at a slug
Idempotent companion to POST /v1/templates. The URL slug is canonical
(any slug in the body is ignored). If the template does not exist it is
created and version 1 published (201). If it exists, a new version
(n+1) is published and becomes current (200). Existing renders pin
their own version and are unaffected.
curl --request PUT \
--url https://api.craftkit.dev/v1/templates/{slug} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Invoice",
"description": "Standard customer invoice",
"manifest": {
"variables": [
{
"key": "customer.name",
"label": "Customer name",
"dataType": "text",
"required": true
}
],
"loops": []
}
}
'import requests
url = "https://api.craftkit.dev/v1/templates/{slug}"
payload = {
"name": "Invoice",
"description": "Standard customer invoice",
"manifest": {
"variables": [
{
"key": "customer.name",
"label": "Customer name",
"dataType": "text",
"required": True
}
],
"loops": []
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Invoice',
description: 'Standard customer invoice',
manifest: {
variables: [
{key: 'customer.name', label: 'Customer name', dataType: 'text', required: true}
],
loops: []
}
})
};
fetch('https://api.craftkit.dev/v1/templates/{slug}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.craftkit.dev/v1/templates/{slug}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Invoice',
'description' => 'Standard customer invoice',
'manifest' => [
'variables' => [
[
'key' => 'customer.name',
'label' => 'Customer name',
'dataType' => 'text',
'required' => true
]
],
'loops' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.craftkit.dev/v1/templates/{slug}"
payload := strings.NewReader("{\n \"name\": \"Invoice\",\n \"description\": \"Standard customer invoice\",\n \"manifest\": {\n \"variables\": [\n {\n \"key\": \"customer.name\",\n \"label\": \"Customer name\",\n \"dataType\": \"text\",\n \"required\": true\n }\n ],\n \"loops\": []\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.craftkit.dev/v1/templates/{slug}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Invoice\",\n \"description\": \"Standard customer invoice\",\n \"manifest\": {\n \"variables\": [\n {\n \"key\": \"customer.name\",\n \"label\": \"Customer name\",\n \"dataType\": \"text\",\n \"required\": true\n }\n ],\n \"loops\": []\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.craftkit.dev/v1/templates/{slug}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Invoice\",\n \"description\": \"Standard customer invoice\",\n \"manifest\": {\n \"variables\": [\n {\n \"key\": \"customer.name\",\n \"label\": \"Customer name\",\n \"dataType\": \"text\",\n \"required\": true\n }\n ],\n \"loops\": []\n }\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Project API key (ck_live_… or ck_test_…) presented as a bearer token.
For embed partner endpoints this is the partner secret key, which is the
same credential type.
Path Parameters
The template slug (canonical identifier within the project).
Body
Create/upsert body. manifest and pageConfig are validated against the
shared schema package; layout is an optional explicit CanvasDocument.
1 - 120Show child attributes
Show child attributes
Optional on create (auto-derived from name); ignored by PUT (URL is canonical).
120^[a-z0-9]+(?:-[a-z0-9]+)*$280Optional CanvasDocument contentJson; synthesized from the manifest when omitted.
Show child attributes
Show child attributes