# Hapi > Hapi is the developer-first social media API. Connect accounts, publish, schedule and analyze across every major platform with one integration. ## Connect an AI agent (MCP) - Server: https://hapi.tools/mcp (Streamable HTTP, stateless) - Auth: header `Authorization: Bearer ` (create one at https://hapi.tools/dashboard/agents) - Tools: get_workspace, list_platforms, list_accounts, create_post, list_posts, get_post, update_post, delete_post, retry_post, get_analytics - Claude Code: claude mcp add --transport http hapi https://hapi.tools/mcp --header "Authorization: Bearer " ## REST API Base URL: https://hapi.tools/v1. Auth: `Authorization: Bearer `. JSON in, JSON out. - GET /v1/accounts: connected accounts. `sandbox: true` accounts simulate publishing and never post for real. - GET /v1/platforms: each platform's limits, features and required options. - POST /v1/posts: publish or schedule. Body: {"content": string, "accountIds"?: string[], "platforms"?: string[], "mediaUrls"?: string[], "scheduledAt"?: ISO 8601 with offset, "draft"?: boolean, "firstComment"?: string, "platformOptions"?: object}. Send an `Idempotency-Key` header so retries never double-post. - GET /v1/posts: list (query: status, platform, from, to, page, limit). - GET /v1/posts/{id}: per-platform status, live URL or error. PATCH to edit drafts/scheduled posts; DELETE to remove. - POST /v1/posts/{id}/retry: retry failed targets only. - POST /v1/media: multipart upload (field `file`): JPEG, PNG, WebP, GIF, MP4, MOV. - GET /v1/analytics: daily metrics (query: from, to, platform, accountId). Demo rows are flagged `isDemo`. - Webhooks: post.published, post.failed, post.partial and more, signed with `hapi-signature: t=,v1=.")>`. ## Rules for agents - Content is validated against every target platform first. On 422, read `error.details` and fix the content. - Never describe a sandbox result as published to the real platform. - Accounts are connected by a human in the dashboard; agents can't connect them. - Errors: {"error": {"code", "message", "details"?}}. 429 includes Retry-After. ## Platforms Live publishing: bluesky, discord, telegram, slack. Others are sandbox-only for now: instagram, tiktok, x, linkedin, facebook, threads, youtube, pinterest, reddit, snapchat, whatsapp, google_business. ## Links - Docs: https://hapi.tools/docs - Pricing: https://hapi.tools/pricing (15-day trial for $5, then Growth $49/mo, Pro $99/mo, Scale from $199/mo + usage)