PUT
/v1/email-templateSaves a subject and a text. Each may use the fields {{rechnungsnummer}}, {{verkaeufer}}, {{kaeufer}}, {{betrag}} and {{faellig}}, filled from the invoice being sent; a fact the invoice does not state is left empty. Any other field is refused. Only a signed-in person can save it.
Request body
application/json, required
- subjectstringRequired
- bodystringRequired
Response
A 200 answer carries these fields.
- subjectstring or nullRequired
- bodystring or nullRequired
- versionintegerRequired
0 when none was saved.
Status codes
| Status | Meaning |
|---|---|
200 |
The saved version. |
400 |
A field is unknown, a part is empty or too long, or the body names another key (invalid_email_template). Nothing was saved. |
401 |
No usable credential, or not a signed-in person (invalid_credentials, session_required). |
503 |
No database is configured (store_unavailable). |
PUT
/v1/email-templateExample
curl -X PUT https://api.certinvo.com/v1/email-template \
-H "Authorization: Bearer $CERTINVO_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @body.jsonimport { readFile } from 'node:fs/promises'
const response = await fetch(`https://api.certinvo.com/v1/email-template`, {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.CERTINVO_API_KEY}`,
'Content-Type': 'application/json',
},
body: await readFile('body.json'),
})
console.log(response.status, await response.json())import os
import requests
response = requests.put(
"https://api.certinvo.com/v1/email-template",
headers={"Authorization": f"Bearer {os.environ['CERTINVO_API_KEY']}", "Content-Type": "application/json"},
data=open("body.json", "rb"),
)
print(response.status_code, response.text)200
application/json
{
"subject": "string",
"body": "string",
"version": 0
}Success response