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

# Authentication and permissions

> Use access tokens, select an account, and request the permissions each feature needs.

Your backend is the server that runs your app's private code. It sends an access token to prove that your app has permission to make a request. OAuth is the process that asks an account owner to approve this access.

The owner chooses which accounts and permissions to share. OFAuth saves that approval as an authorization. Follow [Connect an account](https://docs.ofauth.com/v3/guides/link.md) to get tokens and linked account IDs.

## Headers

The [SDKs](https://docs.ofauth.com/v3.md#official-sdks) send these headers for you. Set the access token and linked account when creating the client:

| Header | Value |
| - | - |
| `Authorization` | `Bearer <access_token>`. Put `Bearer ` before the token. Required on Access, Vault+, and linked-account requests. |
| `x-linked-account-id` | An account shared with this authorization. Required on Access and Vault+ requests. |
| `Content-Type` | `application/json` for JSON request bodies. Token requests use form encoding instead. |

```typescript theme={null}
import { OFAuthClient } from "@ofauth/onlyfans-sdk"

const client = new OFAuthClient({
  accessToken: process.env.ACCESS_TOKEN!,
  linkedAccountId: process.env.LINKED_ACCOUNT_ID!
})
const profile = await client.access.profile.get()
```

The account ID selects an account. The token grants access. An account ID alone does not authorize a request. Linked-account management routes identify the account in the URL and need only the bearer token.

To get or revoke tokens, your backend sends its client ID and secret using `client_secret_basic` or form `client_secret_post`, one method per request. It sends form fields, not JSON. See [Tokens and refresh](https://docs.ofauth.com/v3/api-reference/link/tokens.md).

## Access tokens

Access tokens are opaque and expire after 15 minutes. Code exchanges include a stable client-bound refresh token. Independent servers can refresh concurrently and retry a lost refresh response. See [Tokens and refresh](https://docs.ofauth.com/v3/api-reference/link/tokens.md).

## Scopes

A scope names a permission, such as `messages:read`. Read and write scopes are separate. Request both when your feature reads and writes a resource.

![An inbox that reads conversations and sends messages requests both messages:read and messages:write. Write access does not include read access.](https://mintcdn.com/ofauth/VVqOdSxbrh7mDF0M/images/v3/read-write-permissions.svg?fit=max\&auto=format\&n=VVqOdSxbrh7mDF0M\&q=85\&s=0d26a707615b40f6c9d038f01771434a)

Request only the scopes you need. The user sees each permission on the approval screen. `identity:read` grants the person’s OFAuth profile. This scope does not grant an OnlyFans account action.

| Scope | Grants |
| - | - |
| `identity:read` | Read the consenting person’s OFAuth name, email, and profile image through [User info](https://docs.ofauth.com/v3/api-reference/link/userinfo.md). |
| `profile:read` | Read the profile, including the OnlyFans account ID, counts, links, settings, and release forms. |
| `profile:write` | Update the profile, links, social buttons, settings, release forms. |
| `notifications:read` | Read notifications and unread counts. |
| `notifications:write` | Mark notifications as read. |
| `posts:read` | Read posts, comments, buyers, tips, bookmarks. |
| `posts:write` | Create, edit, delete, pin, archive posts; manage comments and bookmarks. |
| `stories:read` | Read stories, highlights, viewers, stats. |
| `stories:write` | Create and delete stories and highlights; like, watch, block. |
| `queue:read` | Read scheduled posts, messages, and saved-for-later items. |
| `queue:write` | Publish or delete queued items. |
| `messages:read` | Read chats, messages, chat media, mass messages, templates. |
| `messages:write` | Send, delete, pin, like messages; mute or hide chats; send mass messages. |
| `subscribers:read` | Read subscribers, activity, awards, subscription history. |
| `subscribers:write` | Set notes, display names, and discounts for subscribers. |
| `subscriptions:read` | Read the accounts this user subscribes to. |
| `subscriptions:write` | Subscribe and hide or show posts from subscriptions. |
| `users:read` | Look up users, search, friends, blocked and restricted lists. |
| `users:write` | Block, unblock, restrict, unrestrict users. |
| `lists:read` | Read user lists, fans and following lists, labels. |
| `lists:write` | Create, edit, sort, delete lists; add or remove members; manage labels. |
| `promotions:read` | Read promotions, bundles, offers, tracking links, trial links. |
| `promotions:write` | Create, end, delete promotions, bundles, tracking links, trial links. |
| `analytics:read` | Read profile, post, story, stream, message, promotion, and traffic analytics. |
| `finances:read` | Read earnings, transactions, chargebacks, payouts, referrals. |
| `vault:read` | Read vault media and vault lists. |
| `vault:write` | Upload media; create, edit, delete vault lists; hide media. |

Each operation's reference page shows its required scope. The [OAuth discovery document](https://docs.ofauth.com/v3/api-reference/link/tokens.md#discovery) lists every supported scope in `scopes_supported`.

## Missing permissions

`missing_scope` means the token does not include a required scope. `additional_consent_required` means the selected account has not granted it. Follow [Request more access](https://docs.ofauth.com/v3/guides/request-access.md) to ask the owner to approve the required scopes.

Keep credentials and accounts separate by [environment](https://docs.ofauth.com/v3/api-reference/environments.md). See [Security](https://docs.ofauth.com/v3/reference/security.md) for storage and callback requirements.

## Developer and Operator authority

Developer OAuth connects other people’s accounts using the application’s Developer entitlement and billing. Owners need no Operator subscription. Losing only an owner’s Operator plan does not end Developer grants.

Operator requests share Access URLs and methods but use the authorized holder’s Operator allowance, exact accounts, live membership, capabilities, and confirmations. Operator authority excludes Realtime and Vault+. OnlyFans vault operations in Access are distinct from Vault+. The account header selects a resource and cannot choose the payer. An MCP token needs the correct API audience; recognizing its issuer alone does not authorize API access.


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