latestOpenAPI 3.1.02026-08-233001841.3 MB

0dcf3303e9d7

activities.emails

Create an Email activity

status must be one of the following:

  • inbox to log an already received email.
  • draft to create a draft email.
  • scheduled to send an email at a scheduled date and time, which must be specified in the date_scheduled field.
  • outbox to actually send an email. To delay email sending by a few seconds (to allow undo), specify send_in in seconds (must be less than 60).
  • sent to log an already sent email.

Only drafts can be modified, and their status can be changed to scheduled (to send later) or outbox (to send immediately). Scheduled emails, or emails in outbox that weren't sent yet can be canceled by setting the status back to draft.

For scheduled, outbox, or sent emails, a followup_date may be posted, which will have Close create an email followup task if no response was received.

We'll render an Email Template server-side if you include a template_id without including body_text or body_html in your POST.

To specify both a sender name and a sender email address when posting an email, you can use the sender field with the format "sender": ""John Smith" <emailaddress@example.com>"

The sender field is required for emails with status inbox, scheduled, outbox, or error. It may be omitted for draft (since the sender can be specified later before sending) and sent (where it defaults to the email address of the user associated with the email or the owner of the API key).

To include an attachment, you must first upload the file to Close using the Files API. Then, add an object to the attachments array with the following fields: url, filename, content_type, and size. The url should be the URL provided in the download.url field of the response from the Files API. It must begin https://app.close.com/go/file/.

post/activity/email/

Request body

activity_atstring date-time nullable
bccstring[] nullable
body_htmlstring nullable
body_textstring nullable
ccstring[] nullable
contact_idstring nullable
created_bystring nullable
date_createdstring date-time nullable
email_account_idstring nullable
followup_datestring date-time nullable
followup_sequence_add_cc_bccboolean nullable
followup_sequence_delayinteger nullable
followup_sequence_idstring nullable
in_reply_to_idstring nullable
lead_idstring required
organization_idstring nullable
senderstring email nullable
status'inbox' | 'draft' | 'scheduled' | 'outbox' | 'sent' | 'error' required
subjectstring nullable
template_idstring nullable
tostring[] nullable
user_idstring nullable

Response

Successful response

_typestring required
activity_atstring date-time nullable required
agent_action_reasonstring nullable
agent_config_idstring nullable
bccstring[] required
body_htmlstring nullable required
body_previewstring nullable
body_textstring nullable required
bulk_email_action_idstring nullable required
ccstring[] required
contact_idstring nullable required
created_bystring nullable required
created_by_namestring nullable
date_createdstring date-time required
date_scheduledstring date-time nullable required
date_sentstring date-time nullable required
date_updatedstring date-time required
direction'incoming' | 'outgoing' required

Direction of communication. Outgoing means the communication flowing from the user to the lead/contact. Inbound means the opposite.

email_account_idstring nullable
envelopeobject nullable
followup_sequence_add_cc_bccboolean required
followup_sequence_delayinteger nullable required
followup_sequence_idstring nullable
has_replyboolean required
idstring required
in_reply_to_idstring nullable required
lead_idstring nullable required
message_idsstring[] required
need_smtp_credentialsboolean required
opens_summarystring nullable required
organization_idstring required
referencesstring[] required
send_as_idstring nullable required
send_attemptsobject[] nullable
senderstring nullable required
sequence_idstring nullable
sequence_namestring nullable
sequence_subscription_idstring nullable
status'inbox' | 'draft' | 'scheduled' | 'outbox' | 'sent' | 'error' required

Status of a message, such as Email or SMS.

subjectstring nullable required
template_idstring nullable required
template_namestring nullable
thread_idstring nullable required
tostring[] required
updated_bystring nullable required
updated_by_namestring nullable
user_idstring nullable required
user_namestring nullable
usersstring[] required