> ## 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.

# Resumen

> Crea y administra grupos de WhatsApp

**Auth:** `TokenAccount` o `TokenInstance` en cada ruta. Cada llamada valida la propiedad de la instancia.

Esta sección cubre todas las rutas `/api/group/*`: creación, listado, detalles, gestión de participantes, actualización de metadatos, restablecimiento del enlace de invitación, unión y salida. Para comunidades (grupos padre), consulta [Comunidades](/es/api/communities/overview).

## Endpoints

| Método | Ruta                                | Función                                                                                      |
| ------ | ----------------------------------- | -------------------------------------------------------------------------------------------- |
| POST   | `/api/group/create/:instance`       | [Crear grupo](/es/api/groups/create)                                                         |
| GET    | `/api/group/list/:instance`         | [Listar grupos](/es/api/groups/list)                                                         |
| GET    | `/api/group/info/:instance`         | [Detalles del grupo](/es/api/groups/info)                                                    |
| PUT    | `/api/group/update/:instance`       | [Actualizar nombre / descripción / imagen / permisos](/es/api/groups/update)                 |
| POST   | `/api/group/participants/:instance` | [Agregar / eliminar / promover / degradar / aprobar / rechazar](/es/api/groups/participants) |
| POST   | `/api/group/join/:instance`         | [Unirse mediante código / enlace](/es/api/groups/join)                                       |
| POST   | `/api/group/resetLink/:instance`    | [Revocar y regenerar el enlace de invitación](/es/api/groups/reset-link)                     |
| GET    | `/api/group/requests/:instance`     | [Listar solicitudes pendientes](/es/api/groups/requests)                                     |
| DELETE | `/api/group/leave/:instance`        | [Salir del grupo](/es/api/groups/leave)                                                      |

## Identificadores aceptados

La mayoría de los endpoints aceptan un campo `identifier`, que puede ser:

| Forma                | Ejemplo                               |
| -------------------- | ------------------------------------- |
| JID del grupo        | `120363406289005073@g.us`             |
| Código de invitación | `ABC123XYZ`                           |
| Enlace completo      | `https://chat.whatsapp.com/ABC123XYZ` |

<Warning>
  **Excepciones:**

  * `POST /api/group/join` acepta **solo** un código o enlace (no JID).
  * `GET /api/community/listSubGroups` requiere un JID en la query `?communityJid=`.
</Warning>

## Estructuras de datos

### `GroupInfo`

Respuesta estándar para las rutas de creación y actualización.

```json theme={null}
{
  "name": "Dev Team",
  "jid": "120363406289005073@g.us",
  "description": "Technical discussions",
  "inviteCode": "ABC123XYZ",
  "inviteLink": "https://chat.whatsapp.com/ABC123XYZ",
  "createdBy": "5511999999999@s.whatsapp.net",
  "participantCount": 3,
  "participants": [
    { "jid": "5511999999999@s.whatsapp.net", "isAdmin": true, "isSuperAdmin": false }
  ],
  "groupSettings": {
    "membersCanEditInfo": true,
    "membersCanSendMessages": true,
    "membersCanAddOthers": false,
    "requireAdminApproval": false
  },
  "isCommunity": false,
  "isParent": false,
  "linkedParentJid": null
}
```

### `GroupDetail`

Respuesta de [`GET /info`](/es/api/groups/info). Incluye campos adicionales más allá de `GroupInfo`: `image`, `createdAt`, `metadata` (autor del último cambio de nombre / descripción), `isEphemeral`, `isIncognito`, `isSuspended`, `isDefaultSubGroup`.

### `GroupPermissions`

| Campo                    | Tipo | Significado en WhatsApp      |
| ------------------------ | ---- | ---------------------------- |
| `membersCanEditInfo`     | bool | Inverso de `IsLocked`        |
| `membersCanSendMessages` | bool | Inverso de `IsAnnounce`      |
| `membersCanAddOthers`    | bool | `MemberAddMode == AllMember` |
| `requireAdminApproval`   | bool | `IsJoinApprovalRequired`     |

## Envoltorio de error

Todas las rutas usan el envoltorio estándar de la API:

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

## Referencia de errores (resumen)

| Categoría     | Mensaje                                                                         |
| ------------- | ------------------------------------------------------------------------------- |
| Auth          | `Not authorized to view group requests (must be admin)`                         |
| Auth          | `Not authorized to perform this action (must be admin)`                         |
| Auth          | `Not authorized to update this group (must be admin)`                           |
| Auth          | `Not authorized to reset group invite link (must be admin)`                     |
| Auth          | `Not allowed to join this group`                                                |
| Auth          | `Not allowed to leave this group`                                               |
| Validación    | `Identifier is required`                                                        |
| Validación    | `At least one participant is required`                                          |
| Validación    | `Invalid action. Must be one of: add, remove, promote, demote, approve, reject` |
| Identificador | `failed to resolve group from identifier (not a valid JID, code, or link)`      |
| Identificador | `invalid group JID <jid>: <reason>`                                             |
| Identificador | `not a group JID`                                                               |
| Estado        | `Instance is not connected to WhatsApp`                                         |
| Estado        | `Group not found or you are not a member of this group`                         |
| Invitación    | `Invite link has been revoked or expired`                                       |
| Invitación    | `Invalid invite link or code`                                                   |
| Throttle      | `rate limit exceeded (429): wait before creating again`                         |

## Siguiente

<CardGroup cols={2}>
  <Card title="Crear grupo" icon="users-rectangle" href="/es/api/groups/create">
    Crea un nuevo grupo con participantes iniciales.
  </Card>

  <Card title="Listar grupos" icon="list" href="/es/api/groups/list">
    Devuelve todos los grupos de la instancia.
  </Card>
</CardGroup>
