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

# Join Group

> Join a group via invite code or link

**Auth:** `TokenAccount` or `TokenInstance` • **Rate-limit:** `Global` (100/min) • **Idempotent:** partial (repeated calls on an open group return the same `groupJid`)

## Description

Joins a group from an invite **code** (`ABC123XYZ`) or full **link** (`https://chat.whatsapp.com/ABC123XYZ`). If the group has `requireAdminApproval=true`, the join is queued and returns `requiresApproval: true`.

<Warning>
  Unlike the other routes, `/join` **does not accept a JID** as the identifier, only a code or link.
</Warning>

## Examples

### By link

Joins the group by passing the full link (`https://chat.whatsapp.com/ABC123XYZ`) in `identifier`. The service extracts the code automatically and attempts the join.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://ryzeapi.cloud/api/group/join/$Instance_Name" \
    -H "token: $Token_Instance" \
    -H "Content-Type: application/json" \
    -d '{
      "identifier": "https://chat.whatsapp.com/ABC123XYZ"
    }'
  ```

  ```javascript JavaScript theme={null}
  await fetch(`https://ryzeapi.cloud/api/group/join/${process.env.Instance_Name}`, {
    method: "POST",
    headers: {
      "token":        process.env.Token_Instance,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      identifier: "https://chat.whatsapp.com/ABC123XYZ"
    })
  });
  ```

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

  requests.post(
      f"https://ryzeapi.cloud/api/group/join/{os.environ['Instance_Name']}",
      headers={
          "token":        os.environ["Token_Instance"],
          "Content-Type": "application/json"
      },
      json={
          "identifier": "https://chat.whatsapp.com/ABC123XYZ"
      }
  )
  ```

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

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

  func main() {
      body := strings.NewReader(`{
          "identifier": "https://chat.whatsapp.com/ABC123XYZ"
      }`)
      req, _ := http.NewRequest("POST", "https://ryzeapi.cloud/api/group/join/"+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>

### By code

Joins the group by passing only the raw code (`ABC123XYZ`) in `identifier`. Useful when you already extracted the code from the link in another flow.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://ryzeapi.cloud/api/group/join/$Instance_Name" \
    -H "token: $Token_Instance" \
    -H "Content-Type: application/json" \
    -d '{
      "identifier": "ABC123XYZ"
    }'
  ```

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

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

  requests.post(
      f"https://ryzeapi.cloud/api/group/join/{os.environ['Instance_Name']}",
      headers={
          "token":        os.environ["Token_Instance"],
          "Content-Type": "application/json"
      },
      json={
          "identifier": "ABC123XYZ"
      }
  )
  ```

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

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

  func main() {
      body := strings.NewReader(`{
          "identifier": "ABC123XYZ"
      }`)
      req, _ := http.NewRequest("POST", "https://ryzeapi.cloud/api/group/join/"+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

The `groupJid` identifies the group the instance has joined (or attempted to join). When `requiresApproval: true`, the join has **not** yet taken effect, it is awaiting manual approval from an admin; check the pending queue with [`/requests`](/en/api/groups/requests). When `false`, the instance is already a member and can send/receive messages.

```json 200 OK theme={null}
{
  "success": true,
  "message": "Successfully joined the group",
  "groupJid": "120363406289005073@g.us",
  "requiresApproval": false
}
```

```json 200 OK (with manual approval) theme={null}
{
  "success": true,
  "message": "Join request sent successfully. Waiting for admin approval.",
  "groupJid": "120363406289005073@g.us",
  "requiresApproval": true
}
```

## Path parameters

<ParamField path="instance" type="string" required>
  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="identifier" type="string" required>
  Invite code (`ABC123XYZ`) or full link (`https://chat.whatsapp.com/ABC123XYZ`).
</ParamField>

## Notes

<Note>
  * `requiresApproval: true` means you have **not** yet joined, your request is in the queue listed by [`/requests`](/en/api/groups/requests) until an admin approves it.
  * When the link has been revoked by an admin (via [`/resetLink`](/en/api/groups/reset-link)), the old code stops working immediately.
  * To preview the group without joining, use [`GET /info`](/en/api/groups/info) with the link as the `identifier`.
</Note>

## Errors

| HTTP | Message                                   |
| ---- | ----------------------------------------- |
| 400  | `Invalid invite link or code`             |
| 400  | `Invite link has been revoked or expired` |
| 403  | `Not allowed to join this group`          |
| 404  | `Group not found`                         |

Envelope:

```json theme={null}
{
  "success": false,
  "error": { "message": "Invite link has been revoked or expired" }
}
```
