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

# Gruplar

> WhatsApp gruplarını programatik olarak oluşturun, yönetin ve etkileşim kurun.

# Gruplar

Wappfy API \u00fczerinden WhatsApp gruplar\u0131n\u0131 y\u00f6netin. Grup olu\u015fturabilir, kat\u0131l\u0131mc\u0131lar\u0131 y\u00f6netebilir, davet ba\u011flant\u0131lar\u0131n\u0131 y\u00f6netebilir ve daha fazlas\u0131n\u0131 yapabilirsiniz.

T\u00fcm grup ucu noktalar\u0131 belirli bir \u00f6rnekle s\u0131n\u0131rl\u0131d\u0131r:

```
/api/instances/{instanceId}/groups/...
```

***

## Grup Olu\u015fturma

Ba\u015flang\u0131\u00e7 kat\u0131l\u0131mc\u0131lar\u0131yla yeni bir WhatsApp grubu olu\u015fturun.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.wappfy.io/api/instances/inst_abc123/groups \
    -H "X-Api-Key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Project Alpha",
      "participants": [
        "5511999998888@s.whatsapp.net",
        "5511888887777@s.whatsapp.net"
      ]
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    "https://api.wappfy.io/api/instances/inst_abc123/groups",
    {
      method: "POST",
      headers: {
        "X-Api-Key": "YOUR_API_KEY",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        name: "Project Alpha",
        participants: [
          "5511999998888@s.whatsapp.net",
          "5511888887777@s.whatsapp.net",
        ],
      }),
    }
  );

  const group = await response.json();
  console.log(group.data.group_id);
  ```
</CodeGroup>

**Yan\u0131t:**

```json theme={null}
{
  "data": {
    "group_id": "120363012345678901@g.us",
    "name": "Project Alpha",
    "participants": [
      {
        "id": "5511999998888@s.whatsapp.net",
        "is_admin": false
      },
      {
        "id": "5511888887777@s.whatsapp.net",
        "is_admin": false
      }
    ]
  }
}
```

***

## Gruplar\u0131 Listeleme

\u00d6rne\u011fin \u00fcyesi oldu\u011fu t\u00fcm gruplar\u0131 al\u0131n.

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.wappfy.io/api/instances/inst_abc123/groups \
    -H "X-Api-Key: YOUR_API_KEY"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    "https://api.wappfy.io/api/instances/inst_abc123/groups",
    {
      headers: { "X-Api-Key": "YOUR_API_KEY" },
    }
  );

  const { data } = await response.json();
  console.log(`Found ${data.length} groups`);
  ```
</CodeGroup>

**Yan\u0131t:**

```json theme={null}
{
  "data": [
    {
      "group_id": "120363012345678901@g.us",
      "name": "Project Alpha",
      "participant_count": 5
    },
    {
      "group_id": "120363098765432109@g.us",
      "name": "Support Team",
      "participant_count": 12
    }
  ]
}
```

***

## Grup Bilgisi Alma

Belirli bir grup hakk\u0131nda ayr\u0131nt\u0131l\u0131 bilgi al\u0131n.

```bash theme={null}
curl https://api.wappfy.io/api/instances/inst_abc123/groups/120363012345678901@g.us \
  -H "X-Api-Key: YOUR_API_KEY"
```

**Yan\u0131t:**

```json theme={null}
{
  "data": {
    "group_id": "120363012345678901@g.us",
    "name": "Project Alpha",
    "description": "Team workspace for Project Alpha",
    "owner": "5511999998888@s.whatsapp.net",
    "created_at": "2026-01-15T10:00:00Z",
    "participants": [
      {
        "id": "5511999998888@s.whatsapp.net",
        "is_admin": true,
        "is_super_admin": true
      },
      {
        "id": "5511888887777@s.whatsapp.net",
        "is_admin": false,
        "is_super_admin": false
      }
    ]
  }
}
```

***

## Grup G\u00fcncelleme

Grup ad\u0131n\u0131 veya a\u00e7\u0131klamas\u0131n\u0131 g\u00fcncelleyin. Bu i\u015flemi ger\u00e7ekle\u015ftirmek i\u00e7in grup y\u00f6neticisi olman\u0131z gerekir.

```bash theme={null}
curl -X PATCH https://api.wappfy.io/api/instances/inst_abc123/groups/120363012345678901@g.us \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Project Alpha v2",
    "description": "Updated workspace for Project Alpha"
  }'
```

<Note>
  Yaln\u0131zca grup y\u00f6neticileri grup ad\u0131n\u0131 ve a\u00e7\u0131klamas\u0131n\u0131 g\u00fcncelleyebilir. \u00d6rnek y\u00f6netici de\u011filse `403` hatas\u0131 d\u00f6necektir.
</Note>

***

## Gruptan Ayr\u0131lma

\u00d6rne\u011fi bir gruptan \u00e7\u0131kar\u0131n.

```bash theme={null}
curl -X POST https://api.wappfy.io/api/instances/inst_abc123/groups/120363012345678901@g.us/leave \
  -H "X-Api-Key: YOUR_API_KEY"
```

<Warning>
  Bir gruptan ayr\u0131ld\u0131ktan sonra, geri d\u00f6nmek i\u00e7in bir davet ba\u011flant\u0131s\u0131na veya ba\u015fka bir y\u00f6neticinin sizi eklemesine ihtiyac\u0131n\u0131z olacakt\u0131r.
</Warning>

***

## Kat\u0131l\u0131mc\u0131lar

### Kat\u0131l\u0131mc\u0131lar\u0131 Listeleme

Bir grubun t\u00fcm kat\u0131l\u0131mc\u0131lar\u0131n\u0131 al\u0131n.

```bash theme={null}
curl https://api.wappfy.io/api/instances/inst_abc123/groups/120363012345678901@g.us/participants \
  -H "X-Api-Key: YOUR_API_KEY"
```

**Yan\u0131t:**

```json theme={null}
{
  "data": [
    {
      "id": "5511999998888@s.whatsapp.net",
      "is_admin": true,
      "is_super_admin": true
    },
    {
      "id": "5511888887777@s.whatsapp.net",
      "is_admin": false,
      "is_super_admin": false
    },
    {
      "id": "5511777776666@s.whatsapp.net",
      "is_admin": true,
      "is_super_admin": false
    }
  ]
}
```

### Kat\u0131l\u0131mc\u0131 Ekleme

Gruba bir veya daha fazla kat\u0131l\u0131mc\u0131 ekleyin. Grup y\u00f6neticisi olman\u0131z gerekir.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.wappfy.io/api/instances/inst_abc123/groups/120363012345678901@g.us/participants \
    -H "X-Api-Key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "participants": [
        "5511666665555@s.whatsapp.net",
        "5511555554444@s.whatsapp.net"
      ]
    }'
  ```

  ```javascript Node.js theme={null}
  await fetch(
    "https://api.wappfy.io/api/instances/inst_abc123/groups/120363012345678901@g.us/participants",
    {
      method: "POST",
      headers: {
        "X-Api-Key": "YOUR_API_KEY",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        participants: [
          "5511666665555@s.whatsapp.net",
          "5511555554444@s.whatsapp.net",
        ],
      }),
    }
  );
  ```
</CodeGroup>

### Kat\u0131l\u0131mc\u0131 \u00c7\u0131karma

Gruptan bir veya daha fazla kat\u0131l\u0131mc\u0131y\u0131 \u00e7\u0131kar\u0131n. Grup y\u00f6neticisi olman\u0131z gerekir.

```bash theme={null}
curl -X DELETE https://api.wappfy.io/api/instances/inst_abc123/groups/120363012345678901@g.us/participants \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "participants": [
      "5511666665555@s.whatsapp.net"
    ]
  }'
```

***

## Davet Kodlar\u0131

### Davet Kodu Alma

Grubun davet ba\u011flant\u0131s\u0131n\u0131 olu\u015fturun veya al\u0131n. Grup y\u00f6neticisi olman\u0131z gerekir.

```bash theme={null}
curl https://api.wappfy.io/api/instances/inst_abc123/groups/120363012345678901@g.us/invite-code \
  -H "X-Api-Key: YOUR_API_KEY"
```

**Yan\u0131t:**

```json theme={null}
{
  "data": {
    "invite_code": "https://chat.whatsapp.com/AbCdEfGhIjKlMn"
  }
}
```

### Davet Kodu ile Kat\u0131lma

Bir davet kodu kullanarak gruba kat\u0131l\u0131n.

```bash theme={null}
curl -X POST https://api.wappfy.io/api/instances/inst_abc123/groups/join \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "invite_code": "AbCdEfGhIjKlMn"
  }'
```

<Note>
  Tam URL'yi de\u011fil, yaln\u0131zca kod k\u0131sm\u0131n\u0131 ge\u00e7irin. `https://chat.whatsapp.com/AbCdEfGhIjKlMn` i\u00e7in `AbCdEfGhIjKlMn` ge\u00e7irin.
</Note>

***

## Gruplara Mesaj G\u00f6nderme

Bir gruba mesaj g\u00f6ndermek i\u00e7in grubun sohbet kimli\u011fiyle standart [mesaj g\u00f6nderme](/tr/guides/sending-messages) ucu noktas\u0131n\u0131 kullan\u0131n:

```bash theme={null}
curl -X POST https://api.wappfy.io/api/instances/inst_abc123/messages/send \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "chat_id": "120363012345678901@g.us",
    "type": "text",
    "text": "Hello team!"
  }'
```

Grup sohbet kimlikleri her zaman `@g.us` ile biter.

***

## Ucu Noktas\u0131 Referans\u0131

| Y\u00f6ntem | Ucu Noktas\u0131                                    | A\u00e7\u0131klama                                                  |
| ----------- | --------------------------------------------------- | ------------------------------------------------------------------- |
| `POST`      | `/api/instances/{id}/groups`                        | Yeni grup olu\u015ftur                                              |
| `GET`       | `/api/instances/{id}/groups`                        | T\u00fcm gruplar\u0131 listele                                      |
| `GET`       | `/api/instances/{id}/groups/{groupId}`              | Grup bilgisi al                                                     |
| `PATCH`     | `/api/instances/{id}/groups/{groupId}`              | Grup ad\u0131n\u0131/a\u00e7\u0131klamas\u0131n\u0131 g\u00fcncelle |
| `POST`      | `/api/instances/{id}/groups/{groupId}/leave`        | Gruptan ayr\u0131l                                                  |
| `GET`       | `/api/instances/{id}/groups/{groupId}/participants` | Kat\u0131l\u0131mc\u0131lar\u0131 listele                           |
| `POST`      | `/api/instances/{id}/groups/{groupId}/participants` | Kat\u0131l\u0131mc\u0131 ekle                                       |
| `DELETE`    | `/api/instances/{id}/groups/{groupId}/participants` | Kat\u0131l\u0131mc\u0131 \u00e7\u0131kar                            |
| `GET`       | `/api/instances/{id}/groups/{groupId}/invite-code`  | Davet kodunu al                                                     |
| `POST`      | `/api/instances/{id}/groups/join`                   | Davet koduyla kat\u0131l                                            |

***

## Hata Y\u00f6netimi

| Durum Kodu | A\u00e7\u0131klama                                                                                                                 |
| ---------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `403`      | Bu grubun y\u00f6neticisi de\u011filsiniz.                                                                                         |
| `404`      | Grup bulunamad\u0131 veya \u00f6rnek \u00fcye de\u011fil.                                                                          |
| `409`      | Kat\u0131l\u0131mc\u0131 zaten grupta (ekleme s\u0131ras\u0131nda) veya grupta de\u011fil (\u00e7\u0131karma s\u0131ras\u0131nda). |
| `422`      | Ge\u00e7ersiz kat\u0131l\u0131mc\u0131 format\u0131. `{phone}@s.whatsapp.net` kullan\u0131n.                                       |
