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

# Handle failed requests

> Choose the next step when a request fails.

With an [SDK](https://docs.ofauth.com/v3.md#official-sdks), read the recovery action on the error: `recoveryAction` in TypeScript or `recovery_action` in Python. For direct API calls, read `recovery.action` in the error response. Use that action to choose your next step. Save `requestId` if you need support. The [Errors reference](https://docs.ofauth.com/v3/api-reference/errors.md) explains the response fields and codes.

## Choose the next step

| Condition | Application behavior |
| - | - |
| Access token expired or invalid | Refresh once. If refresh returns `invalid_grant`, start authorization again. |
| The owner's approval is no longer valid | Stop using that access and let the owner approve it again. |
| OnlyFans session needs reconnect | Ask the account owner to reconnect. Refreshing an OAuth token cannot fix this state. |
| The account is no longer shared | Read the linked-account list again or ask the owner to share the account. |
| A required permission is missing | Ask the owner to approve that permission. |
| A request limit or daily Test limit is used up | Wait for the time given in the response before trying again. |
| A temporary sign-in or OnlyFans error | Try again only if the recovery action allows it. Limit attempts and wait longer after each failure. |
| The request or item is rejected | Fix the input or select a valid item before trying again. |

## Choose whether to try again

![If you do not know whether a change succeeded, check its result before sending it again. For an error response, follow recovery.action to refresh, reconnect, request permission, fix the input, or try again.](https://mintcdn.com/ofauth/VVqOdSxbrh7mDF0M/images/v3/request-recovery.svg?fit=max\&auto=format\&n=VVqOdSxbrh7mDF0M\&q=85\&s=bb52bbaec1d83911cfd38699da9c4106)

A network error does not prove that a post, story, or message failed. Follow `recovery.action` when the API returns an error. If you do not know the result, check for the new item before you send the request again.

## Separate OAuth and API errors

The token and revoke endpoints return OAuth errors such as `invalid_client` and `invalid_grant`. Access, Vault+, and linked-account endpoints return `error`, `recovery`, and `requestId` fields for your app to read.

A `401` does not always mean the OnlyFans account needs a new sign-in. The token may be invalid, the owner may have ended access, or the account may need to reconnect. Read the error to find the cause.

## Avoid repeating a change

For reads, limit the number of attempts and wait longer after each failure. Add a small random delay so your app instances do not all retry at once.

For requests that change data, check whether the first request succeeded before sending it again. Only use headers listed by the operation; do not assume the API detects repeated writes.

Independent instances can refresh the same stable client-bound token concurrently. Retry a lost refresh response with bounded backoff. An invalid refresh grant requires authorization again. See [refresh](https://docs.ofauth.com/v3/api-reference/link/tokens.md#refresh-the-access-token).

## Log details for support

Log the operation, HTTP status, `error`, `recovery.action`, and `requestId`. Include the request ID when you contact [support@ofauth.com](mailto:support@ofauth.com). Keep authorization headers, tokens, client secrets, and OnlyFans session data out of logs.


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