Skip to main content
POST
/
templates
Create a template
curl --request POST \
  --url https://api.sendrealm.com/templates \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "channel": "email",
  "description": "<string>",
  "subject_template": "<string>",
  "preview_text": "<string>",
  "editor_json": {},
  "rendered_html": "<string>",
  "rendered_text": "<string>"
}
'
{
  "status": 123,
  "error": {
    "code": "<string>",
    "message": "<string>",
    "details": null
  }
}

Endpoints

  • GET /templates
  • POST /templates

Create an email template

{
  "name": "Cart Recovery Email",
  "channel": "email",
  "subject_template": "You left something behind",
  "preview_text": "Your cart is still waiting.",
  "editor_json": {
    "type": "doc",
    "content": []
  },
  "rendered_html": "<p>Your cart is still waiting.</p>",
  "rendered_text": "Your cart is still waiting."
}

Create a push template

{
  "name": "Cart Recovery Push",
  "channel": "push",
  "default_locale": "en",
  "messages": [
    {
      "locale": "en",
      "title": "Still thinking about it?",
      "message": "Your cart is ready when you are.",
      "launch_url": "https://app.sendrealm.com/cart",
      "image_url": ""
    }
  ]
}

List templates

Use query params like channel, status, and search. GET /templates?channel=email&status=active&search=cart

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string
required
channel
enum<string>
required
Available options:
email
description
string | null
subject_template
string
preview_text
string
editor_json
object
rendered_html
string
rendered_text
string

Response

Template created