PermuteDocs
Go to Permute

Access requests · accessRequestsCreate

Request access for the current caller

Records a seven-day request without granting access or confirming resource existence. Duplicate pending requests reuse the original request. Whole-resource grants only; app sessions remain bounded by app grants.

POST/v1/access-requests
betaauthenticatedworkspace

When to use

Ask for access for the current user or API key after a denied resource read.

For agents

Submission does not confirm that a resource exists or grant access. App sessions still require both caller and app grants (a request cannot widen either). Requests expire after seven days.

Example

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

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

const client = orgClient.withWorkspace(process.env.PERMUTE_WORKSPACE_ID!);

const result = await client.accessRequests.create({
  "resourceId": "dbas_abcdefghijklmnopqrstuvwx",
  "level": "read",
  "reason": "Read customer accounts for support."
});

Request body

json
{
  "resourceId": "dbas_abcdefghijklmnopqrstuvwx",
  "level": "read",
  "reason": "Read customer accounts for support."
}

Response

json
{
  "data": {
    "id": "task_abcdefghijklmnopqrstuvwx",
    "resourceId": "dbas_abcdefghijklmnopqrstuvwx",
    "resourceType": "database",
    "principalType": "apiKey",
    "principalId": "apikey_example",
    "level": "read",
    "reason": "Read customer accounts for support.",
    "status": "pending",
    "createdAt": "2026-10-27T12:00:00.000Z",
    "expiresAt": "2026-11-03T12:00:00.000Z"
  }
}