Save Email Template
Create or update an email notification template for a company. Templates are used to render the emails sent to a company's customers; sending the request again updates the existing template.
Endpoint
| Property | Value |
|---|---|
| URL | POST /email-template/save/{companyId} |
| Method | POST |
| Auth | R-Auth: <company-jwt> |
| Content-Type | application/json |
| Base URL | Stage Environment https://api-stage.docnova.ai/ Production Environment https://api.docnova.ai/ |
Example Request
curl --location '{{baseUrl}}/email-template/save/{{companyId}}' \
--header 'Content-Type: application/json' \
--header 'R-Auth: {{companyJwt}}' \
--data-raw '{
"name": "template name",
"language": "EN",
"bodyTemplate": "<p>Hello {{name}},</p><p style=\"margin-top: 40px\">You have received a new invoice via {{portalName}} from {{companyName}}.</p><p style=\"margin-top: 20px\"><strong>Invoice Number: </strong><span>{{extra1}}</span></p><p style=\"margin-top: 30px\">Please find the attached PDF document that contains invoice details. If you have any questions regarding this invoice, please contact {{companyName}} directly.</p><p style=\"margin-top: 40px\">Best regards,</p><p>Docnova Team</p>",
"subjectTemplate": "template subject"
}'
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
companyId | UUID | Yes | Company UUID the template belongs to |
Request body
{
"name": "template name",
"language": "EN",
"bodyTemplate": "<p>Hello {{name}},</p><p style=\"margin-top: 40px\">You have received a new invoice via {{portalName}} from {{companyName}}.</p><p style=\"margin-top: 20px\"><strong>Invoice Number: </strong><span>{{extra1}}</span></p><p style=\"margin-top: 30px\">Please find the attached PDF document that contains invoice details. If you have any questions regarding this invoice, please contact {{companyName}} directly.</p><p style=\"margin-top: 40px\">Best regards,</p><p>Docnova Team</p>",
"subjectTemplate": "template subject"
}
Request fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Template name used to identify it in the Portal |
language | string | Yes | Language code the template content is written in (e.g. EN) |
subjectTemplate | string | Yes | Template used to render the email subject line |
bodyTemplate | string | Yes | HTML template used to render the email body |
note
bodyTemplate and subjectTemplate support placeholders such as {{name}}, {{portalName}}, {{companyName}} and {{extra1}}, which are replaced with the actual values when the email is sent.
Response
"3fa85f64-5717-4562-b3fc-2c963f66afa6"
Response fields
| Field | Type | Description |
|---|---|---|
(body) | string (UUID) | Unique identifier (UUID) of the saved email template. The response is a plain UUID value, not a JSON object. |
Response Codes
| Code | Description |
|---|---|
200 | OK — Email template saved. Example value: 3fa85f64-5717-4562-b3fc-2c963f66afa6 |
201 | Created |
401 | Unauthorized — R-Auth header missing or invalid |
403 | Forbidden — Company is not authorized for this operation |
404 | Not Found |