How to Schedule OnlyFans Posts Programmatically
Schedule OnlyFans posts programmatically to run a content calendar from code instead of the app: queue a post now, let it publish at a set time. This guide walks the full flow with ofapis — token, optional media, create, verify.
Step 1 — Get a token
Create an ofapis_sk_... token in the dashboard (start free) and store it server-side. Every call carries it as a Bearer header. See authentication for how the token and account connection fit together.
Step 2 — (Optional) upload media
If the post has an image or video, upload it to the vault first and keep the returned mediaId:
curl -X POST https://api.ofapis.com/api/public/v1/accounts/42/media \
-H "Authorization: Bearer ofapis_sk_..." \
-F "[email protected]"
Response:
{ "data": { "mediaId": 987654321, "contentType": "image/jpeg", "filename": "photo.jpg" } }
Text-only posts skip this step. See the vault & media API.
Step 3 — Create the scheduled post
POST the vault mediaFiles (the ids you kept above) and a future scheduledAt. Use ISO-8601 in UTC:
curl -X POST \
https://api.ofapis.com/api/public/v1/accounts/42/scheduled/posts \
-H "Authorization: Bearer ofapis_sk_..." \
-H "Content-Type: application/json" \
-d '{
"mediaFiles": [88123],
"scheduledAt": "2026-06-20T18:00:00Z"
}'
The scheduled-posts body takes vault mediaFiles and a scheduledAt — captions live on scheduled DMs (POST /accounts/{id}/scheduled/messages, which accepts text). A success spends one credit and returns the new id:
{ "data": { "id": 222333444 } }
In Python:
import requests
r = requests.post(
"https://api.ofapis.com/api/public/v1/accounts/42/scheduled/posts",
headers={"Authorization": "Bearer ofapis_sk_..."},
json={"mediaFiles": [88123], "scheduledAt": "2026-06-20T18:00:00Z"},
)
print(r.status_code, r.json()["data"]["id"])
Step 4 — Verify and manage the queue
Read counters to see how full the queue is, then delete a post by id if plans change:
curl https://api.ofapis.com/api/public/v1/accounts/42/scheduled/posts/counters \
-H "Authorization: Bearer ofapis_sk_..."
curl -X DELETE \
https://api.ofapis.com/api/public/v1/accounts/42/scheduled/posts/222333444 \
-H "Authorization: Bearer ofapis_sk_..."
Common errors
| Status | Meaning | Fix |
|---|---|---|
400 |
scheduledAt in the past or bad format |
Send a future UTC ISO-8601 timestamp |
401 |
Missing or revoked token | Reissue the key in the dashboard |
404 |
Unknown accountId or mediaId |
Confirm the account is connected; re-upload media |
429 |
Rate limit hit | Back off; check your plan's rpm on pricing |
Failed calls are not charged — only a successful create costs a credit.
FAQ
What timezone does scheduledAt use?
Always send UTC in ISO-8601 (2026-06-20T18:00:00Z). ofapis stores the exact instant, so convert from the creator's local time before posting.
How far in advance can I schedule a post?
Any future timestamp is accepted. Teams commonly queue weeks ahead; use the counters endpoint to watch queue depth.
Can I schedule the same post across multiple accounts?
Yes. Address each account with its own scoped route (/accounts/{id}/scheduled/posts) and repeat the create call per account. Multi-account plans start at Pro.
Does a scheduled post cost a credit when it publishes?
No. You pay one credit when the create call succeeds. Publishing at the scheduled time is handled by ofapis and is not a separate charge.