> ## Documentation Index
> Fetch the complete documentation index at: https://www.rootset.app/llms.txt
> Use this file to discover all available pages before exploring further.

# rootset_rotate_workspace_key

> Rotate a workspace API key with bounded overlap; preserve permissions and expiry unless explicitly changed. Administrators only.

## Workflow

```mermaid theme={"system"}
flowchart LR
  discover["Check the account"] --> invoke["Rotate workspace key"]
  invoke --> outcome["Read the result"]
```

## Access and behavior

Requires a current workspace role of **Admin** or higher. Use a personal OAuth connection for the signed-in account. The connection needs `admin` scope.

* This tool changes data or starts work. Confirm the target and input before calling it.
* Keep the same `idempotencyKey` when retrying an unchanged request; use a new key for different input.

## Arguments

| Argument | Required | Type | Details |
| - | - | - | - |
| `orgId` | Yes | string | Organisation ID returned by rootset\_get\_context. |
| `id` | Yes | string | — |
| `overlapSeconds` | No | integer | — |
| `name` | No | string | — |
| `access` | No | "read" or "edit" | — |
| `includeAdmin` | No | boolean | — |
| `expiresAt` | No | string or null | — |
| `workspaceId` | Yes | string | Workspace ID returned by rootset\_list\_workspaces; required even for Default. |
| `idempotencyKey` | Yes | string | Stable caller-provided key across retries of this exact operation. |

> [accordion] Complete input schema
>
> ```json theme={"system"}
> {
>   "$schema": "https://json-schema.org/draft/2020-12/schema",
>   "type": "object",
>   "properties": {
>     "orgId": {
>       "type": "string",
>       "pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$"
>     },
>     "id": {
>       "type": "string",
>       "pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$"
>     },
>     "overlapSeconds": {
>       "type": "integer",
>       "minimum": 0,
>       "maximum": 86400
>     },
>     "name": {
>       "type": "string",
>       "minLength": 1,
>       "maxLength": 255
>     },
>     "access": {
>       "type": "string",
>       "enum": ["read", "edit"]
>     },
>     "includeAdmin": {
>       "type": "boolean"
>     },
>     "expiresAt": {
>       "anyOf": [
>         {
>           "type": "string",
>           "pattern": "^(?!0000)\\d{4}-\\d{2}-\\d{2}T(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d{1,3})?Z$",
>           "format": "date-time",
>           "description": "UTC instant with mandatory Z and at most three fractional digits.",
>           "examples": ["2024-01-01T12:30:00.000Z"]
>         },
>         {
>           "type": "null"
>         }
>       ]
>     },
>     "workspaceId": {
>       "type": "string",
>       "pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$"
>     },
>     "idempotencyKey": {
>       "type": "string",
>       "minLength": 8,
>       "maxLength": 255,
>       "description": "Stable caller-provided key across retries of this exact operation."
>     }
>   },
>   "required": ["orgId", "id", "workspaceId", "idempotencyKey"],
>   "additionalProperties": false
> }
> ```

## Example call

Your client initializes the MCP connection before this call. Example identifiers and values are illustrative; use the IDs, schema version and values from your installation.

```json theme={"system"}
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "rootset_rotate_workspace_key",
    "arguments": {
      "orgId": "01K6J7B8000000000000000000",
      "id": "01K6J7B8000000000000000000",
      "workspaceId": "01K6J7B8000000000000000000",
      "idempotencyKey": "example-request-0001"
    }
  }
}
```

## Result

Read the structured result returned by the tool. A tool failure sets `isError`; do not treat an error as a completed operation. The [REST operation](https://www.rootset.app/api-reference/rotateWorkspaceKey.md) documents the corresponding result fields and errors.

[Connect an MCP client](https://www.rootset.app/mcp-connections.md) · [Request conventions](https://www.rootset.app/api-reference/request-conventions.md)


## Related topics

- [Rotate workspace key](https://www.rootset.app/api-reference/rotateWorkspaceKey.md)
- [rootset_rotate_personal_key](https://www.rootset.app/mcp-reference/rootset_rotate_personal_key.md)
- [rootset_revoke_workspace_key](https://www.rootset.app/mcp-reference/rootset_revoke_workspace_key.md)
- [rootset_list_workspace_keys](https://www.rootset.app/mcp-reference/rootset_list_workspace_keys.md)
- [rootset_create_workspace_key](https://www.rootset.app/mcp-reference/rootset_create_workspace_key.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.