Postiva Teardown: A Self-Hosted Publishing Desk on Official Instagram and TikTok APIs
We got tired of per-seat SaaS pricing and third-party tokens for something as simple as scheduled posting. So we built Postiva: a self-hosted cockpit that drags media onto a calendar and auto-publishes through the platforms' official APIs. Here is the architecture, the queue design that never double-posts, and what the official APIs do and do not allow.
— ByHalil Berkay SahinEvery social scheduling SaaS wants a monthly seat fee, your OAuth tokens on their servers, and an upsell path. For an operator managing their own handful of accounts, that trade is bad: you pay forever for a cron job and you hand a third party the keys to your brand accounts. Postiva is our answer, a publishing desk you install once, on your own server, that talks directly to the platforms' official APIs. This post is the teardown of how it works.
The product surface is deliberately small. A media tray holds uploaded photos and videos as drafts. A weekly calendar is the primary UI: drag a draft onto Thursday 18:00 and it becomes a scheduled job. There is no team layer, no approval workflow, no analytics dashboard pretending to be a growth consultant. One operator, their accounts, a queue. Cutting scope this hard is what made it possible to ship the whole product in weeks rather than quarters.
Publishing runs through official channels only: Instagram's content publishing API on the Meta Graph platform, and TikTok's Content Posting API. No browser puppets, no reverse-engineered private endpoints, no session-cookie tricks. Official APIs are more restrictive (they define which media formats, aspect ratios, and caption lengths are allowed) but they are stable, documented, and they do not get your account banned. For a tool that touches real brand accounts, that trade is not negotiable.
The heart of the system is the publish queue, and its design goal is a single sentence: a post must go out exactly once, at the right time, or fail loudly. Every scheduled post becomes a job with an idempotency key. The worker claims a job, checkpoints each phase (media upload, container creation, publish call, verification), and records the platform's returned media ID. If the process dies mid-publish, the retry resumes from the last checkpoint and checks the platform first: if the post already exists, the job completes without posting again. Double-posting is the most embarrassing failure a scheduler can have, and this checkpoint-plus-verify loop is what prevents it.
Rate limiting is per-account, not global. Instagram caps content-publishing calls per account per day; TikTok has its own windows. Each account gets a token bucket, and the scheduler simply refuses to enqueue more than the platform will accept, surfacing the conflict at drag-time in the calendar instead of failing silently at 3 AM. Errors the operator can see at planning time are errors that never page anyone.
Tokens are the crown jewels, so they never leave the operator's server. OAuth tokens are encrypted at rest, refresh is automated with failure alerts, and the app manages only accounts the operator personally connected. Postiva is deliberately not a multi-tenant SaaS: no shared token vault, no cross-customer blast radius, no terms-of-service gray zone about who is posting on whose behalf.
The one AI feature earned its place: caption drafting with per-account voice. Each account has a short voice profile (tone, language, emoji policy, hashtag policy) and the assistant drafts a caption from the uploaded media using the operator's own LLM API key. The operator edits and approves; nothing auto-publishes text unseen. Bring-your-own-key keeps costs transparent and keeps us out of the business of metering tokens.
What this project says about build-vs-buy in 2026: when a SaaS category's core is a scheduler, a queue, and two API integrations, self-hosting has become a rational option for technical operators. The hard parts (idempotent queues, OAuth refresh, rate-limit modeling) are well-understood engineering. If your business runs on a tool like this, owning it outright can be cheaper than a year of seats. And if you want one built for your workflow, that is literally what we do; the full product story is on the Postiva page.
- 01Self-hosted beats SaaS when the core is a scheduler plus two API integrations: you pay once, own the tokens, and skip the per-seat treadmill.
- 02Official platform APIs only. More restrictive than scraping or browser automation, but stable, documented, and safe for real brand accounts.
- 03The queue is the product: idempotency keys, per-phase checkpoints, and a verify-before-retry loop are what guarantee a post publishes exactly once.
- 04Surface rate-limit conflicts at planning time in the calendar, not at publish time at 3 AM.
- 05AI captioning works as a bring-your-own-key assistant with per-account voice profiles, drafting for human approval, never auto-publishing unseen text.
Is Postiva a SaaS I can sign up for?
No. Postiva is single-operator by design: it is installed and operated privately, manages only accounts its operator owns, and stores tokens encrypted on the operator's own server. If you want a similar publishing desk for your own accounts or agency workflow, we build operator tools like this as client projects.
Does automated posting risk getting my Instagram or TikTok account banned?
Not when it runs through the official APIs. Postiva publishes via Instagram's content publishing API and TikTok's Content Posting API with per-account rate limiting, which is the sanctioned path for scheduled publishing. What gets accounts banned is browser automation, session-cookie tricks, and reverse-engineered private endpoints, and Postiva uses none of them.
How does Postiva guarantee a post is never published twice?
Every scheduled post is a job with an idempotency key, and the publish worker checkpoints each phase: media upload, container creation, publish call, verification. On any retry the worker first asks the platform whether the post already exists using the recorded media ID. If it does, the job completes without re-posting. Exactly-once publishing is a queue-design property, not a hope.
Can the AI write and publish captions automatically?
It drafts, it never ships. The assistant generates a caption from the uploaded media using the account's voice profile and the operator's own LLM API key, then the operator edits and approves it in the calendar. Nothing text-related is published without a human having seen it.
What stack is a tool like Postiva built on?
The pattern is a TypeScript web app with a job queue and a small worker: Next.js for the cockpit UI, Postgres for state, a checkpointed queue for publish jobs, and encrypted token storage. The same architecture fits any operator tool that talks to rate-limited third-party APIs on a schedule, which is a large fraction of the internal tools we get asked to build.
Let's apply this to your project.
A free 15-minute call. A technical assessment, not a sales pitch.