> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended**:
> ```bash
> npx @scalekit-inc/cli setup
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for 40+ agents.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Resource consents

List and revoke the consents your end users grant against a resource
{/* The `sdk-client-page` and `sdk-method-section` wrappers are required raw
    elements, not layout decoration: `@/styles/sdk-reference.css` scopes every
    ClassBrowser override under `.sdk-client-page` so the styles survive
    ClientRouter navigation, and `.sdk-method-section` frames each method block.
    No Starlight component emits these hooks. */}

<div class="sdk-client-page">

When an end user allows an API client to act on their behalf against a resource, such as an MCP server, Scalekit records that grant as a consent. Use `scalekit.resources` to read those consents and revoke them from your own admin screens instead of the Scalekit dashboard.

Each consent identifies the user by `externalUserId`—the identifier your application supplied when the consent was granted. The same audit and revoke actions are available in the dashboard under [Managing MCP clients](/authenticate/mcp/managing-mcp-clients/).

### listUserConsents
<div class="sdk-method-section">
  
    
      

      Lists the end-user consents granted against a resource, with pagination. Use this to audit who authorized a client, and to find the `consentId` you need before revoking.

      Filter by user in one of two ways. Pass `userIds` to match external user IDs exactly and case-sensitively. Pass `search` for a case-insensitive substring match. When you give both, `userIds` wins and `search` is ignored.

      
        The resource whose consents to list (format: `res_...`).
      
      
        Optional fields: `search`, `pageSize` (max 30), `pageToken`, `userIds` (max 25, takes precedence over `search`).
      
      
        Consents with `id`, `externalUserId`, `clientId`, `clientName`, `scopes`, and `grantedAt`, plus `totalSize` and the `nextPageToken` / `prevPageToken` cursors.
      

```typescript wrap showLineNumbers=false
const res = await scalekit.resources.listUserConsents('res_abc123', {
  pageSize: 20,
  userIds: ['user_456'], // optional; takes precedence over search
});

console.log(res.totalSize, res.nextPageToken);
for (const consent of res.consents) {
  console.log(consent.id, consent.externalUserId, consent.clientId, consent.scopes);
}
```

    
  
</div>

### revokeUserConsent
<div class="sdk-method-section">
  
    
      

      Revokes a single end-user consent held by an API client. The client is prompted for consent again on its next authorization attempt, and every active refresh token issued to that client for the same user is revoked.

      Access tokens that Scalekit already issued stay valid until they expire. See [How revocation affects active access tokens](/authenticate/mcp/managing-mcp-clients/#how-revocation-affects-active-access-tokens) for ways to shorten that window.

      
        The API client that holds the consent (format: `m2m_...`), not the resource ID.
      
      
        The consent to revoke (format: `usrcnst_...`), taken from `listUserConsents`.
      
      
        Empty response on success. The call throws on failure.
      

```typescript wrap showLineNumbers=false
await scalekit.resources.revokeUserConsent('m2m_abc123', 'usrcnst_xyz789');
```

    
  
</div>

</div>


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
