Create an Email activity
Create an email activity. Depending on status, this logs an email that was sent or received outside Close, saves a draft, or sends the email from one of the user’s connected email accounts:
inboxlogs an email that was received.sentlogs an email that was already sent.draftsaves a draft. You can edit it and send it later with PUT.outboxsends the email right away. To leave time to undo, setsend_into delay sending by up to 60 seconds.scheduledsends the email atdate_scheduled.errorlogs an email that failed to send.
sender is required for every status except draft and sent. For sent, it defaults to the email address of the email’s user. It takes a plain address like john@example.com, or a name and address like "John Smith" <john@example.com>. To send an email, to must contain at least one valid email address.
If you include template_id without body_text or body_html, Close renders the email template for the lead and contact_id, which is then required.
For scheduled, outbox or sent emails, followup_date creates a follow-up task for that date if the lead doesn’t reply.
To include an attachment, first upload the file with the Files API. Then add an object to the attachments array with url, filename, content_type and size. url is the download.url field of the Files API response and must start with https://app.close.com/go/file/.
Returns 400 if validation fails, or if date_scheduled or followup_date is set and your plan doesn’t include scheduled sending or follow-up reminders.
Authentication
Bearer authentication of the form Bearer <token>, where token is your auth token.
Query parameters
Comma-separated list of fields to include in the response.
Request
Status of the email. Set outbox to send it now, scheduled to send it at date_scheduled, draft to save a draft, or inbox, sent or error to log an email sent or received elsewhere. Only draft, scheduled, outbox and error emails can change status, and only to draft, scheduled or outbox.
When the email happened. Defaults to date_created, and is set to the send time when Close sends the email.
Files to attach. Upload each file with the Files API first, then pass its download.url as url.
Email addresses of the Bcc recipients.
HTML body. If you send only one of body_text and body_html, Close generates the other.
Plain-text body. If you send only one of body_text and body_html, Close generates the other.
Email addresses of the Cc recipients.
When to send the message. Required when status is scheduled, and ignored otherwise.
ID of the connected email account to send the email from, prefixed with emailacct_. If you leave it out for a draft or an email you send, Close picks the user’s account that matches sender.
Date to create a follow-up task on if the lead doesn’t reply. Only used when status is scheduled, outbox or sent, and can’t be before the email is sent.
Whether to also add the cc and bcc recipients to the followup_sequence_id workflow. Requires followup_sequence_id.
Seconds to wait after the email is sent before the first step of the followup_sequence_id workflow. At least 86,400 (one day). Required with followup_sequence_id.
ID of a workflow to subscribe the recipients to after the email is sent, prefixed with seq_. Required with followup_sequence_delay.
ID of the email activity this email replies to. Close sets the In-Reply-To and References headers from it.
Opens to record. Only allowed when status is sent.
Seconds to delay sending, to allow undo. Only used when status is outbox.
Sender of the email, either a plain address like john@example.com or a name and address like "John Smith" <john@example.com>. Required unless status is draft or sent. For sent, it defaults to the address of the email’s user.
ID of the email template to use, prefixed with tmpl_. On create, if you leave out body_text and body_html, Close renders the template for contact_id, which is then required, and fills in subject, cc, bcc and attachments you leave empty.
Email addresses of the To recipients. At least one valid address is required to send the email.
Response
Type of the activity, e.g. Call, Email or Note.
When the activity happened, e.g. when an Email or SMS was sent. Defaults to date_created.
Email addresses of the Bcc recipients.
Plain-text body of the email.
ID of the bulk email action that sent the email, or null if it wasn’t sent in bulk.
Email addresses of the Cc recipients.
ID of the Contact the activity is with, or null if it isn’t with a particular Contact.
ID of the user who created the activity, or null if it wasn’t created by a user.
When the email is scheduled to be sent, or null if it isn’t scheduled.
When the email was sent, or null if it hasn’t been sent.
Whether the email was sent to the lead (outgoing) or received from the lead (incoming).
Whether the email’s cc and bcc recipients are also added to the followup_sequence_id workflow.
Seconds to wait after the email is sent before the first step of the followup_sequence_id workflow, or null.
ID of the activity, e.g. acti_abc123.
ID of the email activity this email replies to, or null.
ID of the Lead the activity is on. Can be null for Calls and SMS with phone numbers that don’t match any Contact.
Message-ID header values of the email.
Always false. Kept for backward compatibility.
Human-readable summary of opens, e.g. Opened by karen@example.com (2 times, latest 2024-01-31). null if the email hasn’t been opened.
Message IDs of the earlier emails this email refers to, oldest first, from its References and In-Reply-To headers.
ID of the user the email is sent on behalf of, when it’s sent as another user. null otherwise.
Sender of the email, either a plain address like john@example.com or a name and address like "John Smith" <john@example.com>. null if a draft has no sender yet.
Status of the email, e.g. draft, scheduled or sent.
ID of the email template the email was written from, prefixed with tmpl_, or null.
ID of the email thread activity the email belongs to, prefixed with acti_.
Email addresses of the To recipients.
ID of the user who last updated the activity, or null if it wasn’t updated by a user.
ID of the user the activity belongs to, e.g. who made the Call or sent the Email. Can be null, e.g. for an incoming SMS to a group number.
Why an agent created the activity (send_scheduling_link, custom_agent_decision or voice_agent_callback), or null if no agent created it.
AI-generated draft of a follow-up to this email, prepared for the user making the request. null if there is none, or once it’s been used or discarded.
body_html split into new content and HTML quoted from earlier messages. null if there is no HTML body.
First 200 characters of the body, as plain text. null if the email has no body.
body_text split into new content and text quoted from earlier messages. null if there is no plain-text body.
ID of the agent that created the activity, e.g. agentconfig_abc123, or null if no agent created it.
Name of the user in created_by.
ID of the connected email account the email was sent from or received in, prefixed with emailacct_. null if there is none or the account was deleted.
Headers of the email: the original ones for synced emails, or ones Close generates for emails created in Close. Has date, subject, in_reply_to, message_id, is_autoreply, and from, sender, reply_to, to, cc and bcc as lists of {email, name} objects. null if the email has none.
ID of the workflow the recipients are subscribed to after the email is sent, prefixed with seq_, or null.
ID of the Workflow that created the activity, e.g. seq_abc123, or null.
Name of the Workflow in sequence_id.
ID of the Workflow Run, i.e. the Contact’s enrollment in the Workflow, that created the activity, e.g. sub_abc123, or null.
Name of the email template in template_id. Kept after the template is deleted.
Name of the user in updated_by.
Name of the user in user_id.
Deprecated. Use created_by_agent_id instead.