Update fields on an existing template
PATCH
/v1/templates/{key}
const url = 'https://your-notavia-host/v1/templates/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","subject_template":"example","html_body_template":"example","text_body_template":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://your-notavia-host/v1/templates/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "subject_template": "example", "html_body_template": "example", "text_body_template": "example" }'Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” key
required
string
Request Body required
Section titled “Request Body required ” Media type application/json
object
name
string
subject_template
string
html_body_template
string
text_body_template
string
Example generated
{ "name": "example", "subject_template": "example", "html_body_template": "example", "text_body_template": "example"}Responses
Section titled “ Responses ”Updated template.
Media type application/json
object
id
string format: uuid
key
string
name
string
subject_template
Populated from the Email channel body for backwards compatibility.
string
html_body_template
Populated from the Email channel body for backwards compatibility.
string
text_body_template
Populated from the Email/SMS channel body for backwards compatibility.
string
created_at
string format: date-time
updated_at
string format: date-time
bodies
Per-channel body variants. Replaces the legacy flat fields for new integrations.
Array<object>
Per-channel body variant for a template. The channel-specific fields that apply depend on the channel:
- Email:
subject_template+html_template(+ optionaltext_template) - InApp:
html_template(ortext_templatefor plain-text in-app) - SMS:
text_template - Slack:
structured_template(Block Kit JSON as Liquid template) - Teams:
structured_template(Adaptive Card v1.5 JSON as Liquid template) - Discord:
text_template(content) and/orstructured_template(embed JSON)
object
channel
Notification channel identifier.
string
subject_template
string
text_template
string
html_template
string
structured_template
string
body_channels
Kebab-case list of channels for which a body variant exists.
Array<string>
Example
{ "bodies": [ { "channel": "email" } ], "body_channels": [ "email" ]}Validation or request error.
Media type application/json
object
error
required
object
type
required
string
code
required
string
message
required
string
param
string
Example generated
{ "error": { "type": "example", "code": "example", "message": "example", "param": "example" }}Missing or invalid credentials.
Media type application/json
object
error
required
object
type
required
string
code
required
string
message
required
string
param
string
Example generated
{ "error": { "type": "example", "code": "example", "message": "example", "param": "example" }}Credentials do not have the required scope.
Media type application/json
object
error
required
object
type
required
string
code
required
string
message
required
string
param
string
Example generated
{ "error": { "type": "example", "code": "example", "message": "example", "param": "example" }}Resource not found.
Media type application/json
object
error
required
object
type
required
string
code
required
string
message
required
string
param
string
Example generated
{ "error": { "type": "example", "code": "example", "message": "example", "param": "example" }}