Essentials
API Response Structure
Understand the Api JSON response format, including status codes, data fields, and message structures for developers.
All API responses from Fansly API follow a consistent JSON structure. This makes it easy to handle responses uniformly across your application.
Standard Response Format
Every API response contains the following fields:
| Field | Type | Description |
|---|---|---|
statusCode | number | HTTP status code of the response |
message | string | Human-readable message describing the result |
data | object | array | null | The response payload (varies by endpoint) |
timestamp | string | ISO 8601 timestamp of when the response was generated |
Success Response Example
{
"statusCode": 200,
"message": "Success",
"data": {
"id": "123456",
"username": "example_user",
"displayName": "Example User"
},
"timestamp": "2026-01-09T21:59:45.908Z"
}Error Response Example
When an error occurs, the response follows the same structure:
{
"statusCode": 400,
"message": "Invalid request parameters",
"data": null,
"timestamp": "2026-01-09T21:59:45.908Z"
}Response Headers
All API responses include the following HTTP headers:
| Header | Description |
|---|---|
Content-Type | Always application/json |
Common Status Codes
| Status Code | Message | Description |
|---|---|---|
200 | Success | Request completed successfully |
201 | Created | Resource was created successfully |
400 | Bad Request | Invalid request parameters |
401 | Unauthorized | Missing or invalid API key |
403 | Forbidden | API key doesn't have permission |
404 | Not Found | Resource not found |
429 | Too Many Requests | Rate limit exceeded |
500 | Internal Server Error | Server-side error |