Drafts

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.

put/v3/grants/{grant_id}/drafts/{draft_id}

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

bodystring

The body of the draft, in HTML format.

starredboolean

If true, the draft is starred.

subjectstring

The subject line of the draft.

metadataMetadata

The metadata associated with the object. For more information, see Metadata.

Example request

{
  "bcc": [
    {
      "email": "brandon.carson@example.com",
      "name": ""
    }
  ],
  "body": "Hi, Welcome to Nylas!",
  "cc": [
    {
      "email": "clivescounters@example.com",
      "name": ""
    }
  ],
  "tracking_options": {
    "domain_name": "tracking.example.com"
  },
  "attachments": [
    {
      "content_disposition": "inline; filename=\"some-image.jpeg\""
    }
  ],
  "reply_to": [
    {
      "email": "healthcare.demo@example.com",
      "name": ""
    }
  ],
  "subject": "Invitation: Welcome! @ Thu Oct 28, 2021 7am - 8am (EDT) - Toronto",
  "to": [
    {
      "email": "demo@example.com",
      "name": ""
    },
    {
      "email": "realestate.demo@example.com",
      "name": ""
    }
  ],
  "template": {
    "id": "b79c82b2-a51b-4c54-8469-28006a43551a",
    "strict": true,
    "variables": {
      "user": {
        "name": "Leyah",
        "surname": "Miller"
      }
    }
  }
}

Response

Draft

request_idstring

The request ID.

Example response

{
  "request_id": "5fa64c92-e840-4357-86b9-2aa364d35b88"
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.