Skip to main content

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

EndpointMethodDescription
/v2/access/postsPOSTCreate a new post
/v2/access/posts/{postId}GETGet post details
/v2/access/posts/{postId}PUTEdit a post
/v2/access/posts/{postId}DELETEDelete a post
/v2/access/users/{userId}/postsGETList user’s posts

Full API Reference

See complete endpoint documentation

Query Parameters

List Posts Query

ParameterTypeDefaultDescription
limitnumber10Results per page (1-10)
sortBystring”publish_date”Sort by: publish_date, tips, favorites_count
sortDirectionstring”desc”Sort direction: asc, desc
pinnedbooleanfalseInclude pinned posts only
includePostCountsbooleanfalseInclude engagement counters
beforePublishTimestring-Pagination cursor (ISO date)

Create Post Options

FieldTypeDescription
textstringPost caption (supports markdown)
mediaItems(number|string)[]Media references (see below)
pricenumberPPV price (33-200, optional)
isLockedTextbooleanLock text behind paywall
previewMediaCountnumberNumber of preview media items
scheduledDatestringISO date for scheduled posting
expireAfternumberDays until post expires (1-30)
fundRaisingTargetAmountnumberFundraising goal (min $10)
fundRaisingTipsPresetsnumber[]Tip amount presets (max 4)

mediaItems Formats

The mediaItems array accepts:
FormatExampleDescription
Vault Media ID12345Direct OnlyFans vault media ID
Vault ID (string)"12345"Auto-converted to number
Upload Reference"ofauth_upload_abc..."mediaUploadId from upload flow
URL"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.