https://api.us.nylas.com/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.
For tracking settings, an explicit tracking_options.domain_name replaces the draft's previous
custom tracking hostname after validation. If you omit domain_name while updating other tracking
options, the draft inherits its existing custom hostname. Disabling both links and opens clears
the stored hostname. If you enable either option again without a hostname, Nylas uses its regional
tracking hostname.
Path parameters
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
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.
domain_nameThe custom hostname to use for link click and message open tracking. The hostname must be registered to the authenticated organization in the Nylas Dashboard and have an active certificate.
Custom tracking hostnames are available on select plans. Contact your Nylas account representative or the Nylas Sales team to enable this feature for your organization.
Nylas trims surrounding whitespace, removes one trailing dot, and converts ASCII letters to lowercase before looking up the hostname. Provide an ASCII fully qualified hostname without a URL scheme, path, port, or wildcard.
You must enable links, opens, or both when you provide this field. A custom tracking hostname
does not support thread_replies by itself. If you omit this field, Nylas uses its regional
tracking hostname. Invalid, inactive, blocked, deleted, and unowned hostnames return the same
generic 400 response. If Nylas cannot complete the explicit ownership and certificate lookup, it
returns a 5xx response without falling back to a Nylas hostname.
attachmentsAn 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.
content_typeThe MIME type of the attachment, used by the email client to determine how to display the attachment. If you don't provide a type, Nylas infers it from the file name.