Create new template version
curl --request POST \
--url https://api.lithoblocks.com/v1/templates/{id}/versions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": null,
"status": "draft",
"sample_data": null,
"entity_id": "<string>",
"request_format": null
}
'import requests
url = "https://api.lithoblocks.com/v1/templates/{id}/versions"
payload = {
"message": None,
"status": "draft",
"sample_data": None,
"entity_id": "<string>",
"request_format": None
}
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({
message: null,
status: 'draft',
sample_data: null,
entity_id: '<string>',
request_format: null
})
};
fetch('https://api.lithoblocks.com/v1/templates/{id}/versions', 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/{id}/versions",
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([
'message' => null,
'status' => 'draft',
'sample_data' => null,
'entity_id' => '<string>',
'request_format' => null
]),
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/{id}/versions"
payload := strings.NewReader("{\n \"message\": null,\n \"status\": \"draft\",\n \"sample_data\": null,\n \"entity_id\": \"<string>\",\n \"request_format\": null\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/{id}/versions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message\": null,\n \"status\": \"draft\",\n \"sample_data\": null,\n \"entity_id\": \"<string>\",\n \"request_format\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lithoblocks.com/v1/templates/{id}/versions")
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 \"message\": null,\n \"status\": \"draft\",\n \"sample_data\": null,\n \"entity_id\": \"<string>\",\n \"request_format\": null\n}"
response = http.request(request)
puts response.read_body{
"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
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"details": "<string>"
}Template Versions
Create new template version
Create a new version of a template. snake_case body keys; legacy camelCase accepted.
POST
/
v1
/
templates
/
{id}
/
versions
Create new template version
curl --request POST \
--url https://api.lithoblocks.com/v1/templates/{id}/versions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": null,
"status": "draft",
"sample_data": null,
"entity_id": "<string>",
"request_format": null
}
'import requests
url = "https://api.lithoblocks.com/v1/templates/{id}/versions"
payload = {
"message": None,
"status": "draft",
"sample_data": None,
"entity_id": "<string>",
"request_format": None
}
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({
message: null,
status: 'draft',
sample_data: null,
entity_id: '<string>',
request_format: null
})
};
fetch('https://api.lithoblocks.com/v1/templates/{id}/versions', 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/{id}/versions",
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([
'message' => null,
'status' => 'draft',
'sample_data' => null,
'entity_id' => '<string>',
'request_format' => null
]),
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/{id}/versions"
payload := strings.NewReader("{\n \"message\": null,\n \"status\": \"draft\",\n \"sample_data\": null,\n \"entity_id\": \"<string>\",\n \"request_format\": null\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/{id}/versions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message\": null,\n \"status\": \"draft\",\n \"sample_data\": null,\n \"entity_id\": \"<string>\",\n \"request_format\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lithoblocks.com/v1/templates/{id}/versions")
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 \"message\": null,\n \"status\": \"draft\",\n \"sample_data\": null,\n \"entity_id\": \"<string>\",\n \"request_format\": null\n}"
response = http.request(request)
puts response.read_body{
"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
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"details": "<string>"
}Authorizations
LithoBlocks API key obtained from your organization dashboard
Path Parameters
Body
application/json
Version creation data
⌘I

