Dogfooding: scheduling our own 90-day calendar through the GPTpost API

Written by

in

The posts you will see on GPTpost’s own accounts over the next three months were not entered by hand. We wrote a content calendar, and a short script scheduled it through the same agent API that every GPTpost plan includes. Here is how that works and what we learned setting it up.

The calendar file

Each entry in the calendar has a slot identifier, a time in UTC, and a version of the post for every network we publish to: a short cut for Bluesky, a slightly longer one for Mastodon, a titled article for WordPress and Lemmy, and so on. Writing the versions up front means the script never has to trim text, which is where automated posting usually goes wrong.

The script

  1. List the connected accounts with GET /api/v1/agent/accounts and keep only the ones meant for brand posts.
  2. For each calendar slot and account, create and schedule the post with POST /api/v1/agent/posts, including schedule_at.
  3. Send an Idempotency-Key built from the slot and the account, and record the result in a local state file.
  4. Pace the writes to stay under the documented limit of about 30 writes per minute, and back off when a 429 arrives with Retry-After.

Why idempotency matters here

A long run will hit a timeout or a rate limit at some point. Without an idempotency key, the safe-looking fix (run it again) creates duplicates. With one, re-running is boring: posts that exist are skipped, and new accounts are filled in. That also lets us connect another network later and simply run the same script again.

Same rules as people

The API does not bypass anything. Text over a network’s limit gets a 422 before anything is queued, approval workflows return a 409, and plan limits a 402. For our own account that was a useful check on the calendar itself.

Try it yourself

The API and the MCP server are on every plan and the 14-day trial. The docs and OpenAPI schema are public, so you can judge them before signing up. Start here: social media API for developers and AI agents.

https://oraglegpt.org/use-cases/social-media-api/?utm_source=facebook&utm_medium=social&utm_campaign=organic90

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *