What You Can Build
Content Schedulers : Plan and queue posts for optimal times
Cross-Platform Publishing : Sync content across multiple accounts
Content Management Systems : Organize, tag, and track post performance
Story Automation : Auto-post stories and manage ephemeral content
Quick Example
Create a new post:
const response = await fetch ( "https://api.ofauth.com/v2/access/posts" , {
method: "POST" ,
headers: {
apikey: "YOUR_API_KEY" ,
"x-connection-id" : "conn_abc123" ,
"Content-Type" : "application/json"
},
body: JSON . stringify ({
text: "New content just dropped! 🔥" ,
mediaItems: [ 123 , 456 ] // Media IDs from vault
})
})
const post = await response . json ()
console . log ( "Post created:" , post . id )
Common Operations
List Posts
Get posts from a user (use me for your own account):
const response = await fetch ( "https://api.ofauth.com/v2/access/users/me/posts" , {
headers: {
apikey: "YOUR_API_KEY" ,
"x-connection-id" : "conn_abc123"
}
})
const posts = await response . json ()
Get Post Details
const response = await fetch ( "https://api.ofauth.com/v2/access/posts/POST_ID" , {
headers: {
apikey: "YOUR_API_KEY" ,
"x-connection-id" : "conn_abc123"
}
})
const post = await response . json ()
// Returns full post with media, likes, comments, etc.
Schedule a Post
Create a post to be published later:
const response = await fetch ( "https://api.ofauth.com/v2/access/posts" , {
method: "POST" ,
headers: {
apikey: "YOUR_API_KEY" ,
"x-connection-id" : "conn_abc123" ,
"Content-Type" : "application/json"
},
body: JSON . stringify ({
text: "Coming tomorrow! 🎉" ,
mediaItems: [ 123 ],
scheduledDate: "2024-12-25T12:00:00Z"
})
})
Create PPV Post
Post with pay-per-view pricing:
const response = await fetch ( "https://api.ofauth.com/v2/access/posts" , {
method: "POST" ,
headers: {
apikey: "YOUR_API_KEY" ,
"x-connection-id" : "conn_abc123" ,
"Content-Type" : "application/json"
},
body: JSON . stringify ({
text: "Exclusive content 🔒" ,
mediaItems: [ 123 , 456 ],
price: 14.99 // PPV price ($3-$200)
})
})
Edit a Post
const response = await fetch ( "https://api.ofauth.com/v2/access/posts/POST_ID" , {
method: "PUT" ,
headers: {
apikey: "YOUR_API_KEY" ,
"x-connection-id" : "conn_abc123" ,
"Content-Type" : "application/json"
},
body: JSON . stringify ({
text: "Updated caption! ✨" ,
mediaItems: [ 123 ]
})
})
Delete a Post
const response = await fetch ( "https://api.ofauth.com/v2/access/posts/POST_ID" , {
method: "DELETE" ,
headers: {
apikey: "YOUR_API_KEY" ,
"x-connection-id" : "conn_abc123"
}
})
API Endpoints
Endpoint Method Description /v2/access/postsPOST Create a new post /v2/access/posts/{postId}GET Get post details /v2/access/posts/{postId}PUT Edit a post /v2/access/posts/{postId}DELETE Delete a post /v2/access/users/{userId}/postsGET List user’s posts
Full API Reference See complete endpoint documentation
Query Parameters
List Posts Query
Parameter Type Default Description limitnumber 10 Results per page (1-10) sortBystring ”publish_date” Sort by: publish_date, tips, favorites_count sortDirectionstring ”desc” Sort direction: asc, desc pinnedboolean false Include pinned posts only includePostCountsboolean false Include engagement counters beforePublishTimestring - Pagination cursor (ISO date)
Create Post Options
Field Type Description textstring Post caption (supports markdown) mediaItems(number|string)[] Media references (see below) pricenumber PPV price (3 − 3- 3 − 200, optional) isLockedTextboolean Lock text behind paywall previewMediaCountnumber Number of preview media items scheduledDatestring ISO date for scheduled posting expireAfternumber Days until post expires (1-30) fundRaisingTargetAmountnumber Fundraising goal (min $10) fundRaisingTipsPresetsnumber[] Tip amount presets (max 4)
The mediaItems array accepts:
Format Example Description Vault Media ID 12345Direct OnlyFans vault media ID Vault ID (string) "12345"Auto-converted to number Upload Reference "ofauth_upload_abc..."mediaUploadId from upload flowURL "https://..."External HTTP/HTTPS URL
You can pass the mediaUploadId from the upload flow directly - the API resolves it to the vault ID automatically. Upload references are single-use.
Post Data Structure
Each post object includes:
{
"id" : 123456 ,
"text" : "Post caption here" ,
"postedAt" : "2024-01-15T10:30:00Z" ,
"price" : null ,
"isPinned" : false ,
"likesCount" : 42 ,
"commentsCount" : 5 ,
"media" : [
{
"id" : 789 ,
"type" : "photo" ,
"files" : {
"full" : { "url" : "https://media.ofauth.com/..." , "width" : 1920 , "height" : 1080 }
}
}
]
}
Tips & Best Practices
Media First : Always upload media to the vault first using the /uploads/init flow, then reference the media IDs in mediaItems when creating posts.
Scheduling : Scheduled posts are stored in OnlyFans’ queue. Use scheduledDate as an ISO 8601 date string.
Content Guidelines : All content posted through OFAuth must comply with OnlyFans’ terms of service. Violations can result in account suspension.