Drafts

A draft is a message which has not yet been sent to the recipient, and can be created as a new conversation or as a reply to an existing conversation. The drafts endpoints allow you to automate the creation of a message or a teammate or a group of teammates to review and edit before sending.

When a draft is created, it must be associated with a particular teammate and channel. By default, the draft will only be visible to the teammate you create it for, but you can use the mode parameter to share the conversation with any teammates who have access to the conversation.

If you are creating a draft in a new conversation and want to share it with multiple teammates, you can use the add conversation followers endpoint to invite other teammates to the draft after creating and sharing it.

Notes on Versioning

For editing and deleting drafts, a version value must be included in the request body in order to safely update the draft within Front.

The version value is a token which indicates that the content of the request is in context with a state of the draft at a point in time.

If the version value of the draft sent in the request and the version of the draft in Front do not match, then an HTTP error response code of 409/Conflict will be returned. This is a response with an indication that a new version of the draft is available.

To obtain the latest version of a draft in a conversation, using the message_id, perform a GET /messages/{message_id} request to retrieve information relating to the message. The version will be included if it is a draft.

Example Draft Object

{
  "_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,
  "draft_mode": "private",
  "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": {}
}