PermuteDocs
Go to Permute

Permissions · permissionsUpdate

Edit an existing explicit permission grant

Updates access or expiry on this grant without changing its recipient, resource or scope. Omitted fields are preserved; null expiry removes the deadline. Requires current grant-management and delegation authority. expectedUpdatedAt prevents overwriting a changed or removed grant. Built-in membership rules and unsupported scoped grants cannot be edited. Hosted app, delegated action, MCP and connector sessions are excluded.

PATCH/v1/permissions/{permissionId}
betaauthenticatedorganization

When to use

Edit access or expiry on an existing grant without replacing its recipient or scope.

For agents

Read the grant first and pass its returned updatedAt as expectedUpdatedAt. Omitted fields stay unchanged; null expiry removes the deadline. A changed or removed grant returns a conflict or not-found response. Refresh and review before retrying. Current delegation authority still applies; default member access and unsupported scoped grants cannot be edited.

Example

typescript
import { PermuteClient } from '@permute/sdk';

const orgClient = new PermuteClient({
  apiKey: process.env.PERMUTE_API_KEY!,
});

const result = await orgClient.permissions.update("perm_abcdefghijklmnopqrstuvwx", { expectedUpdatedAt: "2026-10-30T12:00:00.000Z", expiresAt: null });

Request body

json
{
  "expectedUpdatedAt": "2026-10-30T12:00:00.000Z",
  "expiresAt": null
}

Response

json
{
  "data": {
    "id": "perm_abcdefghijklmnopqrstuvwx",
    "principalType": "apiKey",
    "principalId": "apikey_example",
    "resourceId": "dbas_abcdefghijklmnopqrstuvwx",
    "resourceType": "database",
    "subResourceId": null,
    "level": "read",
    "operations": null,
    "organizationId": "org_abcdefghijklmnopqrstuvwx",
    "workspaceId": "wksp_abcdefghijklmnopqrstuvwx",
    "grantedBy": "user_abcdefghijklmnopqrstuvwx",
    "expiresAt": null,
    "createdAt": "2026-10-30T12:00:00.000Z",
    "updatedAt": "2026-10-30T12:00:00.000Z"
  }
}