/v1/permissionsWhen to use
Give a person, API key, app or membership principal access to a resource.
For agents
Uses the same authorization as Give access. POST replaces an existing matching subject/resource/scope grant, including expiry; omitted expiry clears it. Named operations are independent and cannot exceed the caller’s authority. For additive changes, read and reconcile the existing grant first. Granting a user email does not send an invitation. API keys and apps need their own grants; creator access does not transfer.
Example
import { PermuteClient } from '@permute/sdk';
const orgClient = new PermuteClient({
apiKey: process.env.PERMUTE_API_KEY!,
});
const result = await orgClient.permissions.create({
"principalType": "apiKey",
"principalId": "apikey_example",
"resourceId": "dbas_abcdefghijklmnopqrstuvwx",
"resourceType": "database",
"level": "read"
});Request body
{
"principalType": "apiKey",
"principalId": "apikey_example",
"resourceId": "dbas_abcdefghijklmnopqrstuvwx",
"resourceType": "database",
"level": "read"
}Response
{
"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"
}
}