Skip to content
Skip to main content
POST
/v3/grants/{grant_id}/drafts

Create a Draft

Creates a draft.

NYLAS API KEYACCESS TOKEN

Parameters

Path parameters

grant_id*string

ID of the grant to access. Use /me/ to refer to the grant associated with an access token.

Request body

Content-Type: application/json, multipart/form-data
bccarray<object>

The name/email address pairs of the recipients to be BCC'd.

Example: [{"email":"[email protected]","name":""}]
bodystring

The body of the draft, in HTML format.

Example: "Hi, Welcome to Nylas!"
ccarray<object>

The name/email address pairs of the recipients to be CC'd.

Example: [{"email":"[email protected]","name":""}]
tracking_optionsobject
attachmentsarray<object>

An array of file attachments to include in the draft. You can use either the application/json or multipart/form-data schema, depending on the size of the attachment.

The application/json schema is limited to 3MB, including the message body. The content must be Base64-encoded.

The multipart/form-data schema is limited by the provider to 25MB. See the Attachments references for more information.

fromarray<object>

An array that contains a single name and email address pair that Nylas sets as the from header. By default, Nylas uses the email address associated with the grant_id.

Nylas supports multiple from addresses for email aliases only.

Example: [{"email":"[email protected]","name":"Leyah Miller"}]
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.

Default: false
reply_toarray<object>

An array of name/email address pairs that should receive replies to the message. This is used to set an alternative Reply-To header in the sent message. Not all providers support setting this in a draft.

Example: [{"email":"[email protected]","name":""}]
reply_to_message_idstring

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

Example: "1t8tv3890q4vgmwq6pmdwm8qg"
starredboolean

If true, the draft is starred.

Example: false
subjectstring

The subject line of the draft.

Example: "Invitation: Welcome! @ Thu Oct 28, 2021 7am - 8am (EDT) - Toronto"
toarray<object>

The name/email address pairs of the recipients.

Example: [{"email":"[email protected]","name":""},{"email":"[email protected]","name":""}]
custom_headersarray<object>

An array of custom headers to add to the message.

metadataobject

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

templateobject

The template to use for the message. Can be overriden by the body and subject fields.

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: "sig_abc123"

Responses

request_idstring

The request ID.

dataobject

A draft of a message. You can edit a draft until you send it as a message.

POSThttps://api.us.nylas.com/v3/grants/{grant_id}/drafts

Find your API key in the Nylas Dashboard under API Keys in your application settings.

grant_idrequiredstring

ID of the grant to access. Use /me/ to refer to the grant associated with an access token.

Loading editor...

Autocomplete and validation come from this endpoint's request schema.