Conversations

The conversations endpoints are an interface for our real-time patient messaging feature. Within a location, all SMS interactions with a patient are grouped into a single conversation record. This means any staff member can view and reply to a patient's past messages.

Starting a Conversation

To send a patient an SMS as the practice, you need to perform a POST request to /conversations. If a prior conversation exists, your message will be added to it accordingly. If no prior conversation exists, a new one will be created.

Each message must have a valid user as the sender. In the case a message is created via API, this sender must be a staff member of the location you are working with. You can either set this manually by providing an assigned_user_id parameter or the first valid staff member at the location will be chosen by default. From the patient's perspective the SMS message comes from the practice itself, while on the NexHealth dashboard UI the sender's name will be displayed next to the message in the conversation.

🚧

Message Size Limit

SMS message bodies are limited to under 1500 characters.

Conversations Response Object

{
  "code": false,
  "description": [
    [
      "Description"
    ]
  ],
  "error": [
    [
      "Error"
    ]
  ],
  "data": {
    "conversation": {
      "id": 19,
      "created_at": "2020-06-05T20:16:57.007Z",
      "updated_at": "2020-06-05T20:16:57.007Z",
      "conversation_participants": [
        {
          "id": 415,
          "email": "[email protected]",
          "first_name": "John",
          "middle_name": "Anthony",
          "last_name": "Smith",
          "name": "John Smith",
          "display_name": "John Smith",
          "doctor_name": "Dr. John Smith",
          "meta_type": "Dentist",
          "created_at": "2020-06-05T20:16:57.007Z",
          "updated_at": "2020-06-05T20:16:57.007Z",
          "profile_url": "https://storage.googleapis.com/nexassets/app/img/icon/avatar.svg",
          "foreign_id": 0,
          "foreign_id_type": "--DataSource-",
          "npi": "string",
          "inst_ids": [
            [
              1,
              2
            ]
          ],
          "bio": {
            "phone_number": "5163042196",
            "date_of_birth": "1964-05-03"
          },
          "unsubscribe_emails": true,
          "inactive": false,
          "last_sync": true,
          "last_sync_time": "string",
          "unsubscribe_sms": true
        }
      ]
    },
    "messages": [
      {
        "id": 162,
        "body": "Sms body as a string",
        "created_at": "2020-06-05T20:16:57.007Z",
        "updated_at": "2020-06-05T20:16:57.007Z",
        "conversation_id": 19,
        "seen_by": [
          [
            ""
          ]
        ],
        "user_id": 414,
        "attachment_file_name": "string",
        "attachment_content_type": "string",
        "attachment_file_size": 0,
        "attachment_updated_at": "string",
        "sms_msg_id": 0,
        "sender_info": {
          "name": "Adam Afflick",
          "image": "https://storage.googleapis.com/nexassets/app/img/icon/avatar.svg",
          "meta_type": "Staff",
          "user_id": "414"
        },
        "attachment_url": "string",
        "is_custom_reminder_response": true,
        "created_at_with_tz": "2020-06-05T20:16:57.007Z",
        "timezone_offset": "-4:00"
      }
    ]
  },
  "count": 2
}