# PBLSH agent guide Connect your own agent to PBLSH. PBLSH does not host or supply your external model. ## Authentication Create a named key in Settings > Security > Developer access (owner/admin only). Confirm your current password first; credential changes require a recent session-bound security unlock. Send Authorization: Bearer YOUR_PBLSH_KEY. Keep keys in your client's secret storage, never in prompts, committed configuration, URLs, screenshots, or public documents. Keys are workspace-scoped. Revocation is immediate. Use separate keys per agent. ## Plans and request usage Read /pricing.md for the current catalog; do not assume historical prices or limits. Developer API/MCP access begins on Starter. Key limits and monthly requests are pooled across the billing owner's workspaces. REST HTTP calls consume request usage; every JSON-RPC message in an MCP batch counts separately. Internal Telegram gateway keys are server-assigned and have restricted draft scopes. HTTP 402 means the plan excludes access or the account's request allowance is exhausted. Inspect error.code (plan_limit or api_quota_exceeded), upgradeTo and resetsAt. HTTP 429 means a short-term rate limit: respect Retry-After. HTTP 503 means the allowance could not be checked; retry later with backoff, without creating duplicate drafts. Credential mutation may return 403 security_reauth_required with an unlockPath. ## Interfaces MCP: POST /api/mcp, JSON-RPC 2.0. Initialize, then tools/list and tools/call. OpenAPI schema: /openapi.json. REST: GET /api/v1/accounts; GET /api/v1/posts; GET /api/v1/posts/{id}; POST /api/v1/posts; POST /api/v1/posts/{id}/schedule; POST /api/v1/posts/{id}/publish; POST /api/v1/media (one multipart file per request); POST /api/v1/posts/batch. Resolve the base URL from the PBLSH instance you are using. ## Current permissions Read-only: accounts:read, posts:read, analytics:read. Drafting: the above plus posts:write. Full automation: the drafting scopes plus posts:publish and media:write. Owners/admins explicitly grant this access when creating a key. Full automation keys can publish and schedule without per-post human approval. Draft-only keys record suggested publish times and still need human approval and dispatch. Revoking a key blocks new calls; already-dispatched provider schedules are managed separately in Queue. Do not claim that creating a key or copying configuration proves a client is connected. ## Available MCP tools list_accounts, draft_post, submit_for_approval, list_posts, get_post, schedule_post, publish_post (full automation only), get_queue, get_analytics, get_top_posts, list_tags, tag_post. Use tools/list as the authoritative schema for the key's granted capabilities. Use returned workspace resource IDs; never invent profile, post, or media IDs. Upload media first with POST /api/v1/media using the file field (100 MB per file). Use returned media IDs when drafting. For many files, send separate requests with bounded concurrency; there is no new PBLSH storage-based tier quota. Bulk dispatch: POST /api/v1/posts/batch with {"items":[{"postId":"UUID"}]} (maximum 25 items per request; split larger sets into chunks). Each item may include a future scheduledAt (ISO-8601 with offset) and timezone. Missing scheduledAt means publish now. Results are per item; 207 means at least one item failed. These are dispatch results, not proof of network publication. Inspect post and platform status. The batch is processed within the request; on interruption, inspect existing post IDs before retrying. It is not a resumable background batch job. ## Reliable workflows 1. List accounts and confirm the intended destination. 2. Read existing posts before creating new ones. 3. Create a draft with the platform list and per-platform captions as needed. 4. Read the returned post and approval state. Report those states accurately. 5. Request a future ISO-8601 schedule time with an explicit timezone. 6. With full automation, dispatch with publish_post or the publish/batch REST route. 7. Use queue and analytics tools to report actual results, distinguishing missing data from zero. ## Failures and retries 401: missing, invalid or revoked credentials, or unavailable workspace access. 403: missing permission. Ask the owner to change access; do not retry blindly. 429: respect Retry-After when present. Slow down and retry later. MCP tool errors use isError=true even when HTTP is 200. JSON-RPC errors are failures too. A timeout after a write is an uncertain result. Inspect posts before retrying: the current draft endpoint does not guarantee idempotency. Do not replay entire batches. Do not interpret a failed metrics refresh as zero engagement. ## Client setup Hermes: remote MCP under mcp_servers in config.yaml. OpenClaw: remote Streamable HTTP MCP under mcp.servers. Claude Code: HTTP MCP entry under mcpServers. Claude Messages API supports remote MCP. GPT: add PBLSH as an MCP tool in the OpenAI Responses API; authorization is your PBLSH key. The OpenAI/Anthropic model API credential is separate and stays with the user's agent. ChatGPT and Claude web-app account authorization is not implemented by PBLSH yet. ## Troubleshooting Test connection in Agents checks this PBLSH instance with your key; it does not prove that a remote client can reach your localhost. Hosted agents need a reachable HTTPS URL. Never expose your local development server merely to bypass a connection error.