Message

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

  • In App Messages: In app 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. Pages can only be viewed on the the EMR (patients can not see pages).

In app messages and internal notes can be one of the following four formats:

  • 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:
    in_app_message
    text_message
    internal_note
    page
  • Name
    message_thread
    Type
    string
    Description

    Message thread that this message belongs to.

  • Name
    mode
    Type
    string
    Description

    Only applies if message type is "in_app_message" or "internal_note." Mode/format of the message.

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

    Only applies if 1) message type is "text_message" OR 2) message type if "in_app_message" and message mode is "text" OR 3) message type if "internal_note" 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
    date-time
    Description

    Only applies if message type is "page." Timestamp (in ISO 8601 format) of when the page was resolved.

  • Name
    created_by
    Type
    string
    Description

    Creator of the message.

  • Name
    created_at
    Type
    date-time
    Description

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

Response

{
    "id": "msg_GHY5mso3NpQP90bNHhpp",
    "object": "message",
    "type": "in_app_message",
    "message_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/message_threads/:id/messages

Create a message

Creates a new message.

Required attributes

  • Name
    type
    Type
    string
    Description

    Type of message.

    Possible values:
    in_app_message
    text_message
    internal_note
    page
  • Name
    message_thread
    Type
    string
    Description

    Message thread that this message belongs to.

  • Name
    mode
    Type
    string
    Description

    Only applies if message type is "in_app_message" or "internal_note." Mode/format of the message.

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

    Only applies if 1) message type is "text_message" OR 2) message type if "in_app_message" and message mode is "text" OR 3) message type if "internal_note" 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
    date-time
    Description

    Only applies if message type is "page" and "resolved" is true. Timestamp (in ISO 8601 format) of when the page was resolved.

Response

{
    "id": "msg_GHY5mso3NpQP90bNHhpp",
    "object": "message",
    "type": "in_app_message",
    "message_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": "2024-05-06T22:16:46.391Z",
}


GET/v2/message_threads/:id/messages/:item

Retrieve a message

Retrieves the specified message.

Response


 {
   "id": "msg_GHY5mso3NpQP90bNHhpp",
   "object": "message",
   "type": "in_app_message",
   "message_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": "2024-05-06T22:16:46.391Z",
 }


GET/v2/messages

List all messages

Returns a list of all messages.

Response

  {
    "object": "list",
    "data": [
    {
        "id": "msg_GHY5mso3NpQP90bNHhpp",
        "object": "message",
        "type": "in_app_message",
        "message_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": "2024-05-06T22:16:46.391Z",
    },
  ]
}

DELETE/v2/message_threads/:id/messages/:item

Delete a message

Deletes the specified message.

Required attributes

    Optional attributes

      Response

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