Get a template by key
GET
/v1/templates/{key}
const url = 'https://your-notavia-host/v1/templates/example';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://your-notavia-host/v1/templates/example \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” key
required
string
Responses
Section titled “ Responses ”Template record.
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" ]}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" }}