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

# Reset Invite Link

> Revoke the current invite link and generate a new code / link for the group

**Auth:** `TokenAccount` or `TokenInstance` • **Rate-limit:** `Global` (100/min) • **Idempotent:** no (each call generates a different code)

## Description

Revokes the group's current invite link and generates a new one. **Only admins** can call. Use it whenever you suspect the link has leaked or after removing a member you do not want back.

## Examples

### Reset link

Revokes the current invite link of the group `120363406289005073@g.us` and generates a new code. The old link stops working immediately.

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

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

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

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

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

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

  func main() {
      body := strings.NewReader(`{
          "identifier": "120363406289005073@g.us"
      }`)
      req, _ := http.NewRequest("POST", "https://ryzeapi.cloud/api/group/resetLink/"+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 new `inviteCode` and `inviteLink`, both already active. The old link stops working immediately, replace any copies in onboarding flows, marketing materials, or printed QR codes.

```json 200 OK theme={null}
{
  "success": true,
  "message": "Group invite link reset successfully",
  "groupJid": "120363406289005073@g.us",
  "inviteCode": "NEW123XYZ",
  "inviteLink": "https://chat.whatsapp.com/NEW123XYZ"
}
```

## 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>
  Group JID, invite code, or link.
</ParamField>

## Notes

<Note>
  * The old link stops working immediately, anyone who has not yet joined receives `Invite link has been revoked or expired`.
  * To just **query** the current link without revoking it, use [`GET /info`](/en/api/groups/info) and read `group.inviteLink`.
  * For more severe compromise scenarios (compromised admin), also revoke admin from anyone who should not have it via [`/participants`](/en/api/groups/participants) with `action=demote`.
</Note>

## Errors

| HTTP | Message                                                     |
| ---- | ----------------------------------------------------------- |
| 400  | `Identifier is required`                                    |
| 403  | `Not authorized to reset group invite link (must be admin)` |
| 404  | `Group not found or you are not a member of this group`     |

Envelope:

```json theme={null}
{
  "success": false,
  "error": { "message": "Not authorized to reset group invite link (must be admin)" }
}
```
