curl --request POST \
--url https://api.lithoblocks.com/v1/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"blocks": [
{
"type": "<string>",
"id": "<string>"
}
],
"type": "<string>",
"icon_emoji": "<string>",
"user_name": "<string>",
"cc_users": [
"<string>"
],
"tags": [
"<string>"
],
"is_public": false,
"status": "draft",
"sample_data": {},
"entity_id": "<string>",
"request_format": {},
"activate": false
}
'import requests
url = "https://api.lithoblocks.com/v1/templates"
payload = {
"name": "<string>",
"blocks": [
{
"type": "<string>",
"id": "<string>"
}
],
"type": "<string>",
"icon_emoji": "<string>",
"user_name": "<string>",
"cc_users": ["<string>"],
"tags": ["<string>"],
"is_public": False,
"status": "draft",
"sample_data": {},
"entity_id": "<string>",
"request_format": {},
"activate": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
blocks: [{type: '<string>', id: '<string>'}],
type: '<string>',
icon_emoji: '<string>',
user_name: '<string>',
cc_users: ['<string>'],
tags: ['<string>'],
is_public: false,
status: 'draft',
sample_data: {},
entity_id: '<string>',
request_format: {},
activate: false
})
};
fetch('https://api.lithoblocks.com/v1/templates', 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.lithoblocks.com/v1/templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'blocks' => [
[
'type' => '<string>',
'id' => '<string>'
]
],
'type' => '<string>',
'icon_emoji' => '<string>',
'user_name' => '<string>',
'cc_users' => [
'<string>'
],
'tags' => [
'<string>'
],
'is_public' => false,
'status' => 'draft',
'sample_data' => [
],
'entity_id' => '<string>',
'request_format' => [
],
'activate' => false
]),
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.lithoblocks.com/v1/templates"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"blocks\": [\n {\n \"type\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"type\": \"<string>\",\n \"icon_emoji\": \"<string>\",\n \"user_name\": \"<string>\",\n \"cc_users\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"is_public\": false,\n \"status\": \"draft\",\n \"sample_data\": {},\n \"entity_id\": \"<string>\",\n \"request_format\": {},\n \"activate\": false\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.lithoblocks.com/v1/templates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"blocks\": [\n {\n \"type\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"type\": \"<string>\",\n \"icon_emoji\": \"<string>\",\n \"user_name\": \"<string>\",\n \"cc_users\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"is_public\": false,\n \"status\": \"draft\",\n \"sample_data\": {},\n \"entity_id\": \"<string>\",\n \"request_format\": {},\n \"activate\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lithoblocks.com/v1/templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"blocks\": [\n {\n \"type\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"type\": \"<string>\",\n \"icon_emoji\": \"<string>\",\n \"user_name\": \"<string>\",\n \"cc_users\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"is_public\": false,\n \"status\": \"draft\",\n \"sample_data\": {},\n \"entity_id\": \"<string>\",\n \"request_format\": {},\n \"activate\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"is_public": true,
"current_version_id": "<string>",
"author_id": "<string>",
"request_format": {},
"cc_users": [
"<string>"
],
"icon_emoji": "<string>",
"user_name": "<string>",
"version": {
"id": "<string>",
"template_id": "<string>",
"version_number": 123,
"status": "<string>",
"is_current": true,
"created_at": "<string>",
"created_by": "<string>",
"entity_id": "<string>",
"message": null,
"sample_data": null,
"request_format": null
},
"author": {
"id": "<string>",
"name": "<string>",
"email": "<string>"
},
"current_version": {
"id": "<string>",
"name": "<string>",
"description": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"status": "<string>",
"type": "<string>",
"icon_emoji": "<string>",
"user_name": "<string>",
"cc_users": [
"<string>"
],
"author_id": "<string>",
"request_format": {}
}
}{
"error": "<string>",
"code": "unauthenticated",
"request_id": "<string>",
"message": "<string>",
"details": "<string>",
"error_details": "<string>",
"success": false,
"valid": false,
"required_scopes": [
"<string>"
],
"user_scopes": [
"<string>"
]
}{
"error": "<string>",
"code": "unauthenticated",
"request_id": "<string>",
"message": "<string>",
"details": "<string>",
"error_details": "<string>",
"success": false,
"valid": false,
"required_scopes": [
"<string>"
],
"user_scopes": [
"<string>"
]
}{
"error": "<string>",
"code": "unauthenticated",
"request_id": "<string>",
"message": "<string>",
"details": "<string>",
"error_details": "<string>",
"success": false,
"valid": false,
"required_scopes": [
"<string>"
],
"user_scopes": [
"<string>"
]
}{
"success": false,
"error": {
"issues": [
{
"code": "<string>",
"path": [
"<string>"
],
"message": "<string>"
}
],
"name": "<string>"
},
"message": "<string>",
"code": "validation_failed",
"request_id": "<string>"
}{
"error": "<string>",
"code": "unauthenticated",
"request_id": "<string>",
"message": "<string>",
"details": "<string>",
"error_details": "<string>",
"success": false,
"valid": false,
"required_scopes": [
"<string>"
],
"user_scopes": [
"<string>"
]
}{
"error": "<string>",
"code": "unauthenticated",
"request_id": "<string>",
"message": "<string>",
"details": "<string>",
"error_details": "<string>",
"success": false,
"valid": false,
"required_scopes": [
"<string>"
],
"user_scopes": [
"<string>"
]
}Create a template
Create a template and its first version in one step. Block ids are filled in where missing, request_format is derived from the blocks, and the blocks must compile against sample_data (or a null-filled skeleton of the request format) or nothing is created. The version is a draft unless activate is true, which also requires the templates:activate scope.
curl --request POST \
--url https://api.lithoblocks.com/v1/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"blocks": [
{
"type": "<string>",
"id": "<string>"
}
],
"type": "<string>",
"icon_emoji": "<string>",
"user_name": "<string>",
"cc_users": [
"<string>"
],
"tags": [
"<string>"
],
"is_public": false,
"status": "draft",
"sample_data": {},
"entity_id": "<string>",
"request_format": {},
"activate": false
}
'import requests
url = "https://api.lithoblocks.com/v1/templates"
payload = {
"name": "<string>",
"blocks": [
{
"type": "<string>",
"id": "<string>"
}
],
"type": "<string>",
"icon_emoji": "<string>",
"user_name": "<string>",
"cc_users": ["<string>"],
"tags": ["<string>"],
"is_public": False,
"status": "draft",
"sample_data": {},
"entity_id": "<string>",
"request_format": {},
"activate": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
blocks: [{type: '<string>', id: '<string>'}],
type: '<string>',
icon_emoji: '<string>',
user_name: '<string>',
cc_users: ['<string>'],
tags: ['<string>'],
is_public: false,
status: 'draft',
sample_data: {},
entity_id: '<string>',
request_format: {},
activate: false
})
};
fetch('https://api.lithoblocks.com/v1/templates', 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.lithoblocks.com/v1/templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'blocks' => [
[
'type' => '<string>',
'id' => '<string>'
]
],
'type' => '<string>',
'icon_emoji' => '<string>',
'user_name' => '<string>',
'cc_users' => [
'<string>'
],
'tags' => [
'<string>'
],
'is_public' => false,
'status' => 'draft',
'sample_data' => [
],
'entity_id' => '<string>',
'request_format' => [
],
'activate' => false
]),
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.lithoblocks.com/v1/templates"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"blocks\": [\n {\n \"type\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"type\": \"<string>\",\n \"icon_emoji\": \"<string>\",\n \"user_name\": \"<string>\",\n \"cc_users\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"is_public\": false,\n \"status\": \"draft\",\n \"sample_data\": {},\n \"entity_id\": \"<string>\",\n \"request_format\": {},\n \"activate\": false\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.lithoblocks.com/v1/templates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"blocks\": [\n {\n \"type\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"type\": \"<string>\",\n \"icon_emoji\": \"<string>\",\n \"user_name\": \"<string>\",\n \"cc_users\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"is_public\": false,\n \"status\": \"draft\",\n \"sample_data\": {},\n \"entity_id\": \"<string>\",\n \"request_format\": {},\n \"activate\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lithoblocks.com/v1/templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"blocks\": [\n {\n \"type\": \"<string>\",\n \"id\": \"<string>\"\n }\n ],\n \"type\": \"<string>\",\n \"icon_emoji\": \"<string>\",\n \"user_name\": \"<string>\",\n \"cc_users\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"is_public\": false,\n \"status\": \"draft\",\n \"sample_data\": {},\n \"entity_id\": \"<string>\",\n \"request_format\": {},\n \"activate\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"is_public": true,
"current_version_id": "<string>",
"author_id": "<string>",
"request_format": {},
"cc_users": [
"<string>"
],
"icon_emoji": "<string>",
"user_name": "<string>",
"version": {
"id": "<string>",
"template_id": "<string>",
"version_number": 123,
"status": "<string>",
"is_current": true,
"created_at": "<string>",
"created_by": "<string>",
"entity_id": "<string>",
"message": null,
"sample_data": null,
"request_format": null
},
"author": {
"id": "<string>",
"name": "<string>",
"email": "<string>"
},
"current_version": {
"id": "<string>",
"name": "<string>",
"description": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"status": "<string>",
"type": "<string>",
"icon_emoji": "<string>",
"user_name": "<string>",
"cc_users": [
"<string>"
],
"author_id": "<string>",
"request_format": {}
}
}{
"error": "<string>",
"code": "unauthenticated",
"request_id": "<string>",
"message": "<string>",
"details": "<string>",
"error_details": "<string>",
"success": false,
"valid": false,
"required_scopes": [
"<string>"
],
"user_scopes": [
"<string>"
]
}{
"error": "<string>",
"code": "unauthenticated",
"request_id": "<string>",
"message": "<string>",
"details": "<string>",
"error_details": "<string>",
"success": false,
"valid": false,
"required_scopes": [
"<string>"
],
"user_scopes": [
"<string>"
]
}{
"error": "<string>",
"code": "unauthenticated",
"request_id": "<string>",
"message": "<string>",
"details": "<string>",
"error_details": "<string>",
"success": false,
"valid": false,
"required_scopes": [
"<string>"
],
"user_scopes": [
"<string>"
]
}{
"success": false,
"error": {
"issues": [
{
"code": "<string>",
"path": [
"<string>"
],
"message": "<string>"
}
],
"name": "<string>"
},
"message": "<string>",
"code": "validation_failed",
"request_id": "<string>"
}{
"error": "<string>",
"code": "unauthenticated",
"request_id": "<string>",
"message": "<string>",
"details": "<string>",
"error_details": "<string>",
"success": false,
"valid": false,
"required_scopes": [
"<string>"
],
"user_scopes": [
"<string>"
]
}{
"error": "<string>",
"code": "unauthenticated",
"request_id": "<string>",
"message": "<string>",
"details": "<string>",
"error_details": "<string>",
"success": false,
"valid": false,
"required_scopes": [
"<string>"
],
"user_scopes": [
"<string>"
]
}Authorizations
LithoBlocks API key obtained from your organization dashboard. The LithoBlocks MCP server also presents a Supabase-issued user session token here on the user's behalf; such a token acts as that user with the scopes their organization role allows.
Body
Template and first version
1 - 255The first version's blocks
1Show child attributes
Show child attributes
100100100201 - 50The first version's status
Data the blocks are validated against; defaults to a null-filled skeleton of the request format
Show child attributes
Show child attributes
Override; derived from the blocks when omitted
Show child attributes
Show child attributes
Make the first version current immediately. Requires the templates:activate scope.
Response
The created template, with its first version under version and, when activated, as current_version
{ template_id, data } where data holds null per placeholder and [{ field: null }] per array path; older templates may carry a flat map. For types, labels and nesting over the same paths, see GET /templates/{id}/input-schema
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes

