Skip to content
Skip to main content
POST
/v3/grants/{grant_id}/attachment-uploads

Create an attachment upload sessionBeta

Create a resumable upload session for a large attachment (up to 150 MB). Returns a pre-signed URL where you upload the file bytes directly using PUT.

Upload sessions expire one hour after creation. Once you upload the file to the returned URL, call the complete endpoint to finalize the upload. After completion, reference the attachment_id in a send or draft request.

Supported providers: Microsoft (Outlook / Exchange via Graph) only. Grants for Google, IMAP, Yahoo, iCloud, and EWS are rejected with a 401 Unauthorized error.

Required Microsoft scopes (at least one): Mail.Send, Mail.ReadWrite, or Mail.ReadWrite.Shared.

For the full flow, prerequisites, and error handling, see Send large attachments.

ACCESS TOKENNYLAS API KEY

Parameters

Path parameters

grant_id*string

The ID of the grant to create the upload session for.

Request body

Attachment upload session details.

filename*string

The name of the file as it will appear in the email. No allowlist or sanitization is applied.

Example: "quarterly-report.pdf"
content_type*string

The MIME type of the file (for example, application/pdf, image/png). No MIME allowlist is applied — any non-empty string is accepted and passed through to storage.

Example: "application/pdf"
sizeinteger<int64>

Expected file size in bytes. Recommended — when provided, Nylas validates that the uploaded object matches this size at completion. If omitted, the size-match check is skipped and any non-zero upload is accepted. Maximum: 157286400 (150 MB).

Example: 5242880

Responses

request_idstring

The request ID.

dataobject
POSThttps://api.us.nylas.com/v3/grants/{grant_id}/attachment-uploads

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

grant_idrequiredstring

The ID of the grant to create the upload session for.

Loading editor...

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