Skip to content
Skip to main content
DELETE
/v3/grants/{grant_id}/messages/{message_id}

Delete a message

Deletes the specified message. If hard_delete is not defined or is false, Nylas moves the message to the user's Trash folder.

NYLAS API KEYACCESS TOKEN

Parameters

Path parameters

grant_id*string

ID of the grant to access. You can also use the email address associated with the grant, or use /me/ to refer to the grant associated with an access token.

message_id*string

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

Query parameters

hard_deleteboolean

When true, Nylas immediately deletes the specified message instead of sending it to the user's Trash folder. This operation is irreversible.

To use this query parameter, you need to turn on "Enable hard delete" in the Nylas Dashboard under Customizations > API.

Default: false
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.

Responses

request_id*string

ID of the request.

Example: "5967ca40-a2d8-4ee0-a0e0-6f18ace39a90"
DELETEhttps://api.us.nylas.com/v3/grants/nyla%40example.com/messages/{message_id}?hard_delete=false

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

grant_idrequiredstring

ID of the grant to access. You can also use the email address associated with the grant, or use /me/ to refer to the grant associated with an access token.

message_idrequiredstring

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

hard_deleteboolean

When true, Nylas immediately deletes the specified message instead of sending it to the user's Trash folder. This operation is irreversible. To use this query parameter, you need to turn on "Enable hard delete" in the Nylas Dashboard under Customizations > API.

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.