Skip to content
Skip to main content
PUT
/v3/grants/{grant_id}/drafts/{draft_id}

Update a draft

Updates the specified draft.

When you make a PUT request, Nylas replaces all data in the nested object with the information included in your request. For more information, see Updating objects.

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.

draft_id*string

ID of the draft to access. Nylas recommends you URL-encode this field, or you might receive a 404 error if the ID contains special characters (for example, #).

Query parameters

selectstring

Specify fields that you want Nylas to return, as a comma-separated list (for example, select=id,updated_at). This allows you to receive only the portion of object data that you're interested in. You can use select to optimize response size and reduce latency by limiting queries to only the information that you need.

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":""}]
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 attachment size. The application/json format is limited to 3MB including the message body, and the content must be Base64 encoded. The multipart/form-data format size is limited by the provider to 25MB. See Attachments for more information.

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":""}]
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":""}]
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.

Responses

request_idstring

The request ID.

dataobject

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

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

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.

draft_idrequiredstring

ID of the draft to access. Nylas recommends you URL-encode this field, or you might receive a `404` error if the ID contains special characters (for example, #).

selectstring

Specify fields that you want Nylas to return, as a comma-separated list (for example, select=id,updated_at). This allows you to receive only the portion of object data that you're interested in. You can use select to optimize response size and reduce latency by limiting queries to only the information that you need.

Loading editor...

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