Skip to content
Skip to main content
PUT
/v3/grants/{grant_id}/messages/clean

Clean messages

Removes extra information from structured messages.

Note: Nylas removes all extra information, such as <script> and <style> tags, regardless of the configuration.

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.

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.

shared_fromstring

(Microsoft only) When provided, Nylas returns items that were shared from the specified email address. It also accepts grant ID. This parameter only accepts single email address or grant ID. Check out the Shared folders guide for more information.

Request body

message_idarray<string>

An array of IDs for the messages Nylas will clean.

Example: ["18df98cadcc8534a"]
maxItems: 20
ignore_imagesboolean

If true, removes images from the message.

Default: true
Example: true
images_as_markdownboolean

If true, converts images in the message to Markdown. Can't be false when html_as_markdown is true.

Default: true
Example: true
ignore_tablesboolean

If true, removes table-related tags (<table>, <th>, <td>, <tr>) from the message while keeping rows.

Default: true
Example: true
remove_conclusion_phrasesboolean

If true, removes phrases such as "Best" and "Regards" from the message signature.

Default: true
Example: true
html_as_markdownboolean

This property is in beta. If true, converts the message to Markdown. Can't be true when images_as_markdown is false.

Default: false
Example: false

Responses

request_idstring

The request ID.

dataarray<object>
PUThttps://api.us.nylas.com/v3/grants/{grant_id}/messages/clean

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.

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.

shared_fromstring

(Microsoft only) When provided, Nylas returns items that were shared from the specified email address. It also accepts grant ID. This parameter only accepts single email address or grant ID. Check out the Shared folders guide for more information.

Loading editor...

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