Skip to main content

Save mail template

Save mail template. PUT /api/openapi/v1/mail-templates/{template_id}, scope admin.v1.mail-settings.manage.

  • Scope: admin.v1.mail-settings.manage
  • Permission: Manage enterprise mail (mail-settings)
  • Permission type: Manage
  • Endpoint: PUT/api/openapi/v1/mail-templates/{template_id}

Authentication and request headers

Call with an application API key. This endpoint checks only the scope above; read, manage and execute permissions do not imply one another.
NameLocationTypeRequiredDescriptionExample
AuthorizationheaderstringYesApplication API key, passed as a Bearer token.Bearer qwk_***
X-Request-IdheaderstringNoOptional request tracing identifier; generated by the server if omitted.req-20260831-001

Request parameters

NameLocationTypeRequiredDescriptionExample
template_idpathstringRequiredTemplate ID"<string>"
htmlbodystringRequiredHTML body"<string>"
subjectbodystringRequiredEmail subject"<string>"
textbodystringRequiredPlain text body"<string>"
versionbodyinteger · int64RequiredVersion used for concurrent update checks0

Request example

cURL

Responses

200 OK
NameTypeRequiredDescriptionExample
customizedbooleanYesWhether the template is customizedfalse
defaultOpenapifacadeMailContentYesDefault template{"html":"<string>","subject":"<string>","text":"<string>"}
default.htmlstringYesHTML body"<string>"
default.subjectstringYesEmail subject"<string>"
default.textstringYesPlain text body"<string>"
idstringYesMail template ID"<string>"
sourceOpenapifacadeMailContentYesCurrent template{"html":"<string>","subject":"<string>","text":"<string>"}
source.htmlstringYesHTML body"<string>"
source.subjectstringYesEmail subject"<string>"
source.textstringYesPlain text body"<string>"
updated_atstring · date-timeNoUpdated at"2026-08-27T10:00:00Z"
using_legacy_defaultbooleanYesWhether the legacy default template is in usefalse
variable_definitionsarray | nullYesTemplate variable definitions[{"code":"<string>","display_name":"<string>","example":"<string>","max":0,"max_length":0,"min":0,"pattern":"<string>","purpose":"<string>","rendered":false,"required":false,"type":"<string>"}]
versioninteger · int64YesVersion used for concurrent update checks0
Response example
default Flat business error
NameTypeRequiredDescriptionExample
codestringNoStable business error code"<string>"
detailstringYesHuman-readable error description"<string>"
detailsOpenapiErrorDetailsNoTest result details{"field":"<string>","reason":"<string>","suggestion":"<string>"}
details.fieldstringNoRequest field that failed validation"<string>"
details.reasonstringNoStable validation failure reason"<string>"
details.suggestionstringNoSuggested normalized value"<string>"
errorstringYesStable HTTP error type"<string>"
Response example