Document Template

The document template resource.

Basehttps://rest.carbon.ms/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.

GEThttps://rest.carbon.ms/documentTemplate
curl --request GET \
  --url 'https://rest.carbon.ms/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}`.

GEThttps://rest.carbon.ms/documentTemplate
curl --request GET \
  --url 'https://rest.carbon.ms/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
POSThttps://rest.carbon.ms/documentTemplate
curl --request POST \
  --url https://rest.carbon.ms/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
PATCHhttps://rest.carbon.ms/documentTemplate
curl --request PATCH \
  --url 'https://rest.carbon.ms/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}`.

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