Drafts

Create a Draft

Creates a draft.

If you provide tracking_options.domain_name, Nylas validates the custom hostname and stores its canonical value with the draft's link click and message open tracking settings. If you omit the field, Nylas uses its regional tracking hostname when it creates tracking URLs.

post/v3/grants/{grant_id}/drafts

Request body

bodystring

The body of the draft, in HTML format.

is_plaintextboolean

When true, the message body is sent as plain text and the MIME data doesn't include the HTML version of the message. When false, the message body is sent as HTML.

reply_to_message_idstring

The unique identifier of the message to which you want to draft a reply.

starredboolean

If true, the draft is starred.

subjectstring

The subject line of the draft.

metadataMetadata

The metadata associated with the object. For more information, see Metadata.

signature_idstring

The ID of a signature to append to the draft body. Nylas inserts the signature after a line break at the end of the body. Only one signature can be used per draft.

Example request

{
  "bcc": [
    {
      "email": "brandon.carson@example.com",
      "name": ""
    }
  ],
  "body": "Hi, Welcome to Nylas!",
  "cc": [
    {
      "email": "clivescounters@example.com",
      "name": ""
    }
  ],
  "tracking_options": {
    "domain_name": "tracking.example.com"
  },
  "attachments": [
    {
      "content_disposition": "inline; filename=\"some-image.jpeg\""
    }
  ],
  "from": [
    {
      "email": "leyah@example.com",
      "name": "Leyah Miller"
    }
  ],
  "reply_to": [
    {
      "email": "healthcare.demo@example.com",
      "name": ""
    }
  ],
  "reply_to_message_id": "1t8tv3890q4vgmwq6pmdwm8qg",
  "subject": "Invitation: Welcome! @ Thu Oct 28, 2021 7am - 8am (EDT) - Toronto",
  "to": [
    {
      "email": "demo@example.com",
      "name": ""
    },
    {
      "email": "realestate.demo@example.com",
      "name": ""
    }
  ],
  "template": {
    "id": "b79c82b2-a51b-4c54-8469-28006a43551a",
    "strict": true,
    "variables": {
      "user": {
        "name": "Leyah",
        "surname": "Miller"
      }
    }
  },
  "signature_id": "sig_abc123"
}

Response

Draft

request_idstring

The request ID.

Example response

{
  "request_id": "5fa64c92-e840-4357-86b9-2aa364d35b88"
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.