Let the platform do the work

/Emails/:record PUT

Overview

Update an existing Emails record.

Summary

Used for updating an archived email, updating a draft to send later, or sending a draft.

Updating an Archived Email

Request Arguments

Name Type Description Required
message_uid String Only use this field for updating emails imported from an IMAP server, as this is the email's IMAP UID. False
assigned_user_id String The assigned user's ID. False
parent_type String The parent record's module. False
parent_id String The parent record's ID. False
team_name List List of teams that can access the email. False
Request
{
  "assigned_user_id": "9c61c46a-a7c5-df71-481c-51d48232f820",
  "parent_type": "Leads",
  "parent_id": "f6a0611a-7d27-11e7-9d70-3c15c2d582c6",
  "team_name": [{
    "id": "1",
    "display_name": "Global",
    "name": "Global",
    "name_2": "",
    "primary": true,
    "selected": false
  }]
}
Response
{
  "id": "a028341c-ba92-9343-55e7-56cf5beda121",
  "date_entered": "2016-02-25T11:53:07-08:00",
  "created_by": "9c61c46a-a7c5-df71-481c-51d48232f820",
  "created_by_name": "Sarah Smith",
  "date_modified": "2016-02-25T11:53:07-08:00",
  "modified_by_name": "Sarah Smith",
  "modified_user_id": "9c61c46a-a7c5-df71-481c-51d48232f820",
  "deleted": false,
  "assigned_user_id": "9c61c46a-a7c5-df71-481c-51d48232f820",
  "assigned_user_name": "Sarah Smith",
  "state": "Archived",
  "name": "Re: Discuss Proposal",
  "description": "Now is a good time",
  "description_html": "<p>Now is a good time</p>",
  "date_sent": "2012-02-17T06:53:00-08:00",
  "message_id": "",
  "message_uid": "",
  "reply_to_status": false,
  "total_attachments": 1,
  "parent_name": "Tom Davis",
  "parent_type": "Leads",
  "parent_id": "f6a0611a-7d27-11e7-9d70-3c15c2d582c6"
  "team_count": "",
  "team_name": [{
    "id": 1,
    "name": "Global",
    "name_2": "",
    "primary": true,
    "selected": false
  }],
  "my_favorite": false,
  "_acl": {
    "fields": {}
  },
  "_module": "Emails"
}

Updating a Draft

Request Arguments

Name Type Description Required
outbound_email_id String The ID of the chosen SMTP configuration for sending an email. Only use this field when saving a draft or sending an email. The user's default SMTP configuration is used if one hasn't been chosen prior to sending. False
name String The email's subject. False
description_html String The email's HTML body. False
description String The email's plain text body. This field is not necessary unless the text body is different from the HTML body. False
reply_to_id String Only use this field when saving a draft or sending an email that is a reply to another email. This is the ID of that other email. False
parent_type String The parent record's module. False
parent_id String The parent record's ID. False
to Object The email's recipients found in the TO field. Existing EmailParticipants records cannot be used; only the create and delete actions are supported. Metadata about each recipient is required to link the records.
  • parent_type and parent_id can be Accounts, Contacts, Employees, Leads, Prospects, or Users, out out of the box. These fields are not necessary if only an email address is known for the recipient.
  • email_address_id is the ID of the email address the recipient used in the email. To get the ID of the email address, first make a request to /EmailAddresses POST. If this argument is not provided, then the primary email address of the parent record is used.
False
cc Object The email's recipients found in the CC field. Existing EmailParticipants records cannot be used; only the create and delete actions are supported. Metadata about each recipient is required to link the records.
  • parent_type and parent_id can be Accounts, Contacts, Employees, Leads, Prospects, or Users, out out of the box. These fields are not necessary if only an email address is known for the recipient.
  • email_address_id is the ID of the email address the recipient used in the email. To get the ID of the email address, first make a request to /EmailAddresses POST. If this argument is not provided, then the primary email address of the parent record is used.
False
bcc Object The email's recipients found in the BCC field. Existing EmailParticipants records cannot be used; only the create and delete actions are supported. Metadata about each recipient is required to link the records.
  • parent_type and parent_id can be Accounts, Contacts, Employees, Leads, Prospects, or Users, out out of the box. These fields are not necessary if only an email address is known for the recipient.
  • email_address_id is the ID of the email address the recipient used in the email. To get the ID of the email address, first make a request to /EmailAddresses POST. If this argument is not provided, then the primary email address of the parent record is used.
False
attachments Object The email's attachments. Existing Notes records cannot be used as email attachments; only the create and delete actions are supported. Metadata about each attachment is required to link the records.
  • filename_guid is the temporary file ID for an uploaded file to attach as a Notes record.
  • upload_id is the ID of an existing file that the Notes record should reference as the attachment. This allows files to be shared by multiple Notes records, to preserve space.
  • When using upload_id, file_source should be provided to indicate from where the file originated. The value should be the module of the record that shares its ID with the file. So when an attachment comes from an email template, file_source should be EmailTemplates. And when an attachment comes from a document, file_source should be DocumentRevisions.
False
Request
{
  "outbound_email_id": "b80adf1a-7d78-11e7-855a-3c15c2d582c6",
  "name": "Re: Discuss Proposal (new time)",
  "description_html": "<p>I will call you in 10 minutes.</p>",
  "parent_type": "Contacts",
  "parent_id": "79b9c194-7d79-11e7-8fc5-3c15c2d582c6",
  "to": {
    "create": [{
      "parent_type": "Contacts",
      "parent_id": "79b9c194-7d79-11e7-8fc5-3c15c2d582c6"
    }],
    "delete": [
      "ea1cec7e-7d27-11e7-9845-3c15c2d582c6"
    ]
  },
  "cc": {
    "delete": [
      "eafa7e9a-7d27-11e7-aa2b-3c15c2d582c6"
    ]
  },
  "attachments": {
    "create": [{
      "upload_id": "a028341c-ba92-9343-55e7-56cf5beda121",
      "name": "Contract.pdf",
      "filename": "Contract.pdf",
      "file_source": "DocumentRevisions"
    }],
    "delete": [
      "e087e79a-7d27-11e7-b02c-3c15c2d582c6"
    ]
  }
}
Response
{
  "id": "f3c85966-7d27-11e7-9e9e-3c15c2d582c6",
  "date_entered": "2016-02-25T11:53:07-08:00",
  "created_by": "9c61c46a-a7c5-df71-481c-51d48232f820",
  "created_by_name": "Sarah Smith",
  "date_modified": "2016-02-25T12:53:07-08:00",
  "modified_by_name": "Sarah Smith",
  "modified_user_id": "9c61c46a-a7c5-df71-481c-51d48232f820",
  "deleted": false,
  "assigned_user_id": "9c61c46a-a7c5-df71-481c-51d48232f820",
  "assigned_user_name": "Sarah Smith",
  "state": "Draft",
  "outbound_email_id": "b80adf1a-7d78-11e7-855a-3c15c2d582c6",
  "name": "Re: Discuss Proposal (new time)",
  "description": "I will call you in 10 minutes.",
  "description_html": "<p>I will call you in 10 minutes.</p>",
  "date_sent": "2012-02-17T12:53:07-08:00",
  "message_id": "",
  "message_uid": "",
  "reply_to_id": "a028341c-ba92-9343-55e7-56cf5beda121",
  "reply_to_status": false,
  "total_attachments": 1,
  "parent_name": "Jack Horner",
  "parent_type": "Contacts",
  "parent_id": "79b9c194-7d79-11e7-8fc5-3c15c2d582c6"
  "team_count": "",
  "team_name": [{
    "id": 1,
    "name": "Global",
    "name_2": "",
    "primary": true,
    "selected": false
  }],
  "my_favorite": false,
  "_acl": {
    "fields": {}
  },
  "_module": "Emails"
}

Sending an Email

Request Arguments

Name Type Description Required
state String Use "Ready" to send an email. True
outbound_email_id String The ID of the chosen SMTP configuration for sending an email. Only use this field when saving a draft or sending an email. The user's default SMTP configuration is used if one hasn't been chosen prior to sending. False
name String The email's subject. False
description_html String The email's HTML body. False
description String The email's plain text body. This field is not necessary unless the text body is different from the HTML body. False
reply_to_id String Only use this field when saving a draft or sending an email that is a reply to another email. This is the ID of that other email. False
parent_type String The parent record's module. False
parent_id String The parent record's ID. False
to Object The email's recipients found in the TO field. Existing EmailParticipants records cannot be used; only the create and delete actions are supported. Metadata about each recipient is required to link the records.
  • parent_type and parent_id can be Accounts, Contacts, Employees, Leads, Prospects, or Users, out out of the box. These fields are not necessary if only an email address is known for the recipient.
  • email_address_id is the ID of the email address the recipient used in the email. To get the ID of the email address, first make a request to /EmailAddresses POST. If this argument is not provided, then the primary email address of the parent record is used.
False
cc Object The email's recipients found in the CC field. Existing EmailParticipants records cannot be used; only the create and delete actions are supported. Metadata about each recipient is required to link the records.
  • parent_type and parent_id can be Accounts, Contacts, Employees, Leads, Prospects, or Users, out out of the box. These fields are not necessary if only an email address is known for the recipient.
  • email_address_id is the ID of the email address the recipient used in the email. To get the ID of the email address, first make a request to /EmailAddresses POST. If this argument is not provided, then the primary email address of the parent record is used.
False
bcc Object The email's recipients found in the BCC field. Existing EmailParticipants records cannot be used; only the create and delete actions are supported. Metadata about each recipient is required to link the records.
  • parent_type and parent_id can be Accounts, Contacts, Employees, Leads, Prospects, or Users, out out of the box. These fields are not necessary if only an email address is known for the recipient.
  • email_address_id is the ID of the email address the recipient used in the email. To get the ID of the email address, first make a request to /EmailAddresses POST. If this argument is not provided, then the primary email address of the parent record is used.
False
attachments Object The email's attachments. Existing Notes records cannot be used as email attachments; only the create and delete actions are supported. Metadata about each attachment is required to link the records.
  • filename_guid is the temporary file ID for an uploaded file to attach as a Notes record.
  • upload_id is the ID of an existing file that the Notes record should reference as the attachment. This allows files to be shared by multiple Notes records, to preserve space.
  • When using upload_id, file_source should be provided to indicate from where the file originated. The value should be the module of the record that shares its ID with the file. So when an attachment comes from an email template, file_source should be EmailTemplates. And when an attachment comes from a document, file_source should be DocumentRevisions.
False
Request
{
  "state": "Ready"
}
Response
{
  "id": "a7795664-7def-11e7-8add-3c15c2d582c6",
  "date_entered": "2016-02-25T08:53:07-08:00",
  "created_by": "9c61c46a-a7c5-df71-481c-51d48232f820",
  "created_by_name": "Sarah Smith",
  "date_modified": "2016-02-25T08:53:07-08:00",
  "modified_by_name": "Sarah Smith",
  "modified_user_id": "9c61c46a-a7c5-df71-481c-51d48232f820",
  "deleted": false,
  "assigned_user_id": "9c61c46a-a7c5-df71-481c-51d48232f820",
  "assigned_user_name": "Sarah Smith",
  "state": "Archived",
  "outbound_email_id": "b80adf1a-7d78-11e7-855a-3c15c2d582c6",
  "name": "Discuss Proposal",
  "description": "When is a good time for us to chat?",
  "description_html": "<p>When is a good time for us to chat?</p>",
  "date_sent": "2012-02-17T08:53:07-08:00",
  "message_id": "<a7795664-7def-11e7-8add-3c15c2d582c6@example.com>",
  "message_uid": "",
  "reply_to_id": "",
  "reply_to_status": false,
  "total_attachments": 2,
  "parent_name": "Tom Davis",
  "parent_type": "Leads",
  "parent_id": "f6a0611a-7d27-11e7-9d70-3c15c2d582c6"
  "team_count": "",
  "team_name": [{
    "id": 1,
    "name": "Global",
    "name_2": "",
    "primary": true,
    "selected": false
  }],
  "my_favorite": false,
  "_acl": {
    "fields": {}
  },
  "_module": "Emails"
}

Change Log

Version Change
v10 Added /Emails/:record PUT endpoint.