Skip to main content
An AI agent that can make web requests from a terminal, such as Claude Code, Codex, Cursor, OpenClaw or Gemini CLI, can set a person up on PostSyncer without a browser. The agent asks for their email, the person reads back a 6-digit code from their inbox, and the agent gets an API key with every permission. ChatGPT and Claude’s chat app connect through the PostSyncer connector instead, which signs people up in the browser. See Client setup.

The flow

  1. The agent checks whether PostSyncer is already connected, through the Claude plugin or a connector: PostSyncer’s tools, such as list-workspaces, are in its tool list. If they are, the person is already set up, so it uses those tools and stops, without signing in again or adding the server a second time. If a server named postsyncer (or one at https://postsyncer.com/mcp) is waiting for a sign-in (in Claude Code, /mcp shows it needs authentication), it asks the person to finish that sign-in and stops, instead of signing up again and adding a second server. A postsyncer server whose tools fail for another reason, such as a saved key that was deleted, doesn’t stop it: the sign-up goes on, and the new key replaces that server.
  2. The agent says: “By signing up you agree to PostSyncer’s Terms and Privacy Policy.” Then it asks for the person’s email, and nothing else.
  3. It asks for a code, with the email, its own name and the computer’s time zone.
  4. The person reads the code from their inbox. The agent sends it back and gets the key.
  5. It saves the key in its own secret store or MCP settings (the shell’s profile only when it has neither), then connects the person’s social accounts.
Neither request needs a key.

Send a code

202
  • The answer is the same whether or not the address has an account, and no account is made yet.
  • agent is the agent’s own name. When PostSyncer knows it (Claude Code, Codex, Cursor, OpenClaw, Gemini CLI, Claude, ChatGPT, VS Code, Windsurf, Hermes, Grok Bot, Grok), the email says “Enter it in Claude Code” and the key is named after it. Any other name is “your AI agent” in the email and “AI agent” on the key.
  • Read timezone from the system; don’t ask. A new account’s workspace gets it. A name that isn’t an IANA time zone (such as Windows’ Eastern Standard Time) is left out, not refused.
  • A code works for 10 minutes and once. Asking again replaces it.
The email’s subject and first line are Your PostSyncer code is 482913.

Verify the code

200
  • A new address gets a new account, with its own workspace and the email marked verified (new_account: true).
  • An address with an account gets a new key on it, and nothing else on the account changes (new_account: false). PostSyncer emails the account’s owner that a key was added for the agent, with the key’s name and where to delete it.
  • workspace is where the agent connects accounts and saves posts.
  • While a new account is in its first week, first_week_ends_at says when the week ends, and the agent says: “For your first 7 days you get 10 accounts, unlimited posts and Analytics. After that you keep Free: 2 accounts and 20 posts a month.”
The key has every permission and no end date. It shows in Settings → API under its name, where the person can delete it.

Save the key

Save api_key in the agent’s own secret store or its user-level MCP settings first, never in a project file or anything that could be committed, and never repeat the full key in a reply to the person. Only an agent with neither keeps the key in an environment variable such as POSTSYNCER_API_KEY, set in the shell’s profile (~/.zshrc or ~/.bashrc).
  • Claude Code:
  • Cursor: add the server to ~/.cursor/mcp.json, not the project’s .cursor/mcp.json:
  • Codex: in ~/.codex/config.toml, name an environment variable for the key. Codex has no secret store of its own, so set that variable in the shell’s profile (~/.zshrc or ~/.bashrc):
  • Any other agent: add https://postsyncer.com/mcp as a remote server with the header Authorization: Bearer YOUR_API_KEY in its user-level settings (see Connect with a Bearer token). If its settings read the key from an environment variable instead, set POSTSYNCER_API_KEY from its own secret store, or else in the shell’s profile.
Most agents load a new MCP server only after a restart. For the rest of the chat, call the REST API with the key as Authorization: Bearer …. Later chats use the MCP tools.

Next: connect accounts and read how posts did

  1. Ask which networks the person posts on. Make a connect link for each, give the links, and check List accounts until the accounts show up.
  2. Once an account is connected, PostSyncer reads its past posts, then learns the brand from them. Read Get the brand until it’s done: importing_posts is true while the posts are still being read, and status is building while the brand is being learned.
  3. When both are done, accounts[].numbers has each account’s best posts, times and formats. Empty numbers mean there were no past posts to read: ask the person what they do instead.
Save posts as drafts (schedule_type: draft) and schedule them only when the person says yes. See Publish a post.

Limits

Over a limit, nothing is sent or made, and the answer is 429 with error: rate_limited. Wait Retry-After seconds when it’s given: the day’s limits on new accounts from one IP address and on the codes PostSyncer sends give none, and say to try again tomorrow. These two requests carry no X-RateLimit-* headers.

Errors

Every error has error, a code to branch on, and a plain message to pass on to the person.