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

# Create a post

> Publish text and media, schedule posts, and add polls

Publish text or media to a creator’s feed, then save the returned post ID. Use the optional sections below only when you need pricing, scheduling, polls, or fundraising.

## Before you start

Ask the user to [authorize your app](https://docs.ofauth.com/v3/guides/link.md) with `posts:write`, which lets your app publish posts. For new uploads, also request `vault:write`. Use the returned access token and select a linked account the user shared with your app.

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!
})
```

Use this client for the rest of this guide. The SDK sends the access token and linked account ID for you.

## Publish text or media

```typescript theme={null}
const post = await client.access.posts.create({
	body: {
		text: "**New content**\n\nThanks for your support.",
		mediaItems: [789]
	}
})
```

Omit `mediaItems` for a text-only post. Save `post.id`. The response contains the created post. Its media is ready when `post.isMediaReady` is `true`.

The example’s `789` is an existing media ID from the selected creator’s Vault. Replace it with your own ID. Use [Vault IDs or finalized upload references](https://docs.ofauth.com/v3/guides/media-items.md) for attachments. Follow [Upload media](https://docs.ofauth.com/v3/guides/how-to/upload-media.md) for new files.

## Publish paid content

Pass this object as `body` to `client.access.posts.create()`:

```json theme={null}
{
	"text": "A preview and the complete set",
	"mediaItems": [789, 790, 791],
	"price": 9.99,
	"previewMediaCount": 1,
	"isLockedText": false
}
```

The first item is the preview. The remaining items require purchase. The API accepts prices from 0 to 200. OnlyFans determines whether paid posts are available for the account.

## Schedule publication

Add `scheduledDate` with an ISO timestamp and timezone, such as `2027-01-10T18:00:00.000Z`. You can also use milliseconds since January 1, 1970, UTC. Omit the field to publish immediately. Read the schedule through `/v3/access/queue/posts` after creation.

## Create a poll

```json theme={null}
{
	"text": "Which set comes next?",
	"poll": {
		"options": ["Studio", "Outdoors"],
		"type": 1,
		"dueDays": 3
	}
}
```

Add at least two options, each with some text. Set both `type` and `dueDays` to positive whole numbers. The API reference does not list every poll type. Use a type that works with your OnlyFans account.

## Set expiration or fundraising

Add `expireAfter` to expire a post after 1 to 30 days.

For fundraising, use `fundRaisingTargetAmount` of at least 10 and at most four `fundRaisingTipsPresets`:

```json theme={null}
{
	"text": "Help fund the next shoot",
	"fundRaisingTargetAmount": 100,
	"fundRaisingTipsPresets": [10, 20, 50]
}
```

## Set formatting and participants

`isMarkdown` defaults to `true`. Set it to `false` to send your text or HTML unchanged. See [Text formatting](https://docs.ofauth.com/v3/guides/how-to/text-formatting.md).

`releaseForms` contains `users`, `partners`, and `guests` arrays of numeric IDs. `userTags` also accepts numeric user IDs. See the [API reference](https://docs.ofauth.com/v3/api-reference.md) for the fields you can send.

## Edit or delete the post

Read the post and check `canEdit` or `canDelete`:

```typescript theme={null}
const current = await client.access.posts.get({ postId: 987654 })
```

Call `client.access.posts.update({ postId: 987654, body })` with the full post you want to keep. Updates accept the same fields as creation. Fields you leave out can return to their defaults. To keep attachments, use numeric Vault IDs.

Call `client.access.posts.delete({ postId: 987654 })` to delete the post. Check the response before removing the post from your app. If you do not know whether a create request succeeded, follow [V3 error recovery](https://docs.ofauth.com/v3/api-reference/errors.md) before trying again. A retry can create a second post.


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