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
| Field | Type | Description |
|---|---|---|
error | string | Human-readable error message for developers |
type | string | Machine-readable error type for programmatic handling |
requestId | string | Unique request identifier for debugging and support |
actionRequired | string | Optional hint for how to resolve the error |
HTTP Status Codes
Success Codes
| Code | Description | When Used |
|---|---|---|
200 | OK | Request successful, data returned |
201 | Created | Resource successfully created |
204 | No Content | Request successful, no data to return |
Client Error Codes
| Code | Description | Action Required |
|---|---|---|
400 | Bad request | Fix request format/data |
401 | Session expired or invalid | Re-authenticate user |
404 | Route or resource not found | Check endpoint URL |
429 | Rate limit exceeded | Wait and retry |
Server Error Codes
| Code | Description | Action Required |
|---|---|---|
500 | Unknown error | Retry or contact support |
502 | Proxy error | Retry after delay |
503 | Network error | Retry after delay |
Error Types
Thetype field in error responses will be one of the following:
| Type | HTTP Status | Description | Action Required |
|---|---|---|---|
UNAUTHORIZED | 401 | Missing or invalid API key | Check API key |
SESSION_NOT_PROVIDED | 401 | Connection not found or missing session data | Re-authenticate user via Link |
SESSION_EXPIRED | 401 | User session has expired | Re-authenticate user via Link |
FORBIDDEN | 403 | Insufficient permissions | Check connection permissions |
RULES_OUTDATED | 401 | Dynamic rules need updating | Retry—OFAuth handles this automatically |
BAD_REQUEST | 400 | Invalid request parameters | Fix request format/data |
RESOURCE_NOT_FOUND | 404 | Requested resource not found | Check resource ID |
ROUTE_NOT_FOUND | 404 | Endpoint path not found | Check endpoint URL |
RATE_LIMIT_EXCEEDED | 429 | Request rate limit exceeded | Wait and retry with backoff |
UPLOAD_ERROR | 502 | Media upload failed | Retry upload |
UNKNOWN_ERROR | 500/503 | Unexpected or temporary error | Retry or contact support |
Action Required Hints
Some errors include anactionRequired field suggesting how to resolve the issue:
| Action | Description |
|---|---|
relink_connection | Connection expired—user needs to re-authenticate via Link |
verify_identity | ID verification required—prompt user to complete verification on OnlyFans |
refresh_rules | Dynamic rules are outdated (retry automatically) |
try_again | Transient error—retry the request |
Rate Limiting
When you hit a rate limit, the response includes:- HTTP Status:
429 Retry-Afterheader: Seconds to wait before retrying
Handling Rate Limits
- Check for
429status code - Read the
Retry-Afterheader (defaults to 60 seconds if missing) - Wait the specified duration before retrying
- Implement exponential backoff for repeated failures
Common Error Scenarios
Session Expired
When a user’s OnlyFans session expires:Connection Not Found
When a connection ID doesn’t exist or has no session data:Service Unavailable
When there’s a temporary issue:Error Handling Best Practices
Check the type field
Branch on the
type field for programmatic handling, not the error messageLog requestId
Include
requestId in logs and support requests for debuggingHandle session errors
Watch for
SESSION_EXPIRED and SESSION_NOT_PROVIDED to trigger re-auth flowsImplement retries
Use exponential backoff for
PROXY_ERROR, NETWORK_ERROR, and rate limits