> For a complete page index, fetch https://developer.close.com/llms.txt

# List or filter all EmailThread activities

GET https://api.close.com/api/v1/activity/emailthread/

You'll get one object per email conversation (generally grouped by subject).

Reference: https://developer.close.com/api/resources/activities/email-threads/list

## Authentication

- `Authorization` header (basic auth, required) — Use your API key as the username and leave the password empty.
- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Query parameters

- `_limit` (integer, optional, default: 100) — Number of results to return.
- `_skip` (integer, optional, default: 0) — Number of results to skip before returning, for pagination.
- `id__in` (list of string, optional, nullable) — Filter by activity IDs (comma-separated)
- `lead_id` (list of string, optional, nullable) — Filter by lead IDs (comma-separated)
- `contact_id` (list of string, optional, nullable) — Filter by contact IDs (comma-separated)
- `user_id` (list of string, optional, nullable) — Filter by user IDs (comma-separated)
- `organization_id` (string, optional, nullable)
- `_type` (list of string, optional, nullable) — Filter by activity type, e.g. Call (comma-separated)
- `date_created__gte` (ActivityEmailthreadGetParametersDateCreatedGte, optional)
- `date_created__lte` (ActivityEmailthreadGetParametersDateCreatedLte, optional)
- `date_created__gt` (ActivityEmailthreadGetParametersDateCreatedGt, optional)
- `date_created__lt` (ActivityEmailthreadGetParametersDateCreatedLt, optional)
- `activity_at__gte` (ActivityEmailthreadGetParametersActivityAtGte, optional)
- `activity_at__lte` (ActivityEmailthreadGetParametersActivityAtLte, optional)
- `activity_at__gt` (ActivityEmailthreadGetParametersActivityAtGt, optional)
- `activity_at__lt` (ActivityEmailthreadGetParametersActivityAtLt, optional)
- `_fields` (string, optional) — Comma-separated list of fields to include in the response.

## Response

### 200

Successful response

- `data` (list of EmailThreadActivity, required)
- `has_more` (boolean, required)

## Errors

### 400 Bad Request Error

Bad request

- `any`

### 401 Unauthorized Error

Unauthorized

- `any`

### 404 Not Found Error

Not found

- `any`

## Types

### ActivityEmailthreadGetParametersDateCreatedGte

- datetime
- date

### ActivityEmailthreadGetParametersDateCreatedLte

- datetime
- date

### ActivityEmailthreadGetParametersDateCreatedGt

- datetime
- date

### ActivityEmailthreadGetParametersDateCreatedLt

- datetime
- date

### ActivityEmailthreadGetParametersActivityAtGte

- datetime
- date

### ActivityEmailthreadGetParametersActivityAtLte

- datetime
- date

### ActivityEmailthreadGetParametersActivityAtGt

- datetime
- date

### ActivityEmailthreadGetParametersActivityAtLt

- datetime
- date

### EmailThreadActivity

- `_type` (string, required)
- `activity_at` (datetime, required, nullable)
- `contact_id` (string, required, nullable)
- `created_by` (string, required, nullable)
- `date_created` (datetime, required)
- `date_updated` (datetime, required)
- `id` (string, required)
- `latest_normalized_subject` (string, required, nullable)
- `lead_id` (string, required, nullable)
- `n_emails` (integer, required, nullable)
- `organization_id` (string, required)
- `updated_by` (string, required, nullable)
- `user_id` (string, required, nullable)
- `users` (list of string, required)
- `comment_summary` (CommentSummary, optional, nullable)
- `created_by_name` (string, optional, nullable)
- `emails` (list of EmailInThread, optional)
- `importance` (EmailThreadActivityImportance, optional)
- `latest_emails` (list of EmailPreview, optional)
- `participants` (list of EmailIdentity, optional)
- `summary` (EmailThreadSummary, optional, nullable)
- `updated_by_name` (string, optional, nullable)
- `user_name` (string, optional, nullable)

### CommentSummary

- `comment_count` (integer, required)
- `thread_id` (string, required)

### EmailInThread

- `_type` (string, required)
- `activity_at` (datetime, required, nullable)
- `bcc` (list of string, required)
- `bulk_email_action_id` (string, required, nullable)
- `cc` (list of string, required)
- `contact_id` (string, required, nullable)
- `created_by` (string, required, nullable)
- `date_created` (datetime, required)
- `date_scheduled` (datetime, required, nullable)
- `date_sent` (datetime, required, nullable)
- `date_updated` (datetime, required)
- `direction` (enum, required, nullable) — Direction of communication. Outgoing means the communication flowing from the user to the lead/contact. Inbound means the opposite.
  - Allowed values: `incoming`, `outgoing`
- `followup_sequence_add_cc_bcc` (boolean, required)
- `followup_sequence_delay` (integer, required, nullable)
- `has_reply` (boolean, required)
- `id` (string, required)
- `in_reply_to_id` (string, required, nullable)
- `lead_id` (string, required, nullable)
- `message_ids` (list of string, required)
- `need_smtp_credentials` (boolean, required)
- `opens_summary` (string, required, nullable)
- `organization_id` (string, required)
- `references` (list of string, required)
- `send_as_id` (string, required, nullable)
- `sender` (string, required, nullable)
- `status` (enum, required) — Status of a message, such as Email or SMS.
  - Allowed values: `inbox`, `draft`, `scheduled`, `outbox`, `sent`, `error`
- `subject` (string, required, nullable)
- `template_id` (string, required, nullable)
- `thread_id` (string, required, nullable)
- `to` (list of string, required)
- `updated_by` (string, required, nullable)
- `user_id` (string, required, nullable)
- `users` (list of string, required)
- `agent_action_reason` (string, optional, nullable)
- `agent_config_id` (string, optional, nullable)
- `ai_draft` (map from string to any, optional, nullable)
- `attachments` (list of Attachment, optional, nullable)
- `body_html` (string, optional, nullable)
- `body_html_quoted` (list of QuotedEmailHTML, optional, nullable)
- `body_preview` (string, optional, nullable)
- `body_text` (string, optional, nullable)
- `body_text_quoted` (list of QuotedEmailText, optional, nullable)
- `created_by_name` (string, optional, nullable)
- `email_account_id` (string, optional, nullable)
- `envelope` (map from string to any, optional, nullable)
- `followup_sequence_id` (string, optional, nullable)
- `opens` (list of EmailOpen, optional, nullable)
- `send_attempts` (list of SendAttempt, optional, nullable)
- `sequence_id` (string, optional, nullable)
- `sequence_name` (string, optional, nullable)
- `sequence_subscription_id` (string, optional, nullable)
- `template_name` (string, optional, nullable)
- `updated_by_name` (string, optional, nullable)
- `user_name` (string, optional, nullable)

### EmailThreadActivityImportance

- ImportantEmailThread: ImportantEmailThread
- NotImportantEmailThread: NotImportantEmailThread

### EmailPreview

- `bcc` (list of string, required)
- `body_preview` (string, required, nullable)
- `cc` (list of string, required)
- `date_created` (datetime, required)
- `date_sent` (datetime, required, nullable)
- `date_updated` (datetime, required)
- `direction` (enum, required) — Direction of communication. Outgoing means the communication flowing from the user to the lead/contact. Inbound means the opposite.
  - Allowed values: `incoming`, `outgoing`
- `envelope` (EmailEnvelope, required, nullable)
- `has_attachments` (boolean, required, nullable)
- `id` (string, required, nullable)
- `opens_summary` (string, required, nullable)
- `send_as_id` (string, required, nullable)
- `sender` (string, required, nullable)
- `status` (enum, required) — Status of a message, such as Email or SMS.
  - Allowed values: `inbox`, `draft`, `scheduled`, `outbox`, `sent`, `error`
- `subject` (string, required, nullable)
- `to` (list of string, required)
- `user_id` (string, required, nullable)

### EmailIdentity

- `email` (string, required)
- `name` (string, required)

### EmailThreadSummary

- `expired_at` (datetime, required, nullable)
- `generated_at` (datetime, required, nullable)
- `status` (enum, required)
  - Allowed values: `pending`, `success`, `failure`, `expired`
- `summary_html` (string, required, nullable)
- `summary_text` (string, required, nullable)
- `updated_at` (datetime, required)
- `feedback` (EmailThreadSummaryFeedback, optional)

### Attachment

- `content_type` (string, required, nullable)
- `filename` (string, required, nullable)
- `size` (integer, required, nullable)
- `url` (string, required)
- `thumbnail_url` (string, optional, nullable)

### QuotedEmailHTML

- `expand` (boolean, required)
- `html` (string, required)

### QuotedEmailText

- `expand` (boolean, required)
- `text` (string, required)

### EmailOpen

- `ip_address` (string, required, nullable)
- `opened_at` (datetime, required)
- `opened_by` (string, required, nullable)
- `user_agent` (string, required, nullable)

### SendAttempt

- `date` (string, required)
- `error_class` (string, required, nullable)
- `error_message` (string, required)

### ImportantEmailThread

- `reason` (enum, required)
  - Allowed values: `manual`, `contains-manual-message`, `most-recent-communication`, `has-response`, `whitelisted`, `by-default`, `unset-initial-default`
- `type` ("important", required)

### NotImportantEmailThread

- `reason` (enum, required)
  - Allowed values: `manual`, `scheduling-emails`, `automated-outbound`, `marketing-or-transactional`, `by-default`
- `type` ("not_important", required)

### EmailEnvelope

- `bcc` (list of EmailIdentity, required)
- `cc` (list of EmailIdentity, required)
- `date` (string, required, nullable)
- `from` (list of EmailIdentity, required)
- `in_reply_to` (string, required, nullable)
- `is_autoreply` (boolean, required)
- `message_id` (string, required, nullable)
- `reply_to` (list of EmailIdentity, required)
- `sender` (list of EmailIdentity, required)
- `subject` (string, required, nullable)
- `to` (list of EmailIdentity, required)

### EmailThreadSummaryFeedback

- `detail` (string, required, nullable)
- `given_at` (datetime, required)
- `rating` (enum, required)
  - Allowed values: `positive`, `negative`

## Examples

**Response**

```json
{
  "data": [
    {
      "_type": "EmailThread",
      "activity_at": "2014-12-07T04:10:46+00:00",
      "contact_id": null,
      "created_by": null,
      "date_created": "2014-12-07T04:10:46+00:00",
      "date_updated": "2014-12-07T04:11:00.476000+00:00",
      "id": "acti_giHHCV8uOnialksjdflaksjdflq5zXxWi6FQL88MoNH",
      "latest_normalized_subject": "Excited to have you on board!",
      "lead_id": "lead_5cIz6MHYMYEJLDTJRzoyfLHAMymuWlPweEMvslHoBf5",
      "n_emails": 3,
      "organization_id": "orga_RbREgmiiwcr1w2b4cOnCMQaQPSIFxMqAD2Dh243uxcH",
      "updated_by": null,
      "user_id": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA",
      "users": [
        "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA"
      ],
      "created_by_name": null,
      "emails": [
        {
          "_type": "Email",
          "activity_at": "2014-12-07T04:10:46+00:00",
          "bcc": [],
          "bulk_email_action_id": null,
          "cc": [],
          "contact_id": "cont_alksdjfalksdfj8NzQM56BzBZ8X2GWaowuifsOeWyeJ",
          "created_by": null,
          "date_created": "2014-12-07T04:10:46+00:00",
          "date_scheduled": null,
          "date_sent": "2014-12-07T04:10:46+00:00",
          "date_updated": "2014-12-07T04:11:00.459000+00:00",
          "direction": "outgoing",
          "followup_sequence_add_cc_bcc": false,
          "followup_sequence_delay": null,
          "has_reply": false,
          "id": "acti_12342j3451lk25iH1Rrtk9LWxwpUZmHygjww4c5iFw4",
          "in_reply_to_id": null,
          "lead_id": "lead_5cIz6MHYMYEJLDTJRzoyfLHAMymuWlPweEMvslHoBf5",
          "message_ids": [
            "<5483d346af89c_c0031a60fdc11130711c@ns5001546.ip-192-95-32.net.mail>"
          ],
          "need_smtp_credentials": false,
          "opens_summary": null,
          "organization_id": "orga_RbREgmiiwcr1w2b4cOnCMQaQPSIFxMqAD2Dh243uxcH",
          "references": [],
          "send_as_id": null,
          "sender": "Steli Efti <steli@close.com>",
          "status": "sent",
          "subject": "Excited to have you on board!",
          "template_id": null,
          "thread_id": "acti_giHHCV8uOniX2wuFmKY14VWqOEq5zXxWi6FQL88MoNH",
          "to": [
            "karen@example.com"
          ],
          "updated_by": null,
          "user_id": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA",
          "users": [],
          "attachments": [],
          "body_preview": "Hey Karen,\r\n\r\nThanks for signing up for Close. My name is Steli Efti and I'm\r\nthe CEO of Close. Please let me know if I can do anything to\r\nhelp make your trial into a massive success.\r\n\r\nAdditi",
          "created_by_name": null,
          "email_account_id": "emailacct_aslkdjfalksjdfCmLShmuvlPMFy7Ze61FVeEj1VXnlG",
          "envelope": {
            "bcc": [],
            "cc": [],
            "date": "Sun, 07 Dec 2014 04:10:46 +0000",
            "from": [
              {
                "email": "steli@close.com",
                "name": "Steli Efti"
              }
            ],
            "in_reply_to": null,
            "message_id": "<5483d346af89c_c0031a60fdc11130711c@ns5001546.ip-192-95-32.net.mail>",
            "reply_to": [],
            "sender": [
              {
                "email": "steli@close.com",
                "name": "Steli Efti"
              }
            ],
            "subject": "Excited to have you on board!",
            "to": [
              {
                "email": "karen@example.com",
                "name": null
              }
            ]
          },
          "opens": [],
          "send_attempts": [],
          "sequence_id": "seq_1BTljGuCooX0nbFoPihl07",
          "sequence_name": "My Sequence",
          "sequence_subscription_id": "sub_wRlAku35U53xEV7PcNY3Qo",
          "template_name": null,
          "updated_by_name": null,
          "user_name": "Steli Efti"
        },
        {
          "_type": "Email",
          "activity_at": "2014-11-28T17:26:00+00:00",
          "bcc": [],
          "bulk_email_action_id": null,
          "cc": [],
          "contact_id": "cont_Hw4160e5c61QoFpEkvbUeGYJ0uDMLODYfrBRLWDFHh6",
          "created_by": null,
          "date_created": "2014-11-28T17:26:00+00:00",
          "date_scheduled": null,
          "date_sent": "2014-11-28T17:26:00+00:00",
          "date_updated": "2014-11-28T17:26:47.740000+00:00",
          "direction": "outgoing",
          "followup_sequence_add_cc_bcc": false,
          "followup_sequence_delay": null,
          "has_reply": false,
          "id": "acti_3ANoOJE7DkTwxG9s1TY3SP3VhiJFeua3gt85nuzb0by",
          "in_reply_to_id": null,
          "lead_id": "lead_5cIz6MHYMYEJLDTJRzoyfLHAMymuWlPweEMvslHoBf5",
          "message_ids": [
            "<5478b0283055a_724e3fb94e13cb5c60513397@ns5001376.ip-192-95-32.net.mail>"
          ],
          "need_smtp_credentials": false,
          "opens_summary": null,
          "organization_id": "orga_RbREgmiiwcr1w2b4cOnCMQaQPSIFxMqAD2Dh243uxcH",
          "references": [],
          "send_as_id": null,
          "sender": "Steli Efti <steli@close.com>",
          "status": "sent",
          "subject": "Excited to have you on board!",
          "template_id": null,
          "thread_id": "acti_giHHCV8uOniX2wuFmKY14VWqOEq5zXxWi6FQL88MoNH",
          "to": [
            "carlos@abc.com"
          ],
          "updated_by": null,
          "user_id": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA",
          "users": [],
          "attachments": [],
          "body_preview": "Hey Carlos,\r\n\r\nThanks for signing up for Close. My name is Steli Efti and I'm\r\nthe CEO of Close. Please let me know if I can do anything to\r\nhelp make your trial into a massive success.\r\n\r\nAddit",
          "created_by_name": null,
          "email_account_id": "emailacct_eLq7Zxa3CPKgapCmLShmuvlPMFy7Ze61FVeEj1VXnlG",
          "envelope": {
            "bcc": [],
            "cc": [],
            "date": "Fri, 28 Nov 2014 17:26:00 +0000",
            "from": [
              {
                "email": "steli@close.com",
                "name": "Steli Efti"
              }
            ],
            "in_reply_to": null,
            "message_id": "<5478b0283055a_724e3fb94e13cb5c60513397@ns5001376.ip-192-95-32.net.mail>",
            "reply_to": [],
            "sender": [
              {
                "email": "steli@close.com",
                "name": "Steli Efti"
              }
            ],
            "subject": "Excited to have you on board!",
            "to": [
              {
                "email": "carlos@abc.com",
                "name": null
              }
            ]
          },
          "opens": [],
          "send_attempts": [],
          "sequence_id": null,
          "sequence_name": null,
          "sequence_subscription_id": null,
          "template_name": null,
          "updated_by_name": null,
          "user_name": "Steli Efti"
        },
        {
          "_type": "Email",
          "activity_at": "2014-11-26T10:15:44+00:00",
          "bcc": [],
          "bulk_email_action_id": null,
          "cc": [],
          "contact_id": "cont_6d0dRVHWGMvsJLFjAms1xTL0LCeQoRVWyZtpQs0Y98S",
          "created_by": null,
          "date_created": "2014-11-26T10:15:44+00:00",
          "date_scheduled": null,
          "date_sent": "2014-11-26T10:15:44+00:00",
          "date_updated": "2014-11-26T10:17:58.234000+00:00",
          "direction": "outgoing",
          "followup_sequence_add_cc_bcc": false,
          "followup_sequence_delay": null,
          "has_reply": false,
          "id": "acti_lcAFcE1n7vbkjtlcwpSSLGpheZKBSrmrPFcCM9S13q0",
          "in_reply_to_id": null,
          "lead_id": "lead_5cIz6MHYMYEJLDTJRzoyfLHAMymuWlPweEMvslHoBf5",
          "message_ids": [
            "<5475a850a030a_620f1ba3e246281806c1@ns5000834.ip-142-4-219.net.mail>"
          ],
          "need_smtp_credentials": false,
          "opens_summary": null,
          "organization_id": "orga_RbREgmiiwcr1w2b4cOnCMQaQPSIFxMqAD2Dh243uxcH",
          "references": [],
          "send_as_id": null,
          "sender": "Steli Efti <steli@close.com>",
          "status": "sent",
          "subject": "Excited to have you on board!",
          "template_id": null,
          "thread_id": "acti_giHHCV8uOniX2wuFmKY14VWqOEq5zXxWi6FQL88MoNH",
          "to": [
            "ohad@abc.com"
          ],
          "updated_by": null,
          "user_id": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA",
          "users": [],
          "attachments": [],
          "body_preview": "Hey TrueAccord,\r\n\r\nThanks for signing up for Close. My name is Steli Efti and I'm\r\nthe CEO of Close. Please let me know if I can do anything to\r\nhelp make your trial into a massive success.\r\n\r\nA",
          "created_by_name": null,
          "email_account_id": "emailacct_eLq7Zxa3CPKgapCmLShmuvlPMFy7Ze61FVeEj1VXnlG",
          "envelope": {
            "bcc": [],
            "cc": [],
            "date": "Wed, 26 Nov 2014 10:15:44 +0000",
            "from": [
              {
                "email": "steli@close.com",
                "name": "Steli Efti"
              }
            ],
            "in_reply_to": null,
            "message_id": "<5475a850a030a_620f1ba3e246281806c1@ns5000834.ip-142-4-219.net.mail>",
            "reply_to": [],
            "sender": [
              {
                "email": "steli@close.com",
                "name": "Steli Efti"
              }
            ],
            "subject": "Excited to have you on board!",
            "to": [
              {
                "email": "ohad@trueaccord.com",
                "name": null
              }
            ]
          },
          "opens": [],
          "send_attempts": [],
          "sequence_id": null,
          "sequence_name": null,
          "sequence_subscription_id": null,
          "template_name": null,
          "updated_by_name": null,
          "user_name": "Steli Efti"
        }
      ],
      "participants": [
        {
          "email": "steli@close.com",
          "name": "Steli Efti"
        }
      ],
      "updated_by_name": null,
      "user_name": "Steli Efti"
    }
  ],
  "has_more": false
}
```

**SDK Code**

```python activities.email_threads_list_example
import requests

url = "https://api.close.com/api/v1/activity/emailthread/"

response = requests.get(url, auth=("<CLOSE_API_KEY>", ""))

print(response.json())
```

```javascript activities.email_threads_list_example
const url = 'https://api.close.com/api/v1/activity/emailthread/';
const credentials = btoa("<CLOSE_API_KEY>:");

const options = {method: 'GET', headers: {Authorization: `Basic ${credentials}`}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go activities.email_threads_list_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.close.com/api/v1/activity/emailthread/"

	req, _ := http.NewRequest("GET", url, nil)

	req.SetBasicAuth("<CLOSE_API_KEY>", "")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby activities.email_threads_list_example
require 'uri'
require 'net/http'

url = URI("https://api.close.com/api/v1/activity/emailthread/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request.basic_auth("<CLOSE_API_KEY>", "")

response = http.request(request)
puts response.read_body
```

```java activities.email_threads_list_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.close.com/api/v1/activity/emailthread/")
  .basicAuth("<CLOSE_API_KEY>", "")
  .asString();
```

```php activities.email_threads_list_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.close.com/api/v1/activity/emailthread/', [
  'headers' => [
  ],
    'auth' => ['<CLOSE_API_KEY>', ''],
]);

echo $response->getBody();
```

```csharp activities.email_threads_list_example
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://api.close.com/api/v1/activity/emailthread/");
client.Authenticator = new HttpBasicAuthenticator("<CLOSE_API_KEY>", "");
var request = new RestRequest(Method.GET);

IRestResponse response = client.Execute(request);
```