Message

Messages can be sent in message threads. There are three types of messages that can be sent from the EMR:

  • External Messages: External message are messages that can be viewed from both the EMR and patient portal (everyone on the message thread can see the message).
  • Text Messages: Text messages are messages that the patient can view on their phone in their native text messaging app.
  • Internal Notes: Internal notes can only be viewed on the EMR (patients can not see internal notes). Internal notes are useful when you want to discuss information about patients without the patient seeing it.
  • Pages: Pages are a way to notify organization members that they should check out a message thread ASAP.

Each external messages and internal notes can be one of four formats:

  • Regular text
  • Image
  • File
  • Video

The message model


Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the message.

  • Name
    object
    Type
    string
    Description

    Always 'message'.

  • Name
    type
    Type
    string
    Description

    Type of message.

    Possible values:
    inAppMessage
    textMessage
    internalNote
    page
  • Name
    thread
    Type
    string
    Description

    Message thread that this message belongs to.

  • Name
    mode
    Type
    string
    Description

    Only applies if message type is "inAppMessage" or "internalNote." Mode/format of the message.

    Possible values:
    text
    image
    file
    video
  • Name
    text
    Type
    string
    Description

    Only applies if 1) message type is "textMessage" OR 2) message type if "inAppMessage" and message mode is "text" OR 3) message type if "internalNote" and message mode is "text". Text contents of the message.

  • Name
    filename
    Type
    string
    Description

    Only applies if message mode is "file." Name of the file.

  • Name
    pagee
    Type
    string
    Description

    Only applies if message type is "page." Which organization member you are trying to page.

  • Name
    memo
    Type
    string
    Description

    Only applies if message type is "page." What message you want to send the pagee.

  • Name
    resolved
    Type
    boolean
    Description

    Only applies if message type is "page." Whether the page is resolved.

  • Name
    resolved_at
    Type
    number
    Description

    Only applies if message type is "page." What time the page was resolved.

  • Name
    created_by
    Type
    string
    Description

    Creator of the message.

  • Name
    created_at
    Type
    number
    Description

    Timestamp (in ISO 8601 format) of when the message was created.

Response

{
    "id": "msg_GHY5mso3NpQP90bNHhpp",
    "object": "message",
    "type": "inAppMessage",
    "thread": "thrd_kkF8SgJmcgaTmmziHoCv",
    "mode": "text",
    "text": "Can you take a look at this rash? Sending you a video now",
    "created_by": "user_Z1zXZKvqrpwxbznuW6lJ",
    "created_at": 1653798303000,
}


POST/v2/messages

Create a message

Creates a new message.

Required attributes

  • Name
    type
    Type
    string
    Description

    Type of message.

    Possible values:
    inAppMessage
    textMessage
    internalNote
    page
  • Name
    thread
    Type
    string
    Description

    Message thread that this message belongs to.

  • Name
    mode
    Type
    string
    Description

    Only applies if message type is "inAppMessage" or "internalNote." Mode/format of the message.

    Possible values:
    text
    image
    file
    video
  • Name
    text
    Type
    string
    Description

    Only applies if 1) message type is "textMessage" OR 2) message type if "inAppMessage" and message mode is "text" OR 3) message type if "internalNote" and message mode is "text". Text contents of the message.

  • Name
    filename
    Type
    string
    Description

    Only applies if message mode is "file." Name of the file.

  • Name
    pagee
    Type
    string
    Description

    Only applies if message type is "page." Which organization member you are trying to page.

  • Name
    memo
    Type
    string
    Description

    Only applies if message type is "page." What message you want to send the pagee.

Optional attributes

  • Name
    resolved
    Type
    boolean
    Description

    Only applies if message type is "page." Whether the page is resolved. By default, set to false.

  • Name
    resolved_at
    Type
    number
    Description

    Only applies if message type is "page" and "resolved" is true. What time the page was resolved.

Response

{
    "id": "msg_GHY5mso3NpQP90bNHhpp",
    "object": "message",
    "type": "inAppMessage",
    "thread": "thrd_kkF8SgJmcgaTmmziHoCv",
    "mode": "text",
    "text": "Can you take a look at this rash? Sending you a video now",
    "created_by": "user_Z1zXZKvqrpwxbznuW6lJ",
    "created_at": 1653798303000,
}


GET/v2/messages/:id

Retrieve a message

Retrieves the specified message.

Response


 {
   "id": "msg_GHY5mso3NpQP90bNHhpp",
   "object": "message",
   "type": "inAppMessage",
   "thread": "thrd_kkF8SgJmcgaTmmziHoCv",
   "mode": "text",
   "text": "Can you take a look at this rash? Sending you a video now",
   "created_by": "user_Z1zXZKvqrpwxbznuW6lJ",
   "created_at": 1653798303000,
 }


GET/v2/messages

List all messages

Returns a list of all messages.

Response

  {
    "object": "list",
    "data": [
    {
        "id": "msg_GHY5mso3NpQP90bNHhpp",
        "object": "message",
        "type": "inAppMessage",
        "thread": "thrd_kkF8SgJmcgaTmmziHoCv",
        "mode": "text",
        "text": "Can you take a look at this rash? Sending you a video now",
        "created_by": "user_Z1zXZKvqrpwxbznuW6lJ",
        "created_at": 1653798303000,
    },
  ]
}

DELETE/v2/messages/:id

Delete a message

Deletes the specified message.

Required attributes

    Optional attributes

      Response

      {
          "id": "msg_GHY5mso3NpQP90bNHhpp",
          "object": "message",
          "delete": true
      }