---
title: "Rotate an invite — fresh link, old one dies"
description: "Revoke + re-mint in one transaction."
api_method: POST
api_path: "/v1/workspaces/{workspaceId}/invites/{inviteId}/rotate"
canonical_url: https://wiblo.app/docs/developers/api/invites/rotate-member-invite
last_updated: 2026-08-12T15:34:51+02:00
md_url: https://wiblo.app/docs/developers/api/invites/rotate-member-invite.md
---

# Rotate an invite — fresh link, old one dies

`POST /v1/workspaces/{workspaceId}/invites/{inviteId}/rotate`

Revoke + re-mint in one transaction. Backs BOTH copy-invitation (the owner did not copy the link, or wants a fresh one) and resend — the previous link stops working the moment this commits, including one already sitting in an inbox. Expired invites are rotatable (rotation is the control, not a short fuse); accepted invites refuse with `INVITE_ALREADY_USED`; revoked ones collapse to `INVITE_NOT_FOUND`. User-backed credentials only (session, JWT, CLI tokens); machine bearers are rejected — same machine-must-not-mint class as create. Workspace-scoped budget 10/10min.

## Path parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `workspaceId` | `string` | Yes |  |
| `inviteId` | `string` | Yes |  |

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `expires_in_days` | `integer \| null` | No |  |

## Request

**curl**

```bash
curl https://api.wiblo.app/v1/workspaces/{workspaceId}/invites/{inviteId}/rotate \
  -X POST \
  -H "Authorization: Bearer $WIBLO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "expires_in_days": 0
}'
```

**TypeScript**

```ts
import { createSdk, rotateMemberInvite } from "@workspace/sdk"

const sdk = createSdk({ baseUrl: "https://api.wiblo.app" })

const { data, error } = await rotateMemberInvite({
  client: sdk,
  path: { workspaceId: "...", inviteId: "..." },
  body: {
    "expires_in_days": 0
  },
})
```

## Responses

**`200`** — Fresh invite minted. `invite_token` appears here and nowhere else. Returns `MemberInviteMintResponse`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `invite_token` | `string` | Yes |  |
| `id` | `string` | Yes |  |
| `member_id` | `string` | Yes |  |
| `token_prefix` | `string` | Yes |  |
| `email` | `string \| null` | Yes |  |
| `email_delivery` | `"sent" \| "failed" \| "skipped"` | Yes |  |
| `expires_at` | `string` | Yes |  |
| `created_at` | `string` | Yes |  |

**`400`** — Request body failed Zod validation (`VALIDATION_FAILED`). Returns `ApiErrorEnvelope`.

**`401`** — No valid session cookie or user bearer was present. Returns `ApiErrorEnvelope`.

**`403`** — A machine bearer (`wbl_live_*` / `wbl_ephem_ws_*`) was presented, or the caller's live role is not owner/admin (`INSUFFICIENT_PRIVILEGE`). Returns `ApiErrorEnvelope`.

**`404`** — Caller has no active membership (`WORKSPACE_NOT_FOUND`), the invite does not exist here or was revoked (`INVITE_NOT_FOUND`), or the member row vanished (`MEMBER_NOT_FOUND`). Returns `ApiErrorEnvelope`.

**`409`** — The invite was already consumed (`INVITE_ALREADY_USED`), or the member got linked (`MEMBER_ALREADY_LINKED`) / archived (`MEMBER_NOT_INVITABLE`) meanwhile — rotation must not resurrect a claim on a settled row. Returns `ApiErrorEnvelope`.

**`422`** — Path param failed UUID validation (`INVALID_PARAMS`). An out-of-bounds `expires_in_days` is 400 `VALIDATION_FAILED` — the contract bounds match the DB gate, so the RPC's `INVALID_TTL` raise is unreachable through this API. Returns `ApiErrorEnvelope`.

**`429`** — Rate limit exceeded. The body's `error.code` is `RATE_LIMITED` and `error.details.retry_after` is the same number of seconds as the `Retry-After` header. Returns `ApiErrorEnvelope`.
