Skip to main content
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
      }
    }
  }
}
'
{
  "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
    }
  }
}

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_params updates are supported (only include the parameters you want to change)
  • Setting default: true makes this the default template for its type

Authorizations

Authorization
string
header
required

OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.

X-Clarus-Subdomain
string
header
required

The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.

Path Parameters

id
integer
required

The unique identifier of the template to update

Body

application/json
data
object
required

Response

Template updated successfully

data
object