Skip to main content

Overview

The OFAuth API uses standard HTTP status codes with structured JSON error responses to provide clear, actionable feedback when things go wrong.

Error Response Format

All API errors return a consistent JSON structure:

Error Response Fields


HTTP Status Codes

Success Codes

Client Error Codes

Server Error Codes


Error Types

The type field in error responses will be one of the following:

Action Required Hints

Some errors include an actionRequired field suggesting how to resolve the issue:

Rate Limiting

When you hit a rate limit, the response includes:
  • HTTP Status: 429
  • Retry-After header: Seconds to wait before retrying

Handling Rate Limits

  1. Check for 429 status code
  2. Read the Retry-After header (defaults to 60 seconds if missing)
  3. Wait the specified duration before retrying
  4. Implement exponential backoff for repeated failures

Common Error Scenarios

Session Expired

When a user’s OnlyFans session expires:
Resolution: Redirect the user through the Link flow to re-authenticate.

Connection Not Found

When a connection ID doesn’t exist or has no session data:
Resolution: The connection may have been deleted or never completed. Create a new Link session for the user.

Service Unavailable

When there’s a temporary issue:
Resolution: Retry the request after a short delay. These errors are typically transient.

Error Handling Best Practices

Check the type field

Branch on the type field for programmatic handling, not the error message

Log requestId

Include requestId in logs and support requests for debugging

Handle session errors

Watch for SESSION_EXPIRED and SESSION_NOT_PROVIDED to trigger re-auth flows

Implement retries

Use exponential backoff for PROXY_ERROR, NETWORK_ERROR, and rate limits

Example Error Handler


Next Steps

Rate Limiting

Token bucket system and backoff strategies

Access API

Using the Access API

System Webhook Events

Get notified of connection status changes