Messages

A message is a resource which can be either received or sent via an inbox. Messages are grouped by conversations.

A message can be either inbound (received) or outbound (sent). You can know if a message has been received or sent thanks to the boolean is_inbound.

Each message has a type depending on the channel it has been sent with:

TypeDescription
emailEmail message
tweetMessage from Twitter
tweet_dmDirect Message from Twitter
googleplayGooglePlay message
smsSMS message
whatsappWhatsApp message
smoochMessage from Smooch
facebookMessage from Facebook
intercomMessage from Intercom
callPhone call
customCustom Message
front_chatFront Chat message

📘

Twitter notice

In order to comply with Twitter's API Terms & Conditions, Twitter content is not distributed through Front API.

The fields blurb, body, text as well as recipients' handle are replaced by the string [REDACTED] for messages of type tweet or tweet_dm only.

For those messages, the payload includes the field metadata.external_id containing the ID of the original Tweet or Twitter Direct Message that can be used to fetch its content from the Twitter API directly.

Opening a message in Front

To open a message in Front you need to open the URL https://app.frontapp.com/open/{message_id}

Example Message Object (Type: Email)

{
  "_links": {
    "self": "https://api2.frontapp.com/messages/msg_55c8c149",
    "related": {
      "conversation": "https://api2.frontapp.com/conversations/cnv_55c8c149",
      "message_replied_to": "https://api2.frontapp.com/messages/msg_1ab23cd4"
    }
  },
  "id": "msg_55c8c149",
  "type": "email",
  "is_inbound": true,
  "is_draft": false,
  "created_at": 1453770984.123,
  "blurb": "Anything less than immortality is a...",
  "author": {
    "_links": {
      "self": "https://api2.frontapp.com/teammates/tea_55c8c149",
      "related": {
        "inboxes": "https://api2.frontapp.com/teammates/tea_55c8c149/inboxes",
        "conversations": "https://api2.frontapp.com/teammates/tea_55c8c149/conversations"
      }
    },
    "id": "tea_55c8c149",
    "email": "[email protected]",
    "username": "leela",
    "first_name": "Leela",
    "last_name": "Turanga",
    "is_admin": true,
    "is_available": true,
    "is_blocked": false
  },
  "recipients": [
    {
      "_links": {
        "related": {
          "contact": "https://api2.frontapp.com/contacts/crd_55c8c149"
        }
      },
      "handle": "[email protected]",
      "role": "to"
    }
  ],
  "body": "Anything less than immortality is a complete waste of time.",
  "text": "Anything less than immortality is a complete waste of time.",
  "attachments": [
    {
      "filename": "attachment.jpg",
      "url": "https://api2.frontapp.com/download/fil_55c8c149",
      "content_type": "image/jpeg",
      "size": 10000,
      "metadata": {
        "is_inline": true,
        "cid": "123456789"
      }
    }
  ],
  "metadata": {}
}

Example Message Object (Type: Chat)

{
    "_links": {
        "self": "https://sean-test-3-30.api.frontapp.com/messages/msg_18ia6pce",
        "related": {
            "conversation": "https://sean-test-3-30.api.frontapp.com/conversations/cnv_nyulbny",
            "message_seen": "https://sean-test-3-30.api.frontapp.com/messages/msg_18ia6pce/seen"
        }
    },
    "id": "msg_18ia6pce",
    "type": "front_chat",
    "is_inbound": true,
    "created_at": 1661471266.594,
    "blurb": "triple send!",
    "body": "<div>triple send!</div>",
    "text": "triple send!",
    "error_type": null,
    "version": null,
    "draft_mode": null,
    "metadata": {
        "chat_visitor_url": "http://0.0.0.0:8080/?fcsp=54e9d2f3900fe9ecbe057a97568bbdbe&pusher-key=a29c79de7a1a99077623&namespace=cmckee"
    },
    "author": null,
    "recipients": [
        {
            "_links": {
                "related": {
                    "contact": "https://sean-test-3-30.api.frontapp.com/contacts/crd_2kg0xla"
                }
            },
            "name": "Navy Nautilus",
            "handle": "3326f7d3-8e97-475d-8305-25815c3fc7f9",
            "role": "from"
        },
        {
            "_links": {
                "related": {
                    "contact": null
                }
            },
            "name": null,
            "handle": "5b9b1474ab2bc85b6ea6",
            "role": "to"
        }
    ],
    "attachments": [],
    "signature": null,
    "is_draft": false
}