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

# Create community

> Create a community (parent group), optionally linking existing groups in the same call

**Auth:** `TokenAccount` or `TokenInstance` • **Rate-limit:** `Global` (100/min) • **Idempotent:** no

## Description

Creates a community (parent group with an automatic Announcements group). Optionally accepts a description, picture, and a list of existing groups to link during creation. Each link has a **1s delay** between calls to avoid throttling from the WhatsApp server.

<Warning>
  If the WhatsApp server rejects the creation as a parent (`400`), the service performs an **automatic fallback** to a regular group. The response comes back with `isCommunity: false` and a notice in `message`.
</Warning>

## Examples

### Minimum

Creates the community with only the required `name` ("Alpha Community"), with no description, picture, or subgroups linked in the call.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://ryzeapi.cloud/api/community/create/$Instance_Name" \
    -H "token: $Token_Instance" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Alpha Community"
    }'
  ```

  ```javascript JavaScript theme={null}
  await fetch(`https://ryzeapi.cloud/api/community/create/${process.env.Instance_Name}`, {
    method: "POST",
    headers: {
      "token":        process.env.Token_Instance,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      name: "Alpha Community"
    })
  });
  ```

  ```python Python theme={null}
  import os, requests

  requests.post(
      f"https://ryzeapi.cloud/api/community/create/{os.environ['Instance_Name']}",
      headers={
          "token":        os.environ["Token_Instance"],
          "Content-Type": "application/json"
      },
      json={
          "name": "Alpha Community"
      }
  )
  ```

  ```go Go theme={null}
  package main

  import (
      "net/http"
      "os"
      "strings"
  )

  func main() {
      body := strings.NewReader(`{
          "name": "Alpha Community"
      }`)
      req, _ := http.NewRequest("POST", "https://ryzeapi.cloud/api/community/create/"+os.Getenv("Instance_Name"), body)
      req.Header.Set("token", os.Getenv("Token_Instance"))
      req.Header.Set("Content-Type", "application/json")
      http.DefaultClient.Do(req)
  }
  ```
</CodeGroup>

### With subgroups

Creates the community "XYZ Company" with description, picture, and links 2 existing groups (`groupJid`) as subgroups, plus sets `membershipApprovalMode: request_required` so joins require approval.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://ryzeapi.cloud/api/community/create/$Instance_Name" \
    -H "token: $Token_Instance" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "XYZ Company",
      "description": "Official community",
      "image": "https://example.com/community.png",
      "groupJid": [
        "120363406289005074@g.us",
        "120363406289005075@g.us"
      ],
      "membershipApprovalMode": "request_required"
    }'
  ```

  ```javascript JavaScript theme={null}
  await fetch(`https://ryzeapi.cloud/api/community/create/${process.env.Instance_Name}`, {
    method: "POST",
    headers: {
      "token":        process.env.Token_Instance,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      name:        "XYZ Company",
      description: "Official community",
      image:       "https://example.com/community.png",
      groupJid: [
        "120363406289005074@g.us",
        "120363406289005075@g.us"
      ],
      membershipApprovalMode: "request_required"
    })
  });
  ```

  ```python Python theme={null}
  import os, requests

  requests.post(
      f"https://ryzeapi.cloud/api/community/create/{os.environ['Instance_Name']}",
      headers={
          "token":        os.environ["Token_Instance"],
          "Content-Type": "application/json"
      },
      json={
          "name":        "XYZ Company",
          "description": "Official community",
          "image":       "https://example.com/community.png",
          "groupJid": [
              "120363406289005074@g.us",
              "120363406289005075@g.us"
          ],
          "membershipApprovalMode": "request_required"
      }
  )
  ```

  ```go Go theme={null}
  package main

  import (
      "net/http"
      "os"
      "strings"
  )

  func main() {
      body := strings.NewReader(`{
          "name": "XYZ Company",
          "description": "Official community",
          "image": "https://example.com/community.png",
          "groupJid": [
              "120363406289005074@g.us",
              "120363406289005075@g.us"
          ],
          "membershipApprovalMode": "request_required"
      }`)
      req, _ := http.NewRequest("POST", "https://ryzeapi.cloud/api/community/create/"+os.Getenv("Instance_Name"), body)
      req.Header.Set("token", os.Getenv("Token_Instance"))
      req.Header.Set("Content-Type", "application/json")
      http.DefaultClient.Do(req)
  }
  ```
</CodeGroup>

## Success response

Returns the freshly created community in `group`, where `group.jid` is the community's JID (use it as `communityJid` in subsequent calls) and `isCommunity: true` confirms WhatsApp accepted the creation as a parent group. Groups passed in `groupJid` are processed in order and split into `linkedGroups` (success) and `failedGroups` (failure). If an `image` was sent but failed to apply, the reason appears in `imageError` without aborting the creation.

```json 200 OK theme={null}
{
  "success": true,
  "message": "Community created successfully",
  "linkedGroups": ["120363406289005074@g.us"],
  "failedGroups": [],
  "imageError": "",
  "group": {
    "name": "Alpha Community",
    "jid": "120363406289005073@g.us",
    "description": "Official community",
    "inviteCode": "ABC123XYZ",
    "inviteLink": "https://chat.whatsapp.com/ABC123XYZ",
    "createdBy": "5511999999999@s.whatsapp.net",
    "participantCount": 1,
    "participants": [
      { "jid": "5511999999999@s.whatsapp.net", "isAdmin": true, "isSuperAdmin": true }
    ],
    "isCommunity": true,
    "isParent": true
  }
}
```

## Path parameters

<ParamField path="instance" type="string" required>
  Instance name (e.g., `$Instance_Name`).
</ParamField>

## Headers

<ParamField header="token" type="string" required>
  `TokenAccount` or `TokenInstance`.
</ParamField>

<ParamField header="Content-Type" type="string" required>
  `application/json`
</ParamField>

## Request body

<ParamField body="name" type="string" required>
  Community name. Max **25 characters**.
</ParamField>

<ParamField body="description" type="string">
  Community description.
</ParamField>

<ParamField body="image" type="string">
  URL or base64. Converted to JPEG. An image failure does **not** abort the creation, it is reported in `imageError`.
</ParamField>

<ParamField body="groupJid" type="string[]">
  List of `@g.us` JIDs of existing groups to link as subgroups.
</ParamField>

<ParamField body="membershipApprovalMode" type="string">
  `request_required` (subgroups require approval by default) or empty string (open).
</ParamField>

## Notes

<Note>
  * The community is born **with no participants**, members join via each subgroup.
  * The **Announcements group** is created automatically by WhatsApp. You do not control its name / description here, use [`PUT /api/group/update`](/en/api/groups/update) afterwards to adjust it.
  * Limit of **50 subgroups** per community (extras land in `failedGroups`).
  * `imageError` is populated when the picture fails but the community is still created normally.
  * Silent fallback to regular group: monitor `isCommunity` on the client side to alert the user.
</Note>

## Errors

| HTTP | Message                                                 |
| ---- | ------------------------------------------------------- |
| 400  | `community name is required`                            |
| 400  | `Community name must be 25 characters or less`          |
| 400  | `Instance is not connected to WhatsApp`                 |
| 429  | `rate limit exceeded (429): wait before creating again` |
| 500  | `failed to create community: <reason>`                  |

Envelope:

```json theme={null}
{
  "success": false,
  "error": { "message": "community name is required" }
}
```

## Next

<CardGroup cols={2}>
  <Card title="Link groups" icon="link" href="/en/api/communities/link">
    Add more subgroups after creation.
  </Card>

  <Card title="List subgroups" icon="list" href="/en/api/communities/list-subgroups">
    Check the currently linked groups.
  </Card>
</CardGroup>
