> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vambe.me/llms.txt
> Use this file to discover all available pages before exploring further.

# Get WhatsApp Contacts (Deprecated)

> [DEPRECATED] Get WhatsApp contacts by days. Use GET /api/public/contacts instead for all channels.

<Danger>
  **🚨 DEPRECATED ENDPOINT - DO NOT USE FOR NEW INTEGRATIONS**

  This WhatsApp-specific endpoint is deprecated. Use the new universal contacts endpoint instead which supports ALL channels (WhatsApp, Instagram, SMS, etc.).
</Danger>

## Deprecation Notice

This endpoint only returns WhatsApp contacts and is being phased out in favor of a more powerful, channel-agnostic endpoint.

### Recommended Alternative

#### **✨ Use the Universal Contacts Endpoint** (Recommended)

Get contacts from **all channels** (WhatsApp, Instagram, Web Chat, SMS, etc.) with better structure:

```
GET /api/public/contacts?days={days}
```

[View Documentation](/reference/contact/get-contacts-by-days)

**Why migrate**:

* ✅ **All Channels**: WhatsApp, Instagram, SMS, Web Chat, and more
* ✅ **Better Performance**: Optimized queries and indexing
* ✅ **Consistent Response**: Standard AI Contact objects
* ✅ **Future-Proof**: Active development and support
* ✅ **Ordered Results**: Sorted by last\_message\_at descending

### Migration Example

**Old (Deprecated)**:

```javascript theme={null}
// Only gets WhatsApp contacts
await fetch(
  'https://api.vambe.me/api/public/whatsapp/contact/contacts?days=30',
  {
    headers: {
      'x-api-key': 'your_api_key_here',
    },
  },
);
```

**New (Recommended)**:

```javascript theme={null}
// Gets contacts from ALL channels
await fetch('https://api.vambe.me/api/public/contacts?days=30', {
  headers: {
    'x-api-key': 'your_api_key_here',
  },
});

// Filter by WhatsApp if needed
const contacts = await response.json();
const whatsappOnly = contacts.filter((c) => c.platform === 'whatsapp');
```

### Comparison

| Feature           | Old Endpoint (Deprecated)               | New Endpoint              |
| ----------------- | --------------------------------------- | ------------------------- |
| **Channels**      | WhatsApp only                           | All channels              |
| **Response Type** | WhatsApp Contact objects                | AI Contact objects        |
| **Ordering**      | Not specified                           | By last\_message\_at DESC |
| **Path**          | `/api/public/whatsapp/contact/contacts` | `/api/public/contacts`    |
| **Support**       | ❌ Deprecated                            | ✅ Active                  |

## Migration Timeline

* **Now**: Endpoint marked as deprecated
* **6 months**: Warning messages added to API responses
* **12 months**: Endpoint will be removed

Please migrate to the new endpoint to avoid service disruption.

<Danger>
  **⚠️ ACTION REQUIRED**

  Update your integrations to use the new `/api/public/contacts` endpoint **before this endpoint is removed** in 12 months.
</Danger>


## OpenAPI

````yaml get /api/public/whatsapp/contact/contacts
openapi: 3.0.0
info:
  title: Vambe AI API
  description: Vambe AI documentation
  version: '1.0'
  contact: {}
servers:
  - url: https://api.vambe.me
    description: Production Server
security: []
tags:
  - name: Vambe AI
    description: ''
paths:
  /api/public/whatsapp/contact/contacts:
    get:
      tags:
        - Whatsapp contact
      summary: Get contacts
      description: Get the contacts where the last message was in the last X days
      operationId: PublicWhatsAppContactController_getContacts
      parameters:
        - name: days
          required: true
          in: query
          description: Number of days to get the contacts (1-365)
          schema:
            minimum: 1
            maximum: 365
            exclusiveMaximum: false
            exclusiveMinimum: false
            default: 1
            type: number
        - name: x-api-key
          in: header
          description: API key needed to authorize the request
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Contacts retrieved successfully.
        '400':
          description: Bad request.
        '401':
          description: Unauthorized.

````