Skip to main content
POST
/
api
/
templates
/
{id}
/
attachment
Upload Liquid HTML template file
curl --request POST \
  --url https://clarus-api.com/api/templates/{id}/attachment \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/octet-stream' \
  --header 'X-Clarus-Subdomain: <api-key>' \
  --data '"<string>"'
{
  "error": "<string>"
}

Binary Upload

This endpoint uses binary upload (not JSON:API). Send the file contents as the raw request body.

Required Headers

HeaderDescriptionExample
Content-DispositionFilename of the uploadattachment; filename="dispatch_note.html.liquid"
Content-TypeMIME type of the filetext/html

cURL Example

curl -X POST https://clarus-api.com/api/templates/42/attachment \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "X-Clarus-Subdomain: acme-warehouse" \
  -H "Content-Disposition: attachment; filename=\"dispatch_note.html.liquid\"" \
  -H "Content-Type: text/html" \
  --data-binary @dispatch_note.html.liquid
The uploaded file should be a valid Liquid HTML template. See the create endpoint for available Liquid variables per template 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

Body

The Liquid HTML template file contents

Response

Attachment uploaded successfully