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

# List or filter all WhatsAppMessage activities

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

Filter by `external_whatsapp_message_id` to find messages to update or delete based on changes in WhatsApp.

Reference: https://developer.close.com/api/resources/activities/whatsapp/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` (datetime or date, optional)
- `date_created__lte` (datetime or date, optional)
- `date_created__gt` (datetime or date, optional)
- `date_created__lt` (datetime or date, optional)
- `activity_at__gte` (datetime or date, optional)
- `activity_at__lte` (datetime or date, optional)
- `activity_at__gt` (datetime or date, optional)
- `activity_at__lt` (datetime or date, optional)
- `external_whatsapp_message_id` (string, optional, nullable)
- `_fields` (string, optional) — Comma-separated list of fields to include in the response.

## Response

### 200

Successful response

- `data` (list of object, required)
  - `_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)
  - `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`
  - `external_whatsapp_message_id` (string, required)
  - `id` (string, required)
  - `integration_link` (string, required, nullable)
  - `integration_name` (string, required, nullable)
  - `lead_id` (string, required, nullable)
  - `local_phone` (string, required)
  - `local_phone_formatted` (string, required)
  - `message_html` (string, required)
  - `message_markdown` (string, required)
  - `organization_id` (string, required)
  - `remote_phone` (string, required)
  - `remote_phone_formatted` (string, required)
  - `response_to_id` (string, required, nullable)
  - `source` (enum, required)
    - Allowed values: `ui`, `api`, `import`, `clipper`, `email`, `suggestion`, `segment-integration`, `customerio-integration`, `calendly-integration`, `ai`, `whatsapp`, `webform`
  - `text` (string, required)
  - `updated_by` (string, required, nullable)
  - `user_id` (string, required, nullable)
  - `users` (list of string, required)
  - `attachments` (list of object, optional)
    - `content_type` (string, required, nullable)
    - `filename` (string, required, nullable)
    - `size` (integer, required, nullable)
    - `url` (string, required)
    - `thumbnail_url` (string, optional, nullable)
  - `created_by_name` (string, optional, nullable)
  - `sequence_id` (string, optional, nullable)
  - `sequence_name` (string, optional, nullable)
  - `sequence_subscription_id` (string, optional, nullable)
  - `updated_by_name` (string, optional, nullable)
  - `user_name` (string, optional, nullable)
- `has_more` (boolean, required)

## Errors

### 400 Bad Request Error

Bad request

- `any`

### 401 Unauthorized Error

Unauthorized

- `any`

### 404 Not Found Error

Not found

- `any`

## Examples

**Response**

```json
{
  "data": [
    {
      "_type": "WhatsAppMessage",
      "activity_at": "2013-02-01T01:06:35.668000+00:00",
      "contact_id": "cont_q4xYmlGhA3060dEl0NDJuHRxPMuVjqLn30AFSzh1fRk",
      "created_by": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA",
      "date_created": "2013-02-01T01:05:04.070000+00:00",
      "date_updated": "2013-02-01T01:06:35.668000+00:00",
      "direction": "outgoing",
      "external_whatsapp_message_id": "1234567890",
      "id": "acti_asjiweURMfsLgKuYGqbQ4Qp7L5a16pQOcDfTgotqDak",
      "integration_link": "https://example.com/messages/1234567890",
      "integration_name": "API",
      "lead_id": "lead_KwD00BYbXCHiPWj68LxFkxaeWuULpZ7awzm6LqeFs0h",
      "local_phone": "+16503334444",
      "local_phone_formatted": "+1 650-333-444",
      "message_html": "<p>test</p>",
      "message_markdown": "test",
      "organization_id": "orga_RbREgmiiwcr1w2b4cOnCMQaQPSIFxMqAD2Dh243uxcH",
      "remote_phone": "+18183004000",
      "remote_phone_formatted": "+1 818-300-4000",
      "response_to_id": "acti_asjiweURMfsLgKuYGqbQ4Qp7L5a16pQOcDfTgotqDak",
      "source": "api",
      "text": "test",
      "updated_by": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA",
      "user_id": "user_N6KhMpzHRCYQHdn4gRNIFNN5JExnsrprKA6ekxM63XA",
      "users": [],
      "attachments": [],
      "created_by_name": "Stefan Wójcik",
      "updated_by_name": "Stefan Wójcik"
    }
  ],
  "has_more": false
}
```

**SDK Code**

```python activities.whatsapp_messages_list_example
import requests

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

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

print(response.json())
```

```javascript activities.whatsapp_messages_list_example
const url = 'https://api.close.com/api/v1/activity/whatsapp_message/';
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.whatsapp_messages_list_example
package main

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

func main() {

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

	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.whatsapp_messages_list_example
require 'uri'
require 'net/http'

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

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.whatsapp_messages_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/whatsapp_message/")
  .basicAuth("<CLOSE_API_KEY>", "")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

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

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

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

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

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