Skip to content

Create or replace a channel body for a template

PUT
/v1/templates/{id}/bodies/{channel}
curl --request PUT \
--url https://your-notavia-host/v1/templates/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/bodies/email \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "subject_template": "example", "text_template": "example", "html_template": "example", "structured_template": "example" }'

Upserts the body for the given channel. channel must be one of: email, in_app, sms, slack, teams, discord. Returns 200 OK when updating an existing body; 201 Created when creating one for the first time.

id
required
string format: uuid
channel
required

Kebab-case channel identifier used in URL path segments and template body keys.

string
Allowed values: email in_app sms slack teams discord
Media type application/json

Provide the fields relevant to the target channel. Fields not applicable to the channel are ignored.

object
subject_template
string
nullable
text_template
string
nullable
html_template
string
nullable
structured_template

JSON string containing the channel-specific structured body. For Slack this is a Block Kit blocks array rendered via Liquid. For Teams this is an Adaptive Card v1.5 object rendered via Liquid. For Discord this is an embed object rendered via Liquid.

string
nullable
Example generated
{
"subject_template": "example",
"text_template": "example",
"html_template": "example",
"structured_template": "example"
}

Body updated.

Media type application/json

Per-channel body variant for a template. The channel-specific fields that apply depend on the channel:

  • Email: subject_template + html_template (+ optional text_template)
  • InApp: html_template (or text_template for 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/or structured_template (embed JSON)
object
channel

Notification channel identifier.

string
Allowed values: email in_app webhook sms slack teams discord
subject_template
string
nullable
text_template
string
nullable
html_template
string
nullable
structured_template
string
nullable
Example
{
"channel": "email"
}

Body created.

Media type application/json

Per-channel body variant for a template. The channel-specific fields that apply depend on the channel:

  • Email: subject_template + html_template (+ optional text_template)
  • InApp: html_template (or text_template for 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/or structured_template (embed JSON)
object
channel

Notification channel identifier.

string
Allowed values: email in_app webhook sms slack teams discord
subject_template
string
nullable
text_template
string
nullable
html_template
string
nullable
structured_template
string
nullable
Example
{
"channel": "email"
}

Validation or request error.

Media type application/json
object
error
required
object
type
required
string
code
required
string
message
required
string
param
string
nullable
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
nullable
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
nullable
Example generated
{
"error": {
"type": "example",
"code": "example",
"message": "example",
"param": "example"
}
}