One API call. Every platform.
PostAgent is a social media scheduler designed for AI agents. Create an API key, then a single POST schedules a post to any combination of X, LinkedIn, Facebook, Instagram, YouTube and TikTok. If your agent reads /llms.txt it can learn this entire API on its own.
Authentication
Bearer API keys, created at /developers. Keys are shown once and stored hashed.
Authorization: Bearer sk_live_...
Create a post
Schedule for later with schedule_at, publish immediately by omitting it, or hold as a draft with "status": "draft". Pass an Idempotency-Key header so retries never double-post.
curl https://postagent.pro/api/v1/posts \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-H "Idempotency-Key: launch-1" \
-d '{
"content": "We just shipped something new ๐",
"media": [{"url": "https://example.com/launch.png", "type": "image"}],
"targets": [
"x",
{"platform": "linkedin", "content": "A longer, more professional version for LinkedIn."}
],
"schedule_at": "2026-07-08T09:00:00Z"
}'A bare platform name targets the user's only account on that platform. With several accounts, pass {"platform": "x", "account_id": "..."} โ the error message lists valid ids if you get it wrong. Discover accounts with GET /api/v1/accounts.
Endpoints
| Method | Path | What it does |
|---|---|---|
| POST | /api/v1/posts | Create draft / scheduled / immediate post |
| GET | /api/v1/posts | List posts (?status=, ?scheduled_after=โฆ) |
| GET | /api/v1/posts/{id} | Retrieve with per-target status |
| PATCH | /api/v1/posts/{id} | Edit while draft or scheduled |
| POST | /api/v1/posts/{id}/publish | Publish now |
| DELETE | /api/v1/posts/{id} | Cancel scheduled / delete draft |
| GET | /api/v1/accounts | Connected accounts (valid targets) |
| GET | /api/v1/platforms | Capabilities & char limits (public) |
Errors
Every non-2xx response uses one envelope, with messages written to be actionable by an agent:
{
"error": {
"type": "invalid_request_error",
"code": "no_connected_account",
"message": "No connected linkedin account. Connect one at /channels, or list valid targets with GET /api/v1/accounts.",
"param": "targets[0]"
}
}Post lifecycle
draft โ scheduled โ publishing โ published, with partial when only some targets succeeded and failed when none did. Each target retries up to 3 times with exponential backoff and carries its own platform_post_url and error.
Simulated mode
Platforms without configured credentials run in simulated mode: connecting creates a test account instantly, publishing succeeds with a fake sim_* id, and every response marks it "simulated": true. Build your whole integration before touching a single platform console.