> For a complete page index, fetch https://developer.close.com/llms.txt # List or filter all activity types GET https://api.close.com/api/v1/activity/ To list only a specific activity type (e.g., only `Call` or `LeadStatusChange`), use the other resources listed separately. When querying activities for a single lead (using the `lead_id` parameter), you can ask for multiple activity types using `_type__in`. When listing [Custom Activities](https://developer.close.com/api/resources/activities/custom-activities), `_type` and `_type__in` can include Custom Activity Type ids (e.g. `actitype_1h5m6uHM9BZOpwVhyRJb4Y`) to filter by a specific custom activity type or `Custom` to list custom activities of any type. The following filtering parameters can only be used for listing activities on a single lead (using the `lead_id` parameter): `user_id`, `user_id__in`, `contact_id`, `contact_id__in`, `_type`, `_type__in`. All activities have two sortable datetime fields: `date_created` and `activity_at`. `date_created` denotes when an activity was created or synced into Close and `activity_at` denotes when that activity actually occurred. For example, on outgoing Email activities, `date_created` is equal to when the email was first created in Close, and `activity_at` is equal to when the email was actually sent. For Meeting activities, `activity_at` is equal to the scheduled time of the meeting. On custom activities, users are able to update the `activity_at` field at any time. Sorting by `-activity_at` can only be used when listing activities on a single lead using the `lead_id` parameter. In addition, you can only use the date-based filters of the field you're currently sorting on. This means that if you want to use `activity_at__lt` and `activity_at__gt` as filters, you need to include `_order_by=-activity_at` in your request. `thread_emails` parameter: - (Default) when this parameter is not present, `Email` objects will be returned for each email message. - A value of `true` will return `EmailThread` objects representing email conversations. Stripped-down version of `Email` objects will also be returned. - A value of `only` will return `EmailThread` objects representing email conversations. `Email` objects will not be returned. Reference: https://developer.close.com/api/resources/activities/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 `, 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` (ActivityGetParametersDateCreatedGte, optional) - `date_created__lte` (ActivityGetParametersDateCreatedLte, optional) - `date_created__gt` (ActivityGetParametersDateCreatedGt, optional) - `date_created__lt` (ActivityGetParametersDateCreatedLt, optional) - `activity_at__gte` (ActivityGetParametersActivityAtGte, optional) - `activity_at__lte` (ActivityGetParametersActivityAtLte, optional) - `activity_at__gt` (ActivityGetParametersActivityAtGt, optional) - `activity_at__lt` (ActivityGetParametersActivityAtLt, optional) - `lead_id__in` (string, optional) - `user_id__in` (string, optional) - `contact_id__in` (string, optional) - `_type__in` (string, optional) - `_fields` (string, optional) — Comma-separated list of fields to include in the response. - `_order_by` (string, optional) ## Response ### 200 Successful response ## Errors ### 400 Bad Request Error Bad request - `any` ### 401 Unauthorized Error Unauthorized - `any` ### 404 Not Found Error Not found - `any` ## Types ### ActivityGetParametersDateCreatedGte ### ActivityGetParametersDateCreatedLte ### ActivityGetParametersDateCreatedGt ### ActivityGetParametersDateCreatedLt ### ActivityGetParametersActivityAtGte ### ActivityGetParametersActivityAtLte ### ActivityGetParametersActivityAtGt ### ActivityGetParametersActivityAtLt ## Examples **Response** ```json { "data": [ { "_type": "Created", "activity_at": "2013-02-20T05:44:35.636000+00:00", "contact_id": null, "created_by": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA", "created_by_name": "Bruce Wayne", "date_created": "2013-02-20T05:44:35.636000+00:00", "date_updated": "2013-02-20T05:44:35.667000+00:00", "id": "acti_ICUkwteuKAaJvhNqF1QBoVOWKQuSbFuOYoZxGeWQAeg", "lead_id": "lead_pqXrF8figcDHN7HvaXmb4wTjpxnxpmqheEyjTYPfdi5", "organization_id": "orga_RbREgmiiwcr1w2b4cOnCMQaQPSIFxMqAD2Dh243uxcH", "source": "api", "updated_by": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA", "updated_by_name": "Bruce Wayne", "user_id": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA", "user_name": "Bruce Wayne" }, { "_type": "Created", "activity_at": "2013-02-20T05:44:31.940000+00:00", "contact_id": null, "created_by": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA", "created_by_name": "Bruce Wayne", "date_created": "2013-02-20T05:44:31.940000+00:00", "date_updated": "2013-02-20T05:44:31.955000+00:00", "id": "acti_k8u1xLU5G9L0YLkxLqAHEZFB84oB7fN9vqjCgljfcFN", "lead_id": "lead_6SY1tPBB1EnQneopPGSLsAmXVkTRf4P0r6Y6ntdPowL", "organization_id": "orga_RbREgmiiwcr1w2b4cOnCMQaQPSIFxMqAD2Dh243uxcH", "source": "api", "updated_by": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA", "updated_by_name": "Bruce Wayne", "user_id": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA", "user_name": "Bruce Wayne" }, { "_type": "Created", "activity_at": "2013-02-20T05:30:24.854000+00:00", "contact_id": null, "created_by": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA", "created_by_name": "Bruce Wayne", "date_created": "2013-02-20T05:30:24.854000+00:00", "date_updated": "2013-02-20T05:30:24.870000+00:00", "id": "acti_0wDacWkNoKKVn7I8wCuEc1XbQ7lGQxCgZ9WNQn71P8j", "lead_id": "lead_70jZ5hiVt5X31MZ3vJ0R0GJMqJEihkoF7TtSVFbN2ty", "organization_id": "orga_RbREgmiiwcr1w2b4cOnCMQaQPSIFxMqAD2Dh243uxcH", "source": "api", "updated_by": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA", "updated_by_name": "Bruce Wayne", "user_id": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA", "user_name": "Bruce Wayne" }, { "_type": "Email", "activity_at": "2013-02-08T05:03:15.000000+00:00", "attachments": [], "bcc": [], "body_html": "Cool!
\n
\nThis is rad. <3
\n

______________________________________________
Sent via Close – sales communication made simple", "body_text": "Cool!\n\nThis is rad. <3\n\n\n______________________________________________\nSent via http://close.com/ - sales communication made simple", "body_text_quoted": [ { "expand": true, "text": "Cool!\n\nThis is rad. <3\n\n\n______________________________________________\nSent via http://close.com/ - sales communication made simple" } ], "cc": [], "contact_id": "cont_eXZwc2SVL4G3xSR85jnfPny2ykvoAQndSyi1Doa2YLO", "created_by": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA", "created_by_name": "Bruce Wayne", "date_created": "2013-02-08T05:02:42.050000+00:00", "date_updated": "2013-02-08T05:03:16.281000+00:00", "direction": "outgoing", "envelope": { "bcc": [], "cc": [], "date": "Fri, 08 Feb 2013 05:03:15 +0000", "from": [ { "email": "phil@close.com", "name": "Phil Freo" } ], "in_reply_to": null, "message_id": "<20130208050314.11553.33819@ec2-54-245-86-79.us-west-2.compute.amazonaws.com>", "reply_to": [], "sender": [ { "email": "phil@close.com", "name": "Phil Freo" } ], "subject": "Testing testing!!!!", "to": [ { "email": "phil@close.com", "name": "" } ] }, "id": "acti_C4DFcBED1FwLSDqn853hjc979h7DIuH2vwABzGWhRAO", "lead_id": "lead_KwD00BYbXCHiPWj68LxFkxaeWuULpZ7awzm6LqeFs0h", "opens": [], "organization_id": "orga_RbREgmiiwcr1w2b4cOnCMQaQPSIFxMqAD2Dh243uxcH", "send_attempts": [], "sender": "phil@close.com", "status": "sent", "subject": "Testing testing!!!!", "template_id": null, "to": [ "phil@close.com" ], "updated_by": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA", "updated_by_name": "Bruce Wayne", "user_id": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA", "user_name": "Bruce Wayne" }, { "_type": "Note", "activity_at": "2013-02-01T01:05:04.070000+00:00", "contact_id": null, "created_by": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA", "created_by_name": "Bruce Wayne", "date_created": "2013-02-01T01:05:04.070000+00:00", "date_updated": "2013-02-01T01:06:35.668000+00:00", "id": "acti_XOyG7jURMfsLgKuYGqbQ4Qp7L5a16pQOcDfTgotqDak", "lead_id": "lead_KwD00BYbXCHiPWj68LxFkxaeWuULpZ7awzm6LqeFs0h", "note": "Welcome to Close! Get started by:\n\n1. Import your leads! Use our \"Bulk CSV Upload\" tool by clicking your name in the top right. Add leads manually by clicking \"New Lead\" in the lower left.\n\n2. Invite your co-workers!\n\n3. Setup two-way syncing of your emails by going to Settings -> Email Settings.", "organization_id": "orga_RbREgmiiwcr1w2b4cOnCMQaQPSIFxMqAD2Dh243uxcH", "updated_by": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA", "updated_by_name": "Bruce Wayne", "user_id": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA", "user_name": "Bruce Wayne" }, { "_type": "Email", "activity_at": "2013-02-01T00:54:51.000000+00:00", "attachments": [], "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!", "body_text_quoted": [ { "expand": true, "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", "date_updated": "2013-02-01T00:56:04.184000+00:00", "direction": "incoming", "envelope": { "bcc": [], "cc": [], "date": "Fri, 01 Feb 2013 00:54:51 +0000", "from": [ { "email": "karan@close.com", "name": "" } ], "in_reply_to": null, "message_id": "<20130201005451.14369.20369@ec2-54-245-86-79.us-west-2.compute.amazonaws.com>", "reply_to": [], "sender": [ { "email": "karan@close.com", "name": "" } ], "subject": "Welcome to Close!", "to": [ { "email": "phil+sample@close.com", "name": "" } ] }, "id": "acti_WuIVvTT9b3zLmOOWalxK0OrqtdkxEEdu4mNr1TPGb2o", "lead_id": "lead_KwD00BYbXCHiPWj68LxFkxaeWuULpZ7awzm6LqeFs0h", "opens": [], "organization_id": "orga_RbREgmiiwcr1w2b4cOnCMQaQPSIFxMqAD2Dh243uxcH", "send_attempts": [], "sender": "karan@close.com", "status": "inbox", "subject": "Welcome to Close!", "template_id": null, "to": [ "phil+sample@close.com" ], "updated_by": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA", "updated_by_name": "Bruce Wayne", "user_id": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA", "user_name": "Bruce Wayne" } ], "has_more": false } ``` **SDK Code** ```python activities_list_example import requests url = "https://api.close.com/api/v1/activity/" response = requests.get(url, auth=("", "")) print(response.json()) ``` ```javascript activities_list_example const url = 'https://api.close.com/api/v1/activity/'; const credentials = btoa(":"); 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_list_example package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.close.com/api/v1/activity/" req, _ := http.NewRequest("GET", url, nil) req.SetBasicAuth("", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby activities_list_example require 'uri' require 'net/http' url = URI("https://api.close.com/api/v1/activity/") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request.basic_auth("", "") response = http.request(request) puts response.read_body ``` ```java activities_list_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.close.com/api/v1/activity/") .basicAuth("", "") .asString(); ``` ```php activities_list_example request('GET', 'https://api.close.com/api/v1/activity/', [ 'headers' => [ ], 'auth' => ['', ''], ]); echo $response->getBody(); ``` ```csharp activities_list_example using RestSharp; using RestSharp.Authenticators; var client = new RestClient("https://api.close.com/api/v1/activity/"); client.Authenticator = new HttpBasicAuthenticator("", ""); var request = new RestRequest(Method.GET); IRestResponse response = client.Execute(request); ```