> ## 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.

# How Do I Handle Expired or Revoked OnlyFans Accounts?

> Handle expired or revoked OnlyFans accounts in OFAuth: linked account status, lifecycle webhooks, recovery.action, stable refresh tokens, and re-authorization.

To handle expired or revoked OnlyFans accounts with OFAuth, watch two things: the linked account `status` (`connected`, `needs_reconnect`, or `disconnected`) and the lifecycle webhooks that report changes. When an Access call fails, branch on the error's `recovery.action`. An expired OnlyFans session needs the account owner to reconnect; a revoked authorization or a failed refresh with `invalid_grant` needs a new authorization.

There are two different things that can stop working. The OnlyFans session behind one linked account can expire, while your access to it remains. Or your access itself can end: the owner revokes your app, removes an account, or a credential is revoked or expires.

## Frequently Asked Questions

**What does `needs_reconnect` mean?** The OnlyFans session for that linked account is no longer usable, but your access remains. Access calls return `linked_account_reconnect_required`. The owner must reconnect, and you receive `linked_account.reconnected` when it works again. The linked account id stays the same.

**Can two instances refresh together?** Yes. The authenticated client uses the same stable refresh token. Each successful refresh returns its own access token. Retry a lost refresh response with the same token.

**What does `invalid_grant` on refresh mean?** The credential expired, was revoked, or does not belong to the authenticated client. Restart authorization for that customer. A transient network or storage error does not prove revocation.

**If I ask for more scopes, do I get a new authorization?** An existing authorization keeps its `authorization_id`. New consent adds permissions to the selected accounts. You receive `authorization.updated` with `reason: "consent_updated"`.

**How long does a refresh token last?** 90 days without a successful authenticated refresh. Resource requests do not extend the window.

## What do the linked account statuses mean?

| Status | Meaning | What to do |
| - | - | - |
| `connected` | Usable. | Call Access normally. |
| `needs_reconnect` | The OnlyFans session ended. Your access remains. | Pause work and ask the owner to reconnect. |
| `disconnected` | The owner disconnected the account. | Stop calling Access for it. |

Read the current status from `GET /v3/linked-accounts` or `GET /v3/linked-accounts/{id}`.

## Which webhooks tell me something changed?

| Event | Reason values | Handling |
| - | - | - |
| `linked_account.expired` | `provider_session_expired` | Mark the account `needs_reconnect`. Pause jobs. |
| `linked_account.reconnected` | `reconnected` | Resume jobs. |
| `linked_account.disconnected` | `owner_removed`, `owner_disconnected`, `owner_deleted`, `developer_deleted` | Remove the account from your records. |
| `authorization.revoked` | `holder_revoked`, `oauth_revocation`, `integration_deleted`, `integration_suspended` | Delete stored refresh tokens. The user must authorize again. |
| `authorization.updated` | `consent_updated`, `auto_added` | Add and remove accounts; re-read scopes when `scopes_changed` is `true`. |

```ts theme={null}
async function onLifecycleEvent(event: any) {
  const { data } = event
  switch (event.type) {
    case "linked_account.expired":
      return db.accounts.update(data.linked_account_id, { status: "needs_reconnect" })
    case "linked_account.reconnected":
      return db.accounts.update(data.linked_account_id, { status: "connected" })
    case "linked_account.disconnected":
      return db.accounts.remove(data.linked_account_id)
    case "authorization.revoked":
      await db.sessions.deleteByAuthorization(data.authorization_id)
      return db.users.markReauthorizationRequiredByAuthorization(data.authorization_id)
    case "authorization.updated":
      await db.accounts.add(data.authorization_id, data.added_linked_account_ids ?? [])
      return db.accounts.removeMany(data.removed_linked_account_ids ?? [])
  }
}
```

`db` stands in for your persistence layer. Deduplicate on `eventId` and apply events per linked account in `order` before calling this.

## How do I recover from an Access error?

Read the error’s recovery action, then choose the matching next step:

| Recovery action | Next step |
| - | - |
| `obtain_external_oauth_token` | Let your auth system obtain a valid access token. |
| `reconnect_linked_account` | Pause that account and start a [targeted reconnect](https://docs.ofauth.com/v3/guides/reconnect.md). |
| `restart_authorization` | Pause work for the authorization and ask the user to approve access again. |
| `request_additional_consent` or `grant_linked_account` | Ask the user to approve the needed account and permissions. |
| `list_linked_accounts` | Refresh the shared account list and ask the user to select an available account. |
| `retry` or `retry_after_reset` | Follow the retry timing in [Handle failed requests](https://docs.ofauth.com/v3/reference/error-handling.md). |
| `contact_integration_owner` | Ask the integration owner to resolve its account or configuration issue. |

Log `requestId` with failures so support can trace the request. Before repeating a post, story, or message whose outcome is uncertain, check whether it completed.

## How do I refresh across processes?

Let your auth framework or application persist tokens and supply a current access token to the SDK. Refresh with the same stable client-bound token. No mandatory database lock, attempt marker, or replay journal is needed. Use conditional writes when the customer replaces or disconnects a registration.

Include the client and application user in your storage key. An unavailable Developer plan or suspended client needs action by the application owner, not new customer consent.

## How do I bring the user back?

For `restart_authorization`, `invalid_grant`, or `authorization.revoked`, send the user through the [authorization flow](https://docs.ofauth.com/v3/api-reference/link/authorize.md) again. If you only lost a refresh token, the user sees the accounts and scopes they already approved. Request the permissions needed by your feature. Consent adds permissions only to the accounts the user selects. Check the current account grants before continuing.

## Learn More

* [Linked accounts](https://docs.ofauth.com/v3/api-reference/account/linked-accounts.md#linked-account-status)
* [Tokens and refresh](https://docs.ofauth.com/v3/api-reference/link/tokens.md#refresh-the-access-token)
* [Webhooks](https://docs.ofauth.com/v3/api-reference/system-webhook-events.md)
* [Errors](https://docs.ofauth.com/v3/api-reference/errors.md)
* [Authorize](https://docs.ofauth.com/v3/api-reference/link/authorize.md#requesting-more-scopes-or-accounts-later)
* [How Do I Receive OnlyFans Webhooks?](https://docs.ofauth.com/v3/agents/playbooks/onlyfans-webhooks.md)
* [How Do I Add OnlyFans Login to a Next.js App?](https://docs.ofauth.com/v3/agents/playbooks/nextjs-onlyfans-login.md)


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