Document Template
The document template resource.
Basehttps://rest.carbon.ms/documentTemplate
GET
/documentTemplateList document templates
Retrieve a paginated list of document templates. Filter, order, and select columns with PostgREST query parameters.
Query parameters
selectstringComma-separated columns to return. Defaults to all.
orderstringColumn to sort by, e.g. `createdAt.desc`.
limitintegerMaximum rows to return.
offsetintegerRows 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
/documentTemplateRetrieve a document template
Fetch a single document template by filtering on `id`.
Query parameters
idstringMatch 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
/documentTemplateCreate a document template
Create a new document template.
Body parameters
documentTypestringrequiredformatVersionnumberrequiredblocksobjectrequiredthemeobjectrequiredsettingsobjectrequiredheaderSectionIdstringfooterSectionIdstringPOSThttps://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
/documentTemplateUpdate a document template
Update an existing document template, matched on `id`.
Body parameters
documentTypestringrequiredformatVersionnumberrequiredblocksobjectrequiredthemeobjectrequiredsettingsobjectrequiredheaderSectionIdstringfooterSectionIdstringPATCHhttps://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
/documentTemplateDelete a document template
Delete a document template, matched on `id`. Returns 204 No Content.
Query parameters
idstringThe `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