{
    "id": "buffer",
    "name": "Buffer",
    "category": "Social",
    "description": "Schedule and publish posts to social channels (X, Instagram, LinkedIn, Facebook, Threads, Bluesky, YouTube, Pinterest, Mastodon, Google Business) and manage content ideas via the Buffer GraphQL API.",
    "baseUrl": "https://api.buffer.com",
    "authStrategy": "bearer",
    "authKey": "Authorization",
    "fields": [
        { "name": "apiKey", "label": "API Key", "type": "password" }
    ],
    "hints": [
        "GraphQL API — single endpoint. Always POST to path \"/\" (the base URL itself) with body: { query: \"...\", variables: { ... } }.",
        "Every response is HTTP 200. Check `errors` array for system errors (UNAUTHORIZED, NOT_FOUND, RATE_LIMIT_EXCEEDED, etc.) and check the typed response shape for mutation errors.",
        "Typical flow: 1) get organizationId from account, 2) list channels for that org, 3) create posts on a channel or ideas on the org.",
        "Get account + organizations:",
        "  query { account { id email organizations { id name } } }",
        "List channels for an organization:",
        "  query($orgId: String!) { channels(input: { organizationId: $orgId }) { id name service } }",
        "  `service` is the platform: twitter, instagram, facebook, linkedin, threads, bluesky, youtube, pinterest, mastodon, googlebusiness.",
        "Create a post (add to queue):",
        "  mutation($input: CreatePostInput!) { createPost(input: $input) { ... on PostActionSuccess { post { id text dueAt } } ... on MutationError { message } } }",
        "  variables: { input: { text: \"...\", channelId: \"<id>\", schedulingType: automatic, mode: addToQueue } }",
        "Create a post at a specific time: set mode: customScheduled and dueAt: \"2026-03-10T15:00:00.000Z\" (ISO 8601 UTC).",
        "Post immediately: set mode: now.",
        "ALWAYS include `... on MutationError { message }` as a catch-all in every mutation — covers current and future error types.",
        "Posts are per-channel: to publish to multiple channels, send one createPost mutation per channelId.",
        "List queued/sent posts (cursor pagination):",
        "  query($orgId: String!, $after: String) { posts(first: 20, after: $after, input: { organizationId: $orgId, filter: { status: [scheduled], channelIds: [\"<id>\"] } }) { edges { node { id text status dueAt channelId } } pageInfo { hasNextPage endCursor } } }",
        "  Pass `endCursor` from the previous response as `after` to fetch the next page. Cursors are opaque — do not parse them.",
        "Create an idea (org-level draft, no channel yet):",
        "  mutation($input: IdeaCreationInput!) { createIdea(input: $input) { ... on Idea { id content { title text } } ... on MutationError { message } } }",
        "Rate limits: 100 requests / 15 minutes per client; 2000 / 15 minutes account-wide. On RATE_LIMIT_EXCEEDED check extensions.retryAfter (seconds) before retrying.",
        "Query limits: max complexity 175,000 points, max depth 25, max 30 aliases, max 50 directives, max 15,000 tokens — keep queries flat and request only the fields you need.",
        "IMPORTANT: Do NOT include the API key in body or query params — the proxy attaches the Authorization: Bearer header automatically."
    ],
    "onboarding": {
        "url": "https://publish.buffer.com/settings/api",
        "steps": [
            "Log in to your Buffer account at buffer.com",
            "Go to publish.buffer.com/settings/api",
            "Create a new API key",
            "Copy the key"
        ]
    }
}
