> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ofauth.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Content & Posts

> Create posts, schedule content, and manage stories

## 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
* **Audience Polling**: Publish posts with polls and collect fan preferences
* **Story Automation**: Auto-post stories and manage ephemeral content

***

## Quick Example

Create a new post:

<CodeGroup>
  ```javascript Node.js theme={null}
  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)
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api.ofauth.com/v2/access/posts",
      headers={
          "apikey": "YOUR_API_KEY",
          "x-connection-id": "conn_abc123",
          "Content-Type": "application/json"
      },
      json={
          "text": "New content just dropped! 🔥",
          "mediaItems": [123, 456]
      }
  )
  print("Post created:", response.json()["id"])
  ```
</CodeGroup>

***

## Common Operations

### List Posts

Get posts from a user (use `me` for your own account):

```javascript theme={null}
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

```javascript theme={null}
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:

```javascript theme={null}
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:

```javascript theme={null}
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)
  })
})
```

### Create Poll Post

```javascript theme={null}
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: "What should I post next?",
    poll: {
      options: ["Behind the scenes", "Full set preview"],
      type: 1,
      dueDays: 7
    }
  })
})
```

### Edit a Post

```javascript theme={null}
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

```javascript theme={null}
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/posts`                | POST   | 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}/posts` | GET    | List user's posts |

<Card title="Full API Reference" icon="book" href="/api-reference/access/overview">
  See complete endpoint documentation
</Card>

***

## Query Parameters

### List Posts Query

| Parameter           | Type    | Default         | Description                                        |
| ------------------- | ------- | --------------- | -------------------------------------------------- |
| `limit`             | number  | 10              | Results per page (1-10)                            |
| `sortBy`            | string  | "publish\_date" | Sort by: `publish_date`, `tips`, `favorites_count` |
| `sortDirection`     | string  | "desc"          | Sort direction: `asc`, `desc`                      |
| `pinned`            | boolean | false           | Include pinned posts only                          |
| `includePostCounts` | boolean | false           | Include engagement counters                        |
| `beforePublishTime` | string  | -               | Pagination cursor (ISO date)                       |

***

## Create Post Options

| Field                     | Type                | Description                                                                    |
| ------------------------- | ------------------- | ------------------------------------------------------------------------------ |
| `text`                    | string              | Post caption (supports [markdown](/guides/how-to/text-formatting))             |
| `mediaItems`              | (number\|string)\[] | Media references (see [`mediaItems` reference](/guides/media-items))           |
| `price`                   | number              | PPV price ($3-$200, optional)                                                  |
| `isLockedText`            | boolean             | Lock text behind paywall                                                       |
| `previewMediaCount`       | number              | How many `mediaItems` are previews. Uses the first N items from left to right. |
| `scheduledDate`           | string              | ISO date for scheduled posting                                                 |
| `poll`                    | object              | Poll config with `options`, `type`, and `dueDays`                              |
| `expireAfter`             | number              | Days until post expires (1-30)                                                 |
| `fundRaisingTargetAmount` | number              | Fundraising goal (min \$10)                                                    |
| `fundRaisingTipsPresets`  | number\[]           | Tip amount presets (max 4)                                                     |

<Info>
  For all accepted `mediaItems` values and validation rules, see the [`mediaItems` reference](/guides/media-items).
</Info>

<Info>
  For poll posts, use the managed `poll` object. OFAuth translates it to the upstream OnlyFans poll fields automatically.
</Info>

***

## Post Data Structure

Each post object includes:

```json theme={null}
{
  "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

<Tip>
  **Media First**: Always upload media to the vault first using the `/uploads/init` flow, then reference the media IDs in `mediaItems` when creating posts.
</Tip>

<Info>
  **Scheduling**: Scheduled posts are stored in OnlyFans' queue. Use `scheduledDate` as an ISO 8601 date string.
</Info>

<Warning>
  **Content Guidelines**: All content posted through OFAuth must comply with OnlyFans' terms of service. Violations can result in account suspension.
</Warning>

***

## Related Guides

<CardGroup cols={2}>
  <Card title="Media & Vault" icon="photo-film" href="/guides/media">
    Upload media before creating posts
  </Card>

  <Card title="Messaging & Chats" icon="messages" href="/guides/messaging">
    Share content via direct messages
  </Card>
</CardGroup>
