Home Schema Example JSON Schema

ReplyTo

Type: object

This is the schema for the ReplyTo metadata representing replyee message information

No Additional Properties

Replyee Delivery UID

Type: null or string

The UID of the replyee delivery object. Used when replyee edits/deletes their message.

Replied on datetime

Type: stringFormat: date-time

Replied On datetime to track when we "copied" the replyee message (may be used to check if original message was edited post-reply)

Replyee name

Type: string

Name of replyee to render on Frontend

Must be at least 1 characters long

Message

Type: object

This is the schema for messages as described and proposed in the Ratatoskr: Data Models for Messages RFC.

No Additional Properties

Type

Type: const

The type of this element.

Specific value: "message"

Message


Message element metadata.

Type: object

Title

Type: object

Title primitive element.

No Additional Properties

Type

Type: const

The type of this element.

Specific value: "title"

Title

Type: string

Title content.

Must be at least 1 characters long

Subtitle

Type: object

Subtitle primitive element.

No Additional Properties

Type

Type: const

The type of this element.

Specific value: "subtitle"

Subtitle

Type: string

Subtitle content.

Must be at least 1 characters long

Text

Type: object

Text primitive element.

No Additional Properties

Type

Type: const

The type of this element.

Specific value: "text"

Text

Type: string

Text content.

Must be at least 1 characters long

Type: object

Image

Type: object

Image primitive element.

No Additional Properties

Type

Type: const

The type of this element.

Specific value: "image"

Image Metadata

Type: object

Image element metadata.

URL

Type: object

URL to the image file.

Scale

Type: enum (of string)

Overrides frontend's default image scaling algorithm.

Must be one of:

  • "center"
  • "center-crop"
  • "center-inside"

Actionable

Type: object

Action to take when clicking on the image (or preview image). Defaults to opening the image in viewer.

URL

Type: string

URL to the link file. Could be application internal links too. Currently supported internal links are: botmd://hospital/postMessage, botmd://hospital/emobot, botmd://hospital/gql, and `botmd://hospital/jarvisQuery.

Must be at least 1 characters long

External Browser

Type: boolean

Whether to open the url in an external browser instead of our own webview. Defaults to false.

Content Type

Type: string

The MIME type of the content at URL. This is guessed from the extension of the url. If it is a http/https URL and there are no file extensions, text/html is assumed.
This is useful to override the default app responsible for opening it.
See scalpel.messages.url.ContentTypeMixin for content type guessing logic.

Must be at least 1 characters long

Event Metadata

Type: object

Metadata to describe an event that can be posted to Shadowfax. This is usually part of an Actionable.

No Additional Properties

Type

Type: string

Event type that will be posted to Shadowfax (i.e., event_type) when this action is taken.

Must be at least 1 characters long

Properties

Type: object

Optional event properties that will be posted to Shadowfax (i.e., event_properties) when this action is taken.

Additional Properties of any type are allowed.

Type: object

Additional Properties of any type are allowed.

Type: object

Additional Properties of any type are allowed.

Type: object

Audio

Type: object

Audio primitive element.

No Additional Properties

Type

Type: const

The type of this element.

Specific value: "audio"

Audio Metadata

Type: object

Audio element metadata.

URL

Type: object

URL to the audio file.

Preview Image

Type: object

Preview image of audio. Defaults to a generic audio icon.

URL

Type: object

URL to the image file.

Scale

Type: enum (of string)

Overrides frontend's default image scaling algorithm.

Must be one of:

  • "center"
  • "center-crop"
  • "center-inside"

Actionable

Type: object

Action to take when clicking on the image (or preview image). Defaults to opening the image in viewer.

URL

Type: string

URL to the link file. Could be application internal links too. Currently supported internal links are: botmd://hospital/postMessage, botmd://hospital/emobot, botmd://hospital/gql, and `botmd://hospital/jarvisQuery.

Must be at least 1 characters long

External Browser

Type: boolean

Whether to open the url in an external browser instead of our own webview. Defaults to false.

Content Type

Type: string

The MIME type of the content at URL. This is guessed from the extension of the url. If it is a http/https URL and there are no file extensions, text/html is assumed.
This is useful to override the default app responsible for opening it.
See scalpel.messages.url.ContentTypeMixin for content type guessing logic.

Must be at least 1 characters long

Event Metadata

Type: object

Metadata to describe an event that can be posted to Shadowfax. This is usually part of an Actionable.

No Additional Properties

Type

Type: string

Event type that will be posted to Shadowfax (i.e., event_type) when this action is taken.

Must be at least 1 characters long

Properties

Type: object

Optional event properties that will be posted to Shadowfax (i.e., event_properties) when this action is taken.

Additional Properties of any type are allowed.

Type: object

Additional Properties of any type are allowed.

Type: object

Additional Properties of any type are allowed.

Type: object

Additional Properties of any type are allowed.

Type: object

Video

Type: object

Video primitive element.

No Additional Properties

Type

Type: const

The type of this element.

Specific value: "video"

Video Metadata

Type: object

Video element metadata.

URL

Type: object

URL to the video file.

Preview Image

Type: object

Preview image of video. Defaults to first frame of video.

URL

Type: object

URL to the image file.

Scale

Type: enum (of string)

Overrides frontend's default image scaling algorithm.

Must be one of:

  • "center"
  • "center-crop"
  • "center-inside"

Actionable

Type: object

Action to take when clicking on the image (or preview image). Defaults to opening the image in viewer.

URL

Type: string

URL to the link file. Could be application internal links too. Currently supported internal links are: botmd://hospital/postMessage, botmd://hospital/emobot, botmd://hospital/gql, and `botmd://hospital/jarvisQuery.

Must be at least 1 characters long

External Browser

Type: boolean

Whether to open the url in an external browser instead of our own webview. Defaults to false.

Content Type

Type: string

The MIME type of the content at URL. This is guessed from the extension of the url. If it is a http/https URL and there are no file extensions, text/html is assumed.
This is useful to override the default app responsible for opening it.
See scalpel.messages.url.ContentTypeMixin for content type guessing logic.

Must be at least 1 characters long

Event Metadata

Type: object

Metadata to describe an event that can be posted to Shadowfax. This is usually part of an Actionable.

No Additional Properties

Type

Type: string

Event type that will be posted to Shadowfax (i.e., event_type) when this action is taken.

Must be at least 1 characters long

Properties

Type: object

Optional event properties that will be posted to Shadowfax (i.e., event_properties) when this action is taken.

Additional Properties of any type are allowed.

Type: object

Additional Properties of any type are allowed.

Type: object

Additional Properties of any type are allowed.

Type: object

Preview Autostart

Type: boolean

Whether to auto play video in preview view. Defaults to false.

Additional Properties of any type are allowed.

Type: object

Attachment

Type: object

Attachment primitive element.

No Additional Properties

Type

Type: const

The type of this element.

Specific value: "attachment"

Attachment Metadata

Type: object

Attachment element metadata.

No Additional Properties

URL

Type: string

URL to the attachment file.

Must match regular expression: ^((https|s3|gs|file)\:\/\/|\$)

Filename

Type: string

Filename for attachment. This is useful when the filename cannot be inferred from the URL.

Must be at least 1 characters long

Content Type

Type: string

The MIME type of the attachment. This is guessed from the extension of the filename followed by the url. See scalpel.messages.url.ContentTypeMixin for content type guessing logic.

Must be at least 1 characters long

Preview Image

Type: object

Preview image of attachment. Defaults to first frame of attachment.

URL

Type: object

URL to the image file.

Scale

Type: enum (of string)

Overrides frontend's default image scaling algorithm.

Must be one of:

  • "center"
  • "center-crop"
  • "center-inside"

Actionable

Type: object

Action to take when clicking on the image (or preview image). Defaults to opening the image in viewer.

URL

Type: string

URL to the link file. Could be application internal links too. Currently supported internal links are: botmd://hospital/postMessage, botmd://hospital/emobot, botmd://hospital/gql, and `botmd://hospital/jarvisQuery.

Must be at least 1 characters long

External Browser

Type: boolean

Whether to open the url in an external browser instead of our own webview. Defaults to false.

Content Type

Type: string

The MIME type of the content at URL. This is guessed from the extension of the url. If it is a http/https URL and there are no file extensions, text/html is assumed.
This is useful to override the default app responsible for opening it.
See scalpel.messages.url.ContentTypeMixin for content type guessing logic.

Must be at least 1 characters long

Event Metadata

Type: object

Metadata to describe an event that can be posted to Shadowfax. This is usually part of an Actionable.

No Additional Properties

Type

Type: string

Event type that will be posted to Shadowfax (i.e., event_type) when this action is taken.

Must be at least 1 characters long

Properties

Type: object

Optional event properties that will be posted to Shadowfax (i.e., event_properties) when this action is taken.

Additional Properties of any type are allowed.

Type: object

Additional Properties of any type are allowed.

Type: object

Additional Properties of any type are allowed.

Type: object

Einstein attachment metadata

Type: object

Einstein-specific metadata for this attachment

Document UID

Type: string

Einstein Document UID for attachment.

Must be at least 1 characters long

Type: object

Button

Type: object

Button action primitive element.

No Additional Properties

Type

Type: const

The type of this element.

Specific value: "button"

Button Metadata

Type: object

Button action element metadata.

Visuals

Type: object

Metadata to describe the visual aspect of a button.

Text

Type: string

Display text.

Must be at least 1 characters long

Style

Type: enum (of string)

Button styling options. cta refers to call to action buttons that have a blue background, while link buttons have white background. Defaults to link.

Must be one of:

  • "cta"
  • "link"

Additional Properties of any type are allowed.

Type: object

Actionable metadata

Type: object

Metadata to describe actions that are taken when a UI element is triggered (e.g., tapped, clicked, etc).

Same definition as actionable
Type: object

Quick Reply

Type: object

Quick reply primitive element.

No Additional Properties

Type

Type: const

The type of this element.

Specific value: "quick_reply"

Quick Reply Metadata

Type: object

Quick reply element metadata.

Visuals

Type: object

Metadata to describe the visual aspect of a quick reply.

Text

Type: string

Display text.

Must be at least 1 characters long

Additional Properties of any type are allowed.

Type: object

Actionable metadata

Type: object

Metadata to describe actions that are taken when a UI element is triggered (e.g., tapped, clicked, etc).

Same definition as actionable
Type: object

Location Request

Type: object

Location request primitive element.

No Additional Properties

Type

Type: const

The type of this element.

Specific value: "location_request"

Location Request Metadata

Type: object

Location request element metadata.

No Additional Properties

Text

Type: string

Prompt for the user when requesting for location.

Must be at least 1 characters long

Location Response

Type: object

Location request primitive element.

No Additional Properties

Type

Type: const

The type of this element.

Specific value: "location_response"

Location Response Metadata

Type: object

Location response element metadata.

No Additional Properties

Longitude

Type: number

Location longitude.

Name

Type: string

Name of the location.

Must be at least 1 characters long

Address

Type: string

Human-readable address of the location.

Must be at least 1 characters long

Container Types

Type: object

Container types wrap around other primitive types.

Quick Replies

Type: object

Quick replies container element.

No Additional Properties

Type

Type: const

The type of this element.

Specific value: "quick_replies"

Quick Replies

Type: array

Array of quick replys.

Must contain a minimum of 1 items

Must contain a maximum of 16 items

No Additional Items

Each item of this array must be:

Sections

Type: object

Sections are container types for up to at most 3 elements. These are most likely to be used for rich messages that include media, paragraphs, and actions.

No Additional Properties

Type

Type: const

The type of this element.

Specific value: "sections"

Sections

Type: array

An array of section elements.

Must contain a minimum of 1 items

Must contain a maximum of 5 items

No Additional Items

Each item of this array must be:


Paragraphs

Type: object

Paragraphs container element.

No Additional Properties

Type

Type: const

The type of this element.

Specific value: "paragraphs"

Favorite metadata

Type: object

When specified, the message / carousel item can be favorited on the frontend.

No Additional Properties

Title

Type: string

Title to show in the favorites menu.

Must be at least 1 characters long

URL

Type: string

URL to favorite item. This could be an internal botmd:// link or an external link.

Must be at least 1 characters long

Expires On

Type: stringFormat: date-time

This is used with botmd://hospital/jarvisQuery links using uids. If frontend decides to cache the content of this favorite message, it should be refreshed against the backend after the expiry.

Actions

Type: object

Actions container element.

No Additional Properties

Type

Type: const

The type of this element.

Specific value: "actions"

Actions

Type: array

An array of action elements.

Must contain a minimum of 1 items

Must contain a maximum of 8 items

No Additional Items

Each item of this array must be:

Favorite metadata

Type: object

When specified, the message / carousel item can be favorited on the frontend.

Same definition as favorite

Favorite metadata

Type: object

When specified, the message / carousel item can be favorited on the frontend.

Same definition as favorite

Paragraphs

Type: object

Paragraphs container element.

Same definition as Paragraphs

Actions

Type: object

Actions container element.

Same definition as Actions

Carousel

Type: object

Carousel container element.

No Additional Properties

Type

Type: const

The type of this element.

Specific value: "carousel"

Application Payload

Type: object

Application payload message.

No Additional Properties

Type

Type: const

The type of this element.

Specific value: "application_payload"

Application Payload Metadata

Type: object

Application payload element metadata.

No Additional Properties

Application

Type: string

Application origin of the data payload

Must be at least 1 characters long

Payload

Type: object or string

Arbitrary payload to be used by application. Can be any JSON object.

Additional Properties of any type are allowed.

Type: object

Email

Type: object

This is a high level representation of MIME emails.

No Additional Properties

Type

Type: const

The type of this element.

Specific value: "email"

Email Metadata

Type: object

Email element metadata.

Subject

Type: string

A short string identifying the topic of the message (RFC 2822).

Must be at least 1 characters long

Text

Type: string

The main body of the email in plain text.

HTML

Type: string

The main body of the email in HTML.

Must be at least 1 characters long

Attachments

Type: array

Attachments to the email.

Must contain a minimum of 1 items

No Additional Items

Each item of this array must be:

Attachment Metadata

Type: object

Attachment element metadata.

Same definition as attachment

WhatsApp Template

Type: object

A message type encapsulating the WhatsApp template syntax. It is currently used by MessageBird.

No Additional Properties

Type

Type: const

The type of this element.

Specific value: "whatsapp_template"

WhatsApp Template

Type: object

WhatsApp template element metadata.

No Additional Properties

Template Name

Type: string

WhatsApp template name to use for this message.

Must be at least 1 characters long

Namespace

Type: string

WhatsApp namespace associated with the WABA. Defaults to the provider settings namespace.

Must be at least 1 characters long

Fallback Text

Type: string

For non-WhatsApp capable providers, it will be sent as a text message containing this string.

Must be at least 1 characters long

Language code

Type: string

Language code of the template. Note that language policy of the template message will always be deterministic. Defaults to en.

Must be at least 1 characters long

Header Parameters

Type: array of object

Array of parameters in header component of the template message. Applies to media templates only.

No Additional Items

Each item of this array must be:

Type: object
No Additional Properties

Type

Type: enum (of string)

Type of header

Must be one of:

  • "image"
  • "document"
  • "video"

Image

Type: object

Image header.

URL

Type: string

URL to the image.

Must match regular expression: ^((https|s3|gs)\:\/\/|\$)

Video

Type: object

Video header.

The following properties are required:

  • url

URL

Type: string

URL to the videos.

Must match regular expression: ^((https|s3|gs)\:\/\/|\$)

Document

Type: object

Document attachment in media template.

URL

Type: string

URL to the document.

Must match regular expression: ^((https|s3|gs)\:\/\/|\$)

Caption

Type: string

Caption to accompany the document attachment.

Must be at least 1 characters long

Filename

Type: string

Filename of document attachment. If caption is not specified, filename will be used instead.

Must be at least 1 characters long

Body Parameters

Type: array of object

Array of parameters in body component of the template message. Applies to both text and media templates.

No Additional Items

Each item of this array must be:

Type: object
No Additional Properties

Type

Type: enum (of string)

Type of body.

Must be one of:

  • "text"

Default (Deprecated)

Type: string

Text to use in body parameter.

Button Parameters

Type: array of object

Array of parameters in button component of the template message. Note that dynamic CTA is a very new feature (as of 2021-09-24).

No Additional Items

Each item of this array must be:


No Additional Properties

URL

Type: string

Either the full URI or path to use for CTA button. Note that only the path, query, and fragment will be used.

Must be at least 1 characters long

Text (Legacy)

Type: string

Either the full URI or path to use for CTA button. Note that only the path, query, and fragment will be used.

Must be at least 1 characters long

Index

Type: enum (of integer)

Position index of the button. You can have up to 3 buttons using index values of 0 to 2. Defaults to 0.

Must be one of:

  • 0
  • 1
  • 2

Empty Message

Type: object

An empty message with no content whatsoever.

No Additional Properties

Type

Type: const

The type of this element.

Specific value: "empty"

Favorite metadata

Type: object

When specified, the message / carousel item can be favorited on the frontend.

Same definition as favorite

Message Provider Metadata

Type: object

Message.provider_metadata is used on Messages to provide additional context to the provider for delivery.

No Additional Properties

MessengerProvider

Type: object

Delivery metadata for MessengerProvider.

No Additional Properties

Message Tag

Type: enum (of string)

Use MESSAGE_TAG when sending this message. This is useful when sending messages outside of the 24 hour window. Do make sure that the tag corresponds to the actual content of the message. See Message Tags documentation for more details on what content is allowed by each tag.

Must be one of:

  • "CONFIRMED_EVENT_UPDATE"
  • "POST_PURCHASE_UPDATE"
  • "ACCOUNT_UPDATE"
  • "CUSTOMER_FEEDBACK"

ReplyTo

Type: object

This is the schema for the ReplyTo metadata representing replyee message information

No Additional Properties

Replyee Delivery UID

Type: null or string

The UID of the replyee delivery object. Used when replyee edits/deletes their message.

Replied on datetime

Type: stringFormat: date-time

Replied On datetime to track when we "copied" the replyee message (may be used to check if original message was edited post-reply)

Replyee name

Type: string

Name of replyee to render on Frontend

Must be at least 1 characters long

Message

Type: object

This is the schema for messages as described and proposed in the Ratatoskr: Data Models for Messages RFC.

Same definition as replyee_message