For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
HomepageProduct HelpLog inTry for Free
Developers HomeAPI ReferenceMCP
Developers HomeAPI ReferenceMCP
  • Getting Started
    • Introduction
    • Authentication with API Keys
    • Authentication with OAuth
    • API Clients
    • Pagination
    • Specifying Fields
    • Filter Parameters
    • HTTP Response Codes
    • Rate Limits
    • Timezone Offsets
    • Rich Text Fields
    • Changelog
  • CRM Core
    • Leads
    • Contacts
    • Opportunities
    • Tasks
    • Files
    • Custom Objects
    • Comments
  • Activities
    • Activities
    • Notes
    • Calls
    • Emails
      • GETList or filter all Email activities
      • POSTCreate an Email activity
      • GETGet a single Email activity
      • PUTUpdate an Email activity
      • DELDelete an Email activity
    • Email Threads
    • WhatsApp Messages
    • Meetings
    • Custom Activities
    • Creations
    • Form Submissions
    • Lead Status Changes
    • Opportunity Status Changes
    • Lead Merges
    • Task Completions
  • Events & Webhooks
    • Webhooks
    • Events
  • Search & Reporting
    • Advanced Filtering
    • Smart Views
    • Reporting
  • Automation & Bulk Actions
    • Sequences (Workflows)
    • Bulk Actions
    • Exports
    • AI Field Enrichment
  • CRM Configuration
    • Custom Fields
    • Custom Activity Types
    • Custom Object Types
    • Pipelines
    • Opportunity Statuses
    • Lead Statuses
    • Integration Links
    • Forms
  • Communication Configuration
    • Email Templates
    • SMS Templates
    • Outcomes
    • Playbooks
    • Scheduling Links Guide
    • Scheduling Links
    • Connected Accounts
    • Send As
    • Unsubscribed Emails
    • Phone Numbers
    • Blocked Phone Numbers
    • Dialers
  • Users & Organizations
    • Users
    • Organizations
    • Memberships
    • Roles
    • Groups
Close

Product

OverviewCommunicationAutomationIntegrationsReportingSMSCallingSecurityForms

Pricing & Use Cases

PricingClose vs Other CRMsCustomer Stories

Resources

Sales BlogSales ResourcesSales GuidesWebinarsOn-Demand DemoSales Tools

Company

AboutCareersPartner with CloseBrand GuidelinesTermsPrivacyGDPRCCPA

Get Help

+1-833-GO-CLOSEHelp CenterDownload the Close AppProduct UpdatesSystem Status
LogoLogo
HomepageProduct HelpLog inTry for Free
ActivitiesEmails

Create an Email activity

||View as Markdown|
POST
https://api.close.com/api/v1/activity/email/
POST
/api/v1/activity/email/
$curl -X POST https://api.close.com/api/v1/activity/email/ \
> -H "Content-Type: application/json" \
> -u "<CLOSE_API_KEY>:" \
> -d '{
> "lead_id": "lead_KwD00BYbXCHiPWj68LxFkxaeWuULpZ7awzm6LqeFs0h",
> "status": "draft",
> "attachments": [
> {
> "filename": "image.jpg",
> "size": 1108447,
> "url": "https://app.close.com/go/file/temporary/user_Ova4RGFG7pztSeJiiMFdN7O2MFl71nD0uGO3bIOo4Wk/1Zx0AlY1DwBXzKKrVwpAoj/image.jpg/",
> "content_type": "image/jpeg"
> }
> ],
> "bcc": [],
> "body_html": "Hi! My name is Karan and I'\''m your Account Manager. I'\''m here to get your team set up and help with anything you may need as you evaluate our platform. Please don'\''t hesitate to reach out to me with any questions!",
> "body_text": "Hi! My name is Karan and I'\''m your Account Manager. I'\''m here to get your team set up and help with anything you may need as you evaluate our platform. Please don'\''t hesitate to reach out to me with any questions!",
> "cc": [],
> "contact_id": "cont_8NNOJnVwmHQEYuVOgJ4B4zU7g9RUxYH4JnPjza5Vr6t",
> "created_by": null,
> "date_created": "2013-02-01T00:54:51.274000+00:00",
> "email_account_id": "emailacct_nuALjWGi09rlr36zXp0ygjja9De0mzPqyqPPVsriTzt",
> "sender": "karan@close.com",
> "subject": "Welcome to Close!",
> "template_id": null,
> "to": [
> "phil+sample@close.com"
> ],
> "user_id": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA"
>}'
1{
2 "_type": "Email",
3 "activity_at": "2015-06-26T02:01:43.059265",
4 "bcc": [],
5 "body_html": "Hi! My name is Karan and I'm your Account Manager. I'm here to get your team set up and help with anything you may need as you evaluate our platform. Please don't hesitate to reach out to me with any questions!",
6 "body_text": "Hi! My name is Karan and I'm your Account Manager. I'm here to get your team set up and help with anything you may need as you evaluate our platform. Please don't hesitate to reach out to me with any questions!",
7 "bulk_email_action_id": null,
8 "cc": [],
9 "contact_id": "cont_8NNOJnVwmHQEYuVOgJ4B4zU7g9RUxYH4JnPjza5Vr6t",
10 "created_by": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA",
11 "date_created": "2015-06-26T02:01:43.059265",
12 "date_scheduled": null,
13 "date_sent": null,
14 "date_updated": "2015-06-26T02:01:43.101910",
15 "direction": "outgoing",
16 "followup_sequence_add_cc_bcc": false,
17 "followup_sequence_delay": null,
18 "has_reply": false,
19 "id": "acti_EdpqkmtlQHIDWE2CixJo606BapX34SpYV3fzHryGPc3",
20 "in_reply_to_id": null,
21 "lead_id": "lead_KwD00BYbXCHiPWj68LxFkxaeWuULpZ7awzm6LqeFs0h",
22 "message_ids": [],
23 "need_smtp_credentials": false,
24 "opens_summary": null,
25 "organization_id": "orga_RbREgmiiwcr1w2b4cOnCMQaQPSIFxMqAD2Dh243uxcH",
26 "references": [],
27 "send_as_id": null,
28 "sender": "karan@close.com",
29 "status": "draft",
30 "subject": "Welcome to Close!",
31 "template_id": null,
32 "thread_id": "acti_3VFfJMUKvwvQPXAbXAbs9b01usbFC5acL8MrmFcsmK5",
33 "to": [
34 "phil+sample@gclose.com"
35 ],
36 "updated_by": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA",
37 "user_id": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA",
38 "users": [],
39 "attachments": [
40 {
41 "content_type": "image/jpeg",
42 "filename": "image.jpg",
43 "size": 1108447,
44 "url": "https://app.close.com/go/file/persisted/orga_RbREgmiiwcr1w2b4cOnCMQaQPSIFxMqAD2Dh243uxcH/activity.email/acti_EdpqkmtlQHIDWE2CixJo606BapX34SpYV3fzHryGPc3/1Zx0AlY1DwBXzKKrVwpAoj/image.jpg/",
45 "content_id": null,
46 "inline_only": false
47 }
48 ],
49 "body_preview": "Hi! My name is Karan and I'm your Account Manager. I'm here to get your team set up and help with anything you may need as you evaluate our platform. Please don't hesitate to reach out to me with any ",
50 "created_by_name": "Steve Wiseman",
51 "email_account_id": "emailacct_nuALjWGi09rlr36zXp0ygjja9De0mzPqyqPPVsriTzt",
52 "envelope": {},
53 "opens": [],
54 "send_attempts": [],
55 "sequence_id": null,
56 "sequence_name": null,
57 "sequence_subscription_id": null,
58 "template_name": null,
59 "updated_by_name": "Steve Wiseman",
60 "user_name": "Steve Wiseman",
61 "body_html_quoted": {
62 "expand": true,
63 "html": "Hi! My name is Karan and I'm your Account Manager. I'm here to get your team set up and help with anything you may need as you evaluate our platform. Please don't hesitate to reach out to me with any questions!"
64 },
65 "body_text_quoted": null
66}
*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](https://developer.close.com/api/resources/files). 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](https://developer.close.com/api/resources/files). It must begin `https://app.close.com/go/file/`.
Was this page helpful?
Previous

List or filter all Email activities

Next

Get a single Email activity

Built with

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/.

Authentication

AuthorizationBasic
Use your API key as the username and leave the password empty.
OR
AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
lead_idstringRequired
statusenumRequired
activity_atdatetime or nullOptional
attachmentslist of objects or nullOptional
bcclist of strings or nullOptional
body_htmlstring or nullOptional<=1048576 characters
body_textstring or nullOptional<=1048576 characters
cclist of strings or nullOptional
contact_idstring or nullOptional
created_bystring or nullOptional
date_createddatetime or nullOptional
email_account_idstring or nullOptional
followup_datedatetime or nullOptional
followup_sequence_add_cc_bccboolean or nullOptional
followup_sequence_delayinteger or nullOptional>=86400
followup_sequence_idstring or nullOptional
in_reply_to_idstring or nullOptional
openslist of objects or nullOptional
organization_idstring or nullOptional
senderstring or nullOptionalformat: "email"
subjectstring or nullOptional<=1000 characters
template_idstring or nullOptional
tolist of strings or nullOptional
user_idstring or nullOptional

Response

Successful response
_typestring
activity_atdatetime or null
bcclist of strings
body_htmlstring or null
body_textstring or null
bulk_email_action_idstring or null
cclist of strings
contact_idstring or null
created_bystring or null
date_createddatetime
date_scheduleddatetime or null
date_sentdatetime or null
date_updateddatetime
directionenum or null

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

Allowed values:
followup_sequence_add_cc_bccboolean
followup_sequence_delayinteger or null
has_replyboolean
idstring
in_reply_to_idstring or null
lead_idstring or null
message_idslist of strings
need_smtp_credentialsboolean
opens_summarystring or null
organization_idstring
referenceslist of strings
send_as_idstring or null
senderstring or null
statusenum
Status of a message, such as Email or SMS.
subjectstring or null
template_idstring or null
thread_idstring or null
tolist of strings
updated_bystring or null
user_idstring or null
userslist of strings
agent_action_reasonstring or null
agent_config_idstring or null
attachmentslist of objects or null
body_previewstring or null
created_by_namestring or null
email_account_idstring or null
envelopemap from strings to any or null
followup_sequence_idstring or null
openslist of maps from strings to strings or null
send_attemptslist of maps from strings to strings or null
sequence_idstring or null
sequence_namestring or null
sequence_subscription_idstring or null
template_namestring or null
updated_by_namestring or null
user_namestring or null

Errors

400
Bad Request Error
401
Unauthorized Error
404
Not Found Error