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

# Lister les contacts

> Récupérez tous les contacts d’une liste avec pagination

### Endpoint

<ParamField method="GET" path="/v1/contact-groups/:id/contacts" />

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token avec votre Secret Key (format: `Bearer sk_...`)
</ParamField>

### URL Parameters

<ParamField path="id" type="string" required>
  L'identifiant de la liste
</ParamField>

### Query Parameters

<ParamField query="limit" type="number" default="50">
  Nombre de contacts par page
</ParamField>

<ParamField query="offset" type="number" default="0">
  Position de départ pour la pagination
</ParamField>

### Exemples de requêtes

<CodeGroup>
  ```bash BASH theme={null}
  curl -X GET "https://api.wachap.com/v1/contact-groups/65f1234567890abcdef12345/contacts?limit=20&offset=0" \
    -H "Authorization: Bearer token"
  ```

  ```javascript JAVASCRIPT theme={null}
  const response = await fetch('https://api.wachap.com/v1/contact-groups/65f1234567890abcdef12345/contacts?limit=20&offset=0', {
    headers: { 'Authorization': 'Bearer token' }
  });
  console.log(await response.json());
  ```
</CodeGroup>

### Exemple de réponse

```json theme={null}
{
  "success": true,
  "listId": "65f1234567890abcdef12345",
  "contacts": [
    {
      "contactIndex": 0,
      "phone": "+2290112345678",
      "name": "John Doe",
      "city": "Abidjan",
      "email": "john@example.com"
    },
    {
      "contactIndex": 1,
      "phone": "+33612345678",
      "name": "Marie Dupont",
      "city": "Paris",
      "email": "marie@example.com"
    }
  ],
  "total": 150,
  "limit": 20,
  "offset": 0
}
```

### Pagination

Pour naviguer à travers une grande liste :

* **Page 1** (0-49): `?limit=50&offset=0`
* **Page 2** (50-99): `?limit=50&offset=50`
* **Page 3** (100-149): `?limit=50&offset=100`

### Codes d'erreur

| Code  | Description                                 |
| :---- | :------------------------------------------ |
| `401` | INVALID\_SECRET\_KEY - Clé secrète invalide |
| `404` | Liste non trouvée                           |
| `500` | GET\_CONTACTS\_ERROR - Erreur serveur       |


## OpenAPI

````yaml GET /contact-groups/{id}/contacts
openapi: 3.0.3
info:
  title: WaChap API
  version: 2.0.0
servers:
  - url: https://api.wachap.com/v1
    description: WaChap API server
security:
  - BearerAuth: []
tags:
  - name: Instances
    description: Créer et gérer des instances WhatsApp
  - name: Webhook
    description: Configuration des webhooks de réception
  - name: Messages
    description: Envoyer des messages WhatsApp
  - name: Comptes
    description: Gérer vos comptes WhatsApp connectés
  - name: SMS
    description: Service SMS de WaChap (V4) via FCM
  - name: Étiquettes WhatsApp
    description: Créer et associer des étiquettes aux conversations WhatsApp
paths:
  /contact-groups/{id}/contacts:
    get:
      tags:
        - Listes de contacts
      summary: Lister les contacts d'une liste
      description: Récupérer les contacts d'une liste avec pagination.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: limit
          in: query
          schema:
            type: integer
            default: 50
        - name: offset
          in: query
          schema:
            type: integer
            default: 0
      responses:
        '200':
          description: OK
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````