GPTpost Developers
Let Claude, ChatGPT or your own scripts draft, schedule and publish social posts in your GPTpost workspace, with a scoped API key.
Overview
https://app.oraglegpt.org/mcp for Claude Code, Claude Desktop and other MCP clients (streamable HTTP).
https://app.oraglegpt.org/api/v1/agent/... for scripts and agent frameworks.
https://app.oraglegpt.org/openapi.json for ChatGPT Actions and any OpenAPI-aware tool.
Every request authenticates with Authorization: Bearer gpk_.... Posts created by an agent go through the same rules as posts created in the app: per-network text limits, approval workflows, plan limits and publishing safeguards.
Get an API key
- Sign in at https://app.oraglegpt.org/ as a workspace owner or admin.
- Open Settings > API & Agents (https://app.oraglegpt.org/#/settings/api-agents).
- Choose Create API key, give it a name, pick scopes and an expiry.
- Copy the key straight away. It is shown once and starts with
gpk_.
Copy it now, you will not see it again. GPTpost keeps only a hash. If you lose a key, revoke it and create a new one.
Scopes
| Scope | Allows |
|---|---|
accounts:read | List connected social accounts (network, handle, state, text limit). |
posts:read | List posts and read their schedule and per-network publish status. |
posts:draft | Create and version-edit unscheduled drafts through REST or MCP. A draft-only key cannot schedule or publish. |
posts:schedule | Schedule an existing draft for a future time. Does not grant draft creation or immediate publishing. |
posts:cancel | Explicitly cancel pending scheduled deliveries at the current post version. In-flight and live destinations remain unchanged and are reported. Unchecked by default. |
posts:publish | Publish an existing draft now. Does not grant draft creation or future scheduling. |
posts:write | Legacy broad access: create drafts, schedule them and publish now. Retained for existing integrations; prefer separate grants. |
media:write | Upload media (from a URL or base64) and read it back. |
New keys select accounts:read, posts:draft and posts:read for the draft quickstart. Enable scheduling or publishing only when needed. Creating and scheduling in one call needs both posts:draft and posts:schedule; creating and publishing immediately needs posts:draft and posts:publish. Missing grants are rejected before the composite request creates a draft. Legacy posts:write retains create/edit/schedule/publish access and does not include cancellation; posts:cancel is a separate explicit grant and remains unchecked by default. Approval rules, creator role and plan limits still apply to every scope.
A key never has more rights than the person who created it. If that person loses a role or is removed, the key stops working. Changing or resetting the password, or replacing the second factor, revokes every key that person created. Keys work only on /api/v1/agent/ and /mcp.
Connect Claude Code
claude mcp add --transport http gptpost https://app.oraglegpt.org/mcp \
--header "Authorization: Bearer <YOUR_API_KEY>"
Then run /mcp inside Claude Code to see the GPTpost tools, and ask for example: "Create a LinkedIn draft announcing our webinar for me to review". Give the key posts:schedule or posts:publish separately when that agent should also queue or publish content.
Connect Claude Desktop
Open Settings > Developer > Edit Config, add this to claude_desktop_config.json, and restart Claude Desktop. It uses mcp-remote, so Node.js must be installed.
{
"mcpServers": {
"gptpost": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://app.oraglegpt.org/mcp",
"--header",
"Authorization: Bearer ${GPTPOST_API_KEY}"
],
"env": {
"GPTPOST_API_KEY": "<YOUR_API_KEY>"
}
}
}
}
claude.ai (web)
Custom connectors on claude.ai sign in with OAuth, which the GPTpost MCP endpoint does not support yet. Use Claude Code or Claude Desktop with an API key for now.
ChatGPT and other agents (OpenAPI)
For a Custom GPT: Configure > Actions > Create new action > Import from URL, then set authentication to API key, auth type Bearer.
OpenAPI schema URL: https://app.oraglegpt.org/openapi.json
Authentication: API key
Auth type: Bearer
API key: <YOUR_API_KEY>
Agent frameworks that load tools from OpenAPI (LangChain, Semantic Kernel, OpenAI Agents SDK and similar) can use the same URL and header.
REST quickstart
Steps 1–3 and 5 use only accounts:read, posts:draft and posts:read. They create a draft and do not send it to a social network.
1. Check the key
curl https://app.oraglegpt.org/api/v1/agent/me \
-H "Authorization: Bearer $GPTPOST_API_KEY"
2. List the accounts you can post to
curl https://app.oraglegpt.org/api/v1/agent/accounts \
-H "Authorization: Bearer $GPTPOST_API_KEY"
3. Create a draft
curl -X POST https://app.oraglegpt.org/api/v1/agent/posts \
-H "Authorization: Bearer $GPTPOST_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"text":"Hello from my agent","account_ids":["ACCOUNT_ID"]}'
With an additional posts:schedule grant, add a future schedule_at to schedule it in the same call. With an additional posts:publish grant, add "publish_now":true to publish immediately. Optional fields: title, media_ids, and variants (per-network text, for example {"x":"Short version"}).
Edit an unscheduled draft at its current version
PATCH /api/v1/agent/posts/{id} and MCP edit_post require posts:draft or legacy posts:write. Returned posts include a required positive integer version. Read the current post.version and replace the example 1 below with that value; reading separately requires posts:read.
curl -X PATCH https://app.oraglegpt.org/api/v1/agent/posts/POST_ID \
-H "Authorization: Bearer $GPTPOST_API_KEY" \
-H "Content-Type: application/json" \
-d '{"version":1,"patch":{"text":"Updated draft text"}}'
The required nonempty patch accepts only title, text, link and media_ids; omitted fields stay unchanged and an empty media array removes attachments. Null values, unknown fields and missing/nonpositive/noninteger versions are rejected. Bindings, workspace, approvals, workflow state and delivery controls cannot be patched.
Only unscheduled draft, changes_requested, pending_approval or approved posts qualify. Any schedule/publication evidence or live state returns 409 post_not_editable. A stale version returns 412 version_conflict: refetch and review before an explicit retry. Successful responses include the new post.version; editing never approves or publishes content.
MCP arguments are {"post_id":"POST_ID","version":1,"patch":{"text":"Updated draft text"}}. The editor rejects idempotency_key; If-Match and Idempotency-Key headers do not replace the JSON body version. Current creator role, tenant/workspace, account/media and approval guards remain in force. Successful edits retain private transactional history; no public history reader is exposed.
4. Schedule or publish an existing post
These are optional sending operations. Scheduling requires posts:schedule; immediate publishing requires posts:publish. A draft-only key is refused. Choose a future scheduling date and retain your workspace's approval workflow.
curl -X POST https://app.oraglegpt.org/api/v1/agent/posts/POST_ID/schedule \
-H "Authorization: Bearer $GPTPOST_API_KEY" \
-H "Content-Type: application/json" \
-d '{"schedule_at":"2026-11-02T09:00:00Z","account_ids":["ACCOUNT_ID"]}'
curl -X POST https://app.oraglegpt.org/api/v1/agent/posts/POST_ID/publish \
-H "Authorization: Bearer $GPTPOST_API_KEY" \
-H "Content-Type: application/json" \
-d '{"account_ids":["ACCOUNT_ID"]}'
5. Check status
curl https://app.oraglegpt.org/api/v1/agent/posts/POST_ID \
-H "Authorization: Bearer $GPTPOST_API_KEY"
curl "https://app.oraglegpt.org/api/v1/agent/posts?state=scheduled&limit=20" \
-H "Authorization: Bearer $GPTPOST_API_KEY"
Cancel pending scheduled deliveries
POST /api/v1/agent/posts/{id}/cancel and MCP cancel_post require explicit posts:cancel, including for owners. posts:schedule and legacy posts:write do not include cancellation. Current creator role, tenant/workspace, policy and account restrictions must authorize the complete canonical graph; a key never widens its creator's role.
Read the current post.version with posts:read, then send that positive integer in the body. Optional reason is a string of at most 500 Unicode characters. Replace the example 1 with the version just read. Unknown fields and nulls are rejected; MCP takes post_id, version and optional reason, without idempotency_key. If-Match is not a substitute.
curl https://app.oraglegpt.org/api/v1/agent/posts/POST_ID -H "Authorization: Bearer $GPTPOST_API_KEY"
curl -X POST https://app.oraglegpt.org/api/v1/agent/posts/POST_ID/cancel \
-H "Authorization: Bearer $GPTPOST_API_KEY" \
-H "Content-Type: application/json" \
-d '{"version":1,"reason":"No longer needed"}'
Cancellation is atomic across pending publications, job withdrawal and release of still-owned content. Only queued, retrying and failed publications stop. Publishing, submitted and published destinations remain unchanged: cancellation does not unpublish or undo an in-flight provider call. Inspect every uncancelled_publications outcome even when schedule state is cancelled.
{"post_id":"POST_ID","cancellation":{"schedule_id":"SCHEDULE_ID","state":"cancelled","cancelled_publications":["PENDING_ID"],"uncancelled_publications":[{"publication_id":"LIVE_ID","state":"published","detail":"Already live; unchanged."}],"cancelled_jobs":1,"content_released":true,"reason":"No longer needed"}}
A stale cancellation version returns 412; reread and review before an explicit retry. An unscheduled or already-cancelled post returns 409. Missing explicit scope returns 403, including legacy-only keys. Unavailable storage or complete authorization evidence returns 503 without claiming success. Cancellation does not contact a provider to delete content.
Check a saved draft without sending
POST /api/v1/agent/posts/POST_ID/preflight requires posts:read and accounts:read. It reads the saved draft and reports local schema, media, permission, approval and cost problems. It does not save a draft, request approval, schedule, publish, refresh credentials or contact a provider.
curl -X POST https://app.oraglegpt.org/api/v1/agent/posts/POST_ID/preflight \
-H "Authorization: Bearer $GPTPOST_API_KEY" \
-H "Content-Type: application/json" \
-d '{"account_ids":["ACCOUNT_ID"],"publish_now":true,"timezone":"UTC"}'
Use schedule_at with a future RFC3339 value instead of publish_now for a scheduling check. Missing accounts or operation time produces structured schema issues in a 200 response; malformed JSON, unknown fields, wrong types, invalid nonempty RFC3339 or both operations together returns 400. A foreign or unreadable post/account returns 403/404 without its details. Missing posts:schedule or posts:publish appears as a permission issue; a preview never grants permission to send.
The response has ready, has_blocking_issues, issues, validation and cost. Each issue names its category, code, message, severity and optional account_id/field. Categories are schema, media, permission, approval and cost. No pricing quote is fetched: cost.status stays unknown, estimated_total is null and ready remains false. With has_blocking_issues:false, the correct interpretation is “No local blockers”, not verified provider pricing, provider approval or guaranteed delivery. cost.entitlement only reports the configured allowance.
The composer offers Save and check: that separate action explicitly persists the current draft before calling this no-send endpoint. Its result is discarded when the draft, destinations or workspace changes. The endpoint remains REST-only; the ten remote MCP tools below include the separate versioned draft editor.
Upload media
curl -X POST https://app.oraglegpt.org/api/v1/agent/media \
-H "Authorization: Bearer $GPTPOST_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/image.jpg","rights_status":"owned"}'
Use the returned media id in media_ids when you create the post. Set rights_status to owned or licensed: a post whose media has unknown rights is kept as a draft but is not scheduled or published.
MCP tools
| Tool | What it does | Scope |
|---|---|---|
whoami | Workspace, key scopes and plan usage | any |
list_accounts | Connected social accounts a post can target | accounts:read |
create_post | Create a draft, optionally scheduled or published now | posts:draft, plus posts:schedule or posts:publish when requested |
edit_post | Edit an unscheduled draft with required post_id, version and patch | posts:draft or legacy posts:write |
schedule_post | Schedule an existing draft for a future time | posts:schedule |
publish_post | Publish an existing draft now | posts:publish |
cancel_post | Atomically cancel pending destinations with post_id, current version and optional reason; report live/in-flight outcomes | Explicit posts:cancel |
upload_media | Upload media from a URL or base64 | media:write |
get_post_status | A post with its schedule and per-network status | posts:read |
list_posts | Recent posts, filterable by state | posts:read |
Rate limits
Each key can make about 120 requests per minute, with a lower budget for writes. Above that the API answers 429 Too Many Requests with a Retry-After header in seconds. Wait that long, then retry. Send an Idempotency-Key header on create calls so a retry never creates a duplicate post.
Errors
Errors are application/problem+json: {"type","title","status","code","detail"}.
| Status | Meaning | What to do |
|---|---|---|
| 401 | Missing, malformed, expired or revoked key | Check the header, or create a new key. |
| 403 | The key lacks the scope (insufficient_scope), or the path is outside the agent API (key_surface_not_allowed) | Create a key with the needed scope; call only /api/v1/agent/ and /mcp. |
| 409 | Approval required before scheduling or publishing | The post waits for review in GPTpost; check it later with get_post_status. |
| 422 | Validation failed, for example text too long for a network | Shorten the text or add a per-network variant. |
| 402 | Plan limit reached (for example posts per month) or the plan lacks API access | Check usage with whoami; upgrade the plan. |
| 429 | Rate limit reached | Wait for Retry-After, then retry. |
Security notes
- Keys are stored hashed. The full key is shown once, when it is created.
- A key acts as the person who created it, bounded by its scopes. It cannot manage members, billing, OAuth apps or other API keys.
- Revoke a key at any time in Settings > API & Agents. It stops working immediately.
- Keep keys out of source code and shared chats. Prefer an environment variable such as
GPTPOST_API_KEY. - Use one key per agent or device, so you can revoke one without breaking the others.