Skip to content

Document Template

The document template resource.

Base/documentTemplate
GET/documentTemplate

List document templates

Retrieve a paginated list of document templates. Filter, order, and select columns with PostgREST query parameters.

Query parameters

selectstring

Comma-separated columns to return. Defaults to all.

orderstring

Column to sort by, e.g. `createdAt.desc`.

limitinteger

Maximum rows to return.

offsetinteger

Rows to skip, for pagination.

GET/documentTemplate
curl --request GET \
  --url '<your-host>/documentTemplate?select=*&limit=10' \
  --header 'Authorization: Bearer <api-key>'
Response
[
  {
    "id": "abc123def456",
    "companyId": "xyz789",
    "documentType": "string",
    "formatVersion": 0,
    "blocks": "string",
    "theme": "string",
    "settings": "string",
    "createdBy": "string"
  }
]
GET/documentTemplate

Retrieve a document template

Fetch a single document template by filtering on `id`.

Query parameters

idstring

Match on the document template's `id`, e.g. `eq.{id}`.

GET/documentTemplate
curl --request GET \
  --url '<your-host>/documentTemplate?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>'
Response
{
  "id": "abc123def456",
  "companyId": "xyz789",
  "documentType": "string",
  "formatVersion": 0,
  "blocks": "string",
  "theme": "string",
  "settings": "string",
  "createdBy": "string"
}
POST/documentTemplate

Create a document template

Create a new document template.

Body parameters

documentTypestringrequired
formatVersionnumberrequired
blocksobjectrequired
themeobjectrequired
settingsobjectrequired
headerSectionIdstring
footerSectionIdstring
POST/documentTemplate
curl --request POST \
  --url <your-host>/documentTemplate \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Prefer: return=representation' \
  --data '{"documentType":"string","formatVersion":0,"blocks":"string","theme":"string","settings":"string"}'
Response
{
  "id": "abc123def456",
  "companyId": "xyz789",
  "documentType": "string",
  "formatVersion": 0,
  "blocks": "string",
  "theme": "string",
  "settings": "string",
  "createdBy": "string"
}
PATCH/documentTemplate

Update a document template

Update an existing document template, matched on `id`.

Body parameters

documentTypestringrequired
formatVersionnumberrequired
blocksobjectrequired
themeobjectrequired
settingsobjectrequired
headerSectionIdstring
footerSectionIdstring
PATCH/documentTemplate
curl --request PATCH \
  --url '<your-host>/documentTemplate?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Prefer: return=representation' \
  --data '{"documentType":"string"}'
Response
{
  "id": "abc123def456",
  "companyId": "xyz789",
  "documentType": "string",
  "formatVersion": 0,
  "blocks": "string",
  "theme": "string",
  "settings": "string",
  "createdBy": "string"
}
DELETE/documentTemplate

Delete a document template

Delete a document template, matched on `id`. Returns 204 No Content.

Query parameters

idstring

The `id` of the document template to delete, e.g. `eq.{id}`.

DELETE/documentTemplate
curl --request DELETE \
  --url '<your-host>/documentTemplate?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>'
204 No Content