> ## 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.

# Posts and stories

> Publish a post or story and check that its media is ready

Publish a feed post, save its ID, and read that same post until its media is ready. Choose a story when you want to share one image instead.

| Your goal | Follow |
| - | - |
| Publish a free or paid feed post | [Create a post](https://docs.ofauth.com/v3/guides/how-to/create-post.md) |
| Schedule a post, add a poll, or set expiration | [Create a post](https://docs.ofauth.com/v3/guides/how-to/create-post.md) |
| Publish one image as a story | [Post a story](https://docs.ofauth.com/v3/guides/how-to/create-story.md) |
| Upload new attachments | [Upload media](https://docs.ofauth.com/v3/guides/how-to/upload-media.md) |
| Display attachments | [Display media](https://docs.ofauth.com/v3/guides/display-media.md) |

## Before you start

Ask the user to [authorize your app](https://docs.ofauth.com/v3/guides/link.md) with `posts:write` to publish and `posts:read` to read the post. These scopes are the permissions your app needs. Select a [linked account](https://docs.ofauth.com/v3/api-reference/account/linked-accounts.md). Install the [TypeScript SDK](https://docs.ofauth.com/v3/sdk/typescript.md) version 4. Create a client on your server:

```typescript theme={null}
import { OFAuthClient } from "@ofauth/onlyfans-sdk"

const client = new OFAuthClient({
	accessToken: process.env.ACCESS_TOKEN!,
	linkedAccountId: process.env.LINKED_ACCOUNT_ID!
})
```

Choose media already saved in the account’s Vault, or [upload a new file](https://docs.ofauth.com/v3/guides/how-to/upload-media.md). Use its Vault ID or completed upload reference in the request. See [Media references](https://docs.ofauth.com/v3/guides/media-items.md) for both formats.

## Publish posts

Follow [Create a post](https://docs.ofauth.com/v3/guides/how-to/create-post.md) to build the request body. To publish a free post with media from the Vault, call `client.access.posts.create()`. Replace `789` with your media ID:

```typescript theme={null}
const created = await client.access.posts.create({
	body: {
		text: "**New set** is available.",
		mediaItems: [789]
	}
})
console.log({ postId: created.id, isMediaReady: created.isMediaReady })
```

Save `created.id` before the next step. The response also includes `text`, `rawText`, `media`, `mediaCount`, `postedAt`, and `isMediaReady`. The post now exists, but its attachments may still be processing.

![Create a post and save its ID. Read that same post until its media is ready, then display it.](https://mintcdn.com/ofauth/VVqOdSxbrh7mDF0M/images/v3/post-readiness.svg?fit=max\&auto=format\&n=VVqOdSxbrh7mDF0M\&q=85\&s=7afb7ac33b9b538e52537692e686c85b)

If you do not know whether the request succeeded, check for the post before sending it again. Follow [V3 error recovery](https://docs.ofauth.com/v3/api-reference/errors.md). To wait for media, read the existing post instead of creating another one.

## Read posts

Read the saved ID with `client.access.posts.get()`. This example reads the same post up to six times, five seconds apart:

```typescript theme={null}
let post = { id: created.id, text: created.text, isMediaReady: created.isMediaReady }
for (let attempt = 0; !post.isMediaReady && attempt < 6; attempt += 1) {
	await new Promise(resolve => setTimeout(resolve, 5000))
	post = await client.access.posts.get({ postId: created.id })
}
console.log({ postId: post.id, text: post.text, isMediaReady: post.isMediaReady })
```

When `isMediaReady` is `true`, follow [Display media](https://docs.ofauth.com/v3/guides/display-media.md) to show an attachment. For example, the console result can be `{ postId: 987654, text: "New set is available.", isMediaReady: true }`. The returned text can include formatting.

If `isMediaReady` is still `false`, keep the post ID and check again later. The six checks limit how long this example waits. Processing can take longer. A failed read does not delete the post.

To find existing posts, read `/v3/access/posts?limit=20&sortBy=publish_date&sortDirection=desc`. Lists use `{ items, page }`. Read posts from `items`. If `page.hasMore` is `true`, send `page.nextCursor` as the next request’s `cursor`. Keep the same filters. Use the [API reference](https://docs.ofauth.com/v3/api-reference.md) for media filters, sorting, and cursor formats.

## Manage existing content

Check `canEdit` and `canDelete` in the response before showing edit or delete actions. Follow [Create a post](https://docs.ofauth.com/v3/guides/how-to/create-post.md#edit-or-delete-the-post) for updates and deletion. Updates accept the same fields as creation. Send the full post you want to keep. Fields you leave out can return to their defaults. To keep attachments, use numeric Vault IDs. A used upload reference cannot be used again.

For scheduled posts, read `/v3/access/queue/posts` to check the schedule. A scheduled post can have ready media before it appears on the feed.

## Publish image stories

Use `stories:write` and follow [Post a story](https://docs.ofauth.com/v3/guides/how-to/create-story.md) for the complete story workflow and result checks. Story creation accepts exactly one image: a Vault image ID or a finalized image upload reference. Edit the image before uploading it. Stories do not accept videos, GIFs, media URLs, canvas settings, questions, or image edits in the request.

After publication, use [earnings and analytics](https://docs.ofauth.com/v3/guides/earnings.md) to measure performance. Use [Realtime events](https://docs.ofauth.com/v3/guides/realtime-onlyfans-events.md) for publication activity and the [API reference](https://docs.ofauth.com/v3/api-reference.md) for comments, viewers, statistics, and other content actions.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.