Run a basic accessibility checklist for UI changes. Use when a junior developer needs quick a11y guidance.
中文简介正在准备中。当前显示原文说明。
Manage Buffer content via the GraphQL API. Use when creating, scheduling, editing, or deleting posts, saving ideas, reading scheduled queues, or pulling post analytics. Not for general API debugging.
中文简介正在准备中。当前显示原文说明。
查看安装方法安装前可以查看交给 AI 代理的指令内容。
Create, schedule, edit, and analyze social media content through Buffer's GraphQL API at https://api.buffer.com.
| Goal | API call |
|---|---|
| Create / schedule a post | createPost mutation |
| Save a post as draft | createPost with saveToDraft: true |
| Edit an existing post | editPost mutation |
| Delete a post | deletePost mutation |
| List scheduled / sent posts | posts query with filter: { status: [scheduled] } |
| Get a single post | post query by ID |
| Read post metrics | post { metrics } or aggregatedPostMetrics query |
| Save a content idea | createIdea mutation |
| Find channel IDs | channels query by organization ID |
| Find organization ID | account { organizations { id } } query |
All requests need Authorization: Bearer $BUFFER_API_KEY and Content-Type: application/json.
For personal scripts and automations: use an API key from https://publish.buffer.com/settings/api.
For multi-user apps: use OAuth 2.0 with PKCE — authorize at https://auth.buffer.com/auth, exchange at https://auth.buffer.com/token. Refresh tokens are single-use; always save the new one immediately after refresh.
Get your organization ID (first time only):
query { account { organizations { id name } } }
Get channel IDs for your target platforms:
query GetChannels($orgId: String!) {
channels(input: { organizationId: $orgId }) {
id name service
}
}
Create or schedule the post using the relevant example below.
Check the response — the mutation returns a union type. PostActionSuccess means it worked; MutationError carries the reason it failed. GraphQL always responds with HTTP 200, so always inspect the response body.
Edit or delete if needed using the post id returned in step 3.
Pull analytics after the post publishes (metrics are refreshed daily; allow up to 24 hours after publish).
mutation CreatePost($input: CreatePostInput!) {
createPost(input: $input) {
... on PostActionSuccess {
post { id text status dueAt }
}
... on MutationError { message }
}
}
{
"input": {
"text": "Your post content here",
"channelId": "$CHANNEL_ID",
"schedulingType": "automatic",
"mode": "addToQueue"
}
}
{
"input": {
"text": "Your post content here",
"channelId": "$CHANNEL_ID",
"schedulingType": "automatic",
"mode": "customScheduled",
"dueAt": "2026-07-01T14:00:00.000Z"
}
}
{
"input": {
"text": "Draft content here",
"channelId": "$CHANNEL_ID",
"schedulingType": "automatic",
"mode": "addToQueue",
"saveToDraft": true
}
}
{
"input": {
"text": "Your caption here",
"channelId": "$CHANNEL_ID",
"schedulingType": "automatic",
"mode": "addToQueue",
"assets": [{ "image": { "url": "https://your-public-image-url.jpg" } }]
}
}
Image URL must be publicly accessible. Each asset entry specifies exactly one type: image, video, document, or link.
mutation EditPost($input: EditPostInput!) {
editPost(input: $input) {
... on PostActionSuccess {
post { id text status dueAt }
}
... on MutationError { message }
}
}
{ "input": { "id": "$POST_ID", "text": "Updated content here" } }
mutation DeletePost {
deletePost(input: { id: "$POST_ID" }) {
... on PostActionSuccess { post { id } }
... on MutationError { message }
}
}
query GetScheduledPosts($orgId: String!) {
posts(input: {
organizationId: $orgId,
filter: { status: [scheduled] },
sort: [{ field: dueAt, direction: asc }]
}) {
edges {
node { id text dueAt channelId }
}
pageInfo { hasNextPage endCursor }
}
}
For more pages, add after: "$endCursor" to input. Page size: 20–50 items.
query GetPostMetrics {
post(input: { id: "$POST_ID" }) {
id text metricsUpdatedAt
metrics { type name value unit }
}
}
Available metric types (varies by network): reactions, reposts, comments, shares, impressions, reach, views, saves, follows, likes. Metrics appear up to ~24 hours after publish.
mutation CreateIdea($input: CreateIdeaInput!) {
createIdea(input: $input) {
... on MutationError { message }
}
}
{
"input": {
"organizationId": "$ORG_ID",
"content": { "title": "Optional title", "text": "Idea content here" }
}
}
Ideas are org-level (not tied to a channel). Promote to a post by using the idea's text in createPost.
Buffer enforces three time windows. On HTTP 429, read retryAfter (seconds) from the response body.
| Plan | 15-min | 24-hr | 30-day |
|---|---|---|---|
| Free | 100 | 100 | 3,000 |
| Essentials | 100 | 250 | 7,500 |
| Team | 100 | 500 | 15,000 |
post field in mutation response → MutationError fired; log data.<mutationName>.message.UNAUTHORIZED → check Authorization: Bearer $BUFFER_API_KEY header is present and token is valid.FORBIDDEN → token lacks the right scope (e.g., posts:write needed for create/edit/delete).metricsUpdatedAt.... on MutationError { message } in every mutation.还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
Run a basic accessibility checklist for UI changes. Use when a junior developer needs quick a11y guidance.
中文简介正在准备中。当前显示原文说明。
Validate API changes against an expected contract. Use when a mid-level developer needs to detect breaking changes.
中文简介正在准备中。当前显示原文说明。
Define consistent API error codes and responses. Use when a mid-level developer needs error standardization.
中文简介正在准备中。当前显示原文说明。
Build a basic HTTP request (curl or fetch) for an API. Use when a junior developer needs a quick request example.
中文简介正在准备中。当前显示原文说明。
Review a system architecture for scalability, reliability, and maintainability. Use when a senior developer needs to critique a design.
中文简介正在准备中。当前显示原文说明。
Create a minimal, repeatable reproduction plan for a bug. Use when a junior developer needs clear steps to reproduce and capture evidence.
中文简介正在准备中。当前显示原文说明。