# Rotate a WhatsApp group's invite link

`POST /v1/whatsapp/groups/{group_id}/invite-link/rotate`

Issues a new invite link for the group. Every link issued before stops
working, so anyone still holding one cannot join. Rotate the link when a
link has spread further than you intended, or after removing someone you do
not want back.

Rotating is not how you read the current link: the group carries its
`invite_link`, so
`GET /v1/whatsapp/groups/{group_id}` is the read.
Only an `active` group has a link to rotate; any other status returns a `409`
`WhatsAppGroupNotActive`.

Like pinning and unpinning, this answers `200` rather than `202`.
WhatsApp issues the new link in its own reply and sends no webhook for a
rotation, so the link in the response is the rotation itself having
happened, not an acknowledgement that it will.

## Code samples

**TypeScript**

```ts
const link = await bird.whatsapp.groups.inviteLink.rotate("wag_01krdgeqcxet5s7t44vh8rt9mg");
console.log(link.invite_link); // every earlier link has stopped working
```

Examples: [TypeScript](/docs/api/reference/rotate-whatsapp-group-invite-link.ts.md) · [Python](/docs/api/reference/rotate-whatsapp-group-invite-link.py.md) · [Go](/docs/api/reference/rotate-whatsapp-group-invite-link.go.md) · [PHP](/docs/api/reference/rotate-whatsapp-group-invite-link.php.md) · [CLI](/docs/api/reference/rotate-whatsapp-group-invite-link.cli.md) · [MCP](/docs/api/reference/rotate-whatsapp-group-invite-link.mcp.md) · [cURL](/docs/api/reference/rotate-whatsapp-group-invite-link.curl.md)

## Example response `200`

```json
{
  "invite_link": "https://chat.whatsapp.com/JZm4S9tCkQx2LpVr7Ny8Ab"
}
```

## Path parameters

- `group_id` (string): ID of the group whose invite link is being replaced.

## Response body

- `invite_link` (string, required): The group's one invite link. Every link the group had before this one stops working.

## Related resources

- [Should I use a Bird SDK or call the API directly?](/explained/platform/should-i-use-an-sdk-or-call-the-api-directly) (answer)
- [Build your first integration](/learn/paths/integration) (course)
- [Send your first email](/docs/get-started/send-your-first-email) (docs)

[Get an implementation brief](/learn/workspace?topic=api-basics)
