Update a template
curl --request PATCH \
--url https://clarus-api.com/api/templates/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "templates",
"attributes": {
"name": "<string>",
"default": true,
"template_type_id": 123,
"template_header_id": 123,
"template_footer_id": 123,
"print_params": {
"orientation": "Portrait",
"page_height": 297,
"page_width": 210,
"top": 10,
"bottom": 10,
"left": 10,
"right": 10,
"header_height": 20,
"header_spacing": 5,
"footer_height": 15,
"footer_spacing": 5
}
}
}
}
'import requests
url = "https://clarus-api.com/api/templates/{id}"
payload = { "data": {
"type": "templates",
"attributes": {
"name": "<string>",
"default": True,
"template_type_id": 123,
"template_header_id": 123,
"template_footer_id": 123,
"print_params": {
"orientation": "Portrait",
"page_height": 297,
"page_width": 210,
"top": 10,
"bottom": 10,
"left": 10,
"right": 10,
"header_height": 20,
"header_spacing": 5,
"footer_height": 15,
"footer_spacing": 5
}
}
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
type: 'templates',
attributes: {
name: '<string>',
default: true,
template_type_id: 123,
template_header_id: 123,
template_footer_id: 123,
print_params: {
orientation: 'Portrait',
page_height: 297,
page_width: 210,
top: 10,
bottom: 10,
left: 10,
right: 10,
header_height: 20,
header_spacing: 5,
footer_height: 15,
footer_spacing: 5
}
}
}
})
};
fetch('https://clarus-api.com/api/templates/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": 123,
"type": "templates",
"attributes": {
"template_type_id": 1,
"name": "Custom Dispatch Note",
"default": false,
"orientation": "Portrait",
"page_height": 297,
"page_width": 210,
"top": 10,
"bottom": 10,
"left": 10,
"right": 10,
"header_height": 20,
"header_spacing": 5,
"footer_height": 15,
"footer_spacing": 5
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Templates
Update a template
Update an existing template’s attributes, print parameters, or default status.
PATCH
/
api
/
templates
/
{id}
Update a template
curl --request PATCH \
--url https://clarus-api.com/api/templates/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Clarus-Subdomain: <api-key>' \
--data '
{
"data": {
"type": "templates",
"attributes": {
"name": "<string>",
"default": true,
"template_type_id": 123,
"template_header_id": 123,
"template_footer_id": 123,
"print_params": {
"orientation": "Portrait",
"page_height": 297,
"page_width": 210,
"top": 10,
"bottom": 10,
"left": 10,
"right": 10,
"header_height": 20,
"header_spacing": 5,
"footer_height": 15,
"footer_spacing": 5
}
}
}
}
'import requests
url = "https://clarus-api.com/api/templates/{id}"
payload = { "data": {
"type": "templates",
"attributes": {
"name": "<string>",
"default": True,
"template_type_id": 123,
"template_header_id": 123,
"template_footer_id": 123,
"print_params": {
"orientation": "Portrait",
"page_height": 297,
"page_width": 210,
"top": 10,
"bottom": 10,
"left": 10,
"right": 10,
"header_height": 20,
"header_spacing": 5,
"footer_height": 15,
"footer_spacing": 5
}
}
} }
headers = {
"Authorization": "Bearer <token>",
"X-Clarus-Subdomain": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'X-Clarus-Subdomain': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: {
type: 'templates',
attributes: {
name: '<string>',
default: true,
template_type_id: 123,
template_header_id: 123,
template_footer_id: 123,
print_params: {
orientation: 'Portrait',
page_height: 297,
page_width: 210,
top: 10,
bottom: 10,
left: 10,
right: 10,
header_height: 20,
header_spacing: 5,
footer_height: 15,
footer_spacing: 5
}
}
}
})
};
fetch('https://clarus-api.com/api/templates/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"id": 123,
"type": "templates",
"attributes": {
"template_type_id": 1,
"name": "Custom Dispatch Note",
"default": false,
"orientation": "Portrait",
"page_height": 297,
"page_width": 210,
"top": 10,
"bottom": 10,
"left": 10,
"right": 10,
"header_height": 20,
"header_spacing": 5,
"footer_height": 15,
"footer_spacing": 5
}
}
}{
"error": "<string>"
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}{
"errors": [
{
"code": 123,
"symbol": "<string>",
"details": "<string>",
"source": "<string>",
"context": {}
}
]
}Request Structure
{
"data": {
"type": "templates",
"attributes": {
"name": "Updated Dispatch Note",
"default": true,
"print_params": {
"orientation": "Landscape",
"page_height": 210,
"page_width": 297
}
}
}
}
Key Fields
All fields are optional on update. See the create endpoint for the full field and print parameters reference.- Partial
print_paramsupdates are supported (only include the parameters you want to change) - Setting
default: truemakes this the default template for its type
Authorizations
OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.
The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.
Path Parameters
The unique identifier of the template to update
Body
application/json
Show child attributes
Show child attributes
Response
Template updated successfully
Show child attributes
Show child attributes
⌘I

