REST API Migration
If you've been using our REST API (api.bufferapp.com/1/), this guide will help you move over to the GraphQL API. It's faster to work with, returns only the data you need, and supports the core functionality of the legacy API offering.
What's changing
| REST API | GraphQL API | |
|---|---|---|
| Base URL | https://api.bufferapp.com/1/ |
https://api.buffer.com |
| HTTP method | GET, POST per endpoint | Always POST |
| Endpoints | One per resource (/profiles.json, /updates/:id.json) |
Single endpoint for everything |
| Auth | OAuth 2.0 access token | API key via Authorization: Bearer header (personal workflows), or OAuth 2.0 (App Clients) |
| Response shape | Fixed - server decides what fields to return | You choose exactly which fields you need |
| Pagination | Offset-based (page=1&count=10) |
Cursor-based (first, after) |
| Errors | HTTP status codes (401, 404, etc.) | Typed error unions in the response body |
Authentication
The REST API used OAuth 2.0 with a client ID/secret flow. For automating your own personal workflows, the GraphQL API uses a simpler API key approach. To build App Clients that act on behalf of other Buffer users, use OAuth 2.0 (Authorization Code with PKCE). See the Authentication guide.
REST (before):
GET https://api.bufferapp.com/1/user.json?access_token=YOUR_TOKEN
GraphQL (now):
Authorization: Bearer YOUR_API_KEY
Get your API key from Settings > API. Every request to https://api.buffer.com must include:
Authorization: Bearer YOUR_API_KEY
The body is always a JSON object with a query field. See the Authentication guide for more details.
If you built an app on the REST API
An app that acts on behalf of other Buffer users needs an App Client. Register one in Settings > API, on the App Clients tab. Each of your users then connects your app once, and your app calls the API with the access token it receives.
Building Apps walks through registering a client, connecting accounts, working with tokens, and taking an app to production.
Endpoint mapping
User / Account
REST: GET /user.json
GraphQL:
query {
account {
id
email
name
organizations {
id
name
}
}
}
curl -X POST 'https://api.buffer.com' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{"query": "query {\n account {\n id\n email\n name\n organizations {\n id\n name\n }\n }\n}"}'
async function main() {
const response = await fetch('https://api.buffer.com', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY',
},
body: JSON.stringify({
query: `
query {
account {
id
email
name
organizations {
id
name
}
}
}
`,
}),
});
const data = await response.json();
console.log(JSON.stringify(data, null, 2));
}
main();
import requests
query = """
query {
account {
id
email
name
organizations {
id
name
}
}
}
"""
response = requests.post(
"https://api.buffer.com",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY",
},
json={
"query": query,
},
)
data = response.json()
print(data)
<?php
$query = '
query {
account {
id
email
name
organizations {
id
name
}
}
}
';
$payload = [
'query' => $query,
];
$ch = curl_init('https://api.buffer.com');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'Authorization: Bearer YOUR_API_KEY',
],
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
The REST API returned plan and activity_at. With GraphQL, you get richer account data including all your organizations in a single request - no separate calls needed.
Profiles -> Channels
Profiles are now called channels. The concept is the same, a connected social media account.
REST: GET /profiles.json
GraphQL:
query {
channels(input: { organizationId: "your_org_id" }) {
id
name
service
avatar
isQueuePaused
}
}
curl -X POST 'https://api.buffer.com' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{"query": "query {\n channels(input: { organizationId: \"your_org_id\" }) {\n id\n name\n service\n avatar\n isQueuePaused\n }\n}"}'
async function main() {
const response = await fetch('https://api.buffer.com', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY',
},
body: JSON.stringify({
query: `
query {
channels(input: { organizationId: "your_org_id" }) {
id
name
service
avatar
isQueuePaused
}
}
`,
}),
});
const data = await response.json();
console.log(JSON.stringify(data, null, 2));
}
main();
import requests
query = """
query {
channels(input: { organizationId: "your_org_id" }) {
id
name
service
avatar
isQueuePaused
}
}
"""
response = requests.post(
"https://api.buffer.com",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY",
},
json={
"query": query,
},
)
data = response.json()
print(data)
<?php
$query = '
query {
channels(input: { organizationId: "your_org_id" }) {
id
name
service
avatar
isQueuePaused
}
}
';
$payload = [
'query' => $query,
];
$ch = curl_init('https://api.buffer.com');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'Authorization: Bearer YOUR_API_KEY',
],
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
REST: GET /profiles/:id.json
GraphQL:
query {
channel(input: { id: "your_channel_id" }) {
id
name
service
displayName
avatar
}
}
curl -X POST 'https://api.buffer.com' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{"query": "query {\n channel(input: { id: \"your_channel_id\" }) {\n id\n name\n service\n displayName\n avatar\n }\n}"}'
async function main() {
const response = await fetch('https://api.buffer.com', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY',
},
body: JSON.stringify({
query: `
query {
channel(input: { id: "your_channel_id" }) {
id
name
service
displayName
avatar
}
}
`,
}),
});
const data = await response.json();
console.log(JSON.stringify(data, null, 2));
}
main();
import requests
query = """
query {
channel(input: { id: "your_channel_id" }) {
id
name
service
displayName
avatar
}
}
"""
response = requests.post(
"https://api.buffer.com",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY",
},
json={
"query": query,
},
)
data = response.json()
print(data)
<?php
$query = '
query {
channel(input: { id: "your_channel_id" }) {
id
name
service
displayName
avatar
}
}
';
$payload = [
'query' => $query,
];
$ch = curl_init('https://api.buffer.com');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'Authorization: Bearer YOUR_API_KEY',
],
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
Key difference: You now need an
organizationIdto list channels. Query your account first to get it.
Updates -> Posts
Updates are now called posts.
List queued posts
REST: GET /profiles/:id/updates/pending.json?count=10&page=1
GraphQL:
query {
posts(
first: 10
input: {
organizationId: "your_org_id"
filter: {
status: [scheduled]
channelIds: ["your_channel_id"]
}
sort: [{ field: dueAt, direction: asc }]
}
) {
edges {
node {
id
text
status
dueAt
channelId
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
curl -X POST 'https://api.buffer.com' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{"query": "query {\n posts(\n first: 10\n input: {\n organizationId: \"your_org_id\"\n filter: {\n status: [scheduled]\n channelIds: [\"your_channel_id\"]\n }\n sort: [{ field: dueAt, direction: asc }]\n }\n ) {\n edges {\n node {\n id\n text\n status\n dueAt\n channelId\n }\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n}"}'
async function main() {
const response = await fetch('https://api.buffer.com', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY',
},
body: JSON.stringify({
query: `
query {
posts(
first: 10
input: {
organizationId: "your_org_id"
filter: {
status: [scheduled]
channelIds: ["your_channel_id"]
}
sort: [{ field: dueAt, direction: asc }]
}
) {
edges {
node {
id
text
status
dueAt
channelId
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
`,
}),
});
const data = await response.json();
console.log(JSON.stringify(data, null, 2));
}
main();
import requests
query = """
query {
posts(
first: 10
input: {
organizationId: "your_org_id"
filter: {
status: [scheduled]
channelIds: ["your_channel_id"]
}
sort: [{ field: dueAt, direction: asc }]
}
) {
edges {
node {
id
text
status
dueAt
channelId
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
"""
response = requests.post(
"https://api.buffer.com",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY",
},
json={
"query": query,
},
)
data = response.json()
print(data)
<?php
$query = '
query {
posts(
first: 10
input: {
organizationId: "your_org_id"
filter: {
status: [scheduled]
channelIds: ["your_channel_id"]
}
sort: [{ field: dueAt, direction: asc }]
}
) {
edges {
node {
id
text
status
dueAt
channelId
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
';
$payload = [
'query' => $query,
];
$ch = curl_init('https://api.buffer.com');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'Authorization: Bearer YOUR_API_KEY',
],
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
List sent posts
REST: GET /profiles/:id/updates/sent.json?count=10
GraphQL:
query {
posts(
first: 10
input: {
organizationId: "your_org_id"
filter: {
status: [sent]
channelIds: ["your_channel_id"]
}
sort: [{ field: createdAt, direction: desc }]
}
) {
edges {
node {
id
text
sentAt
externalLink
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
curl -X POST 'https://api.buffer.com' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{"query": "query {\n posts(\n first: 10\n input: {\n organizationId: \"your_org_id\"\n filter: {\n status: [sent]\n channelIds: [\"your_channel_id\"]\n }\n sort: [{ field: createdAt, direction: desc }]\n }\n ) {\n edges {\n node {\n id\n text\n sentAt\n externalLink\n }\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n}"}'
async function main() {
const response = await fetch('https://api.buffer.com', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY',
},
body: JSON.stringify({
query: `
query {
posts(
first: 10
input: {
organizationId: "your_org_id"
filter: {
status: [sent]
channelIds: ["your_channel_id"]
}
sort: [{ field: createdAt, direction: desc }]
}
) {
edges {
node {
id
text
sentAt
externalLink
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
`,
}),
});
const data = await response.json();
console.log(JSON.stringify(data, null, 2));
}
main();
import requests
query = """
query {
posts(
first: 10
input: {
organizationId: "your_org_id"
filter: {
status: [sent]
channelIds: ["your_channel_id"]
}
sort: [{ field: createdAt, direction: desc }]
}
) {
edges {
node {
id
text
sentAt
externalLink
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
"""
response = requests.post(
"https://api.buffer.com",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY",
},
json={
"query": query,
},
)
data = response.json()
print(data)
<?php
$query = '
query {
posts(
first: 10
input: {
organizationId: "your_org_id"
filter: {
status: [sent]
channelIds: ["your_channel_id"]
}
sort: [{ field: createdAt, direction: desc }]
}
) {
edges {
node {
id
text
sentAt
externalLink
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
';
$payload = [
'query' => $query,
];
$ch = curl_init('https://api.buffer.com');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'Authorization: Bearer YOUR_API_KEY',
],
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
Sent posts older than two years are not returned, because Buffer permanently deletes them. See Retrieving posts.
Get a single post
REST: GET /updates/:id.json
GraphQL:
query {
post(input: { id: "your_post_id" }) {
id
text
status
dueAt
sentAt
channelId
}
}
curl -X POST 'https://api.buffer.com' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{"query": "query {\n post(input: { id: \"your_post_id\" }) {\n id\n text\n status\n dueAt\n sentAt\n channelId\n }\n}"}'
async function main() {
const response = await fetch('https://api.buffer.com', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY',
},
body: JSON.stringify({
query: `
query {
post(input: { id: "your_post_id" }) {
id
text
status
dueAt
sentAt
channelId
}
}
`,
}),
});
const data = await response.json();
console.log(JSON.stringify(data, null, 2));
}
main();
import requests
query = """
query {
post(input: { id: "your_post_id" }) {
id
text
status
dueAt
sentAt
channelId
}
}
"""
response = requests.post(
"https://api.buffer.com",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY",
},
json={
"query": query,
},
)
data = response.json()
print(data)
<?php
$query = '
query {
post(input: { id: "your_post_id" }) {
id
text
status
dueAt
sentAt
channelId
}
}
';
$payload = [
'query' => $query,
];
$ch = curl_init('https://api.buffer.com');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'Authorization: Bearer YOUR_API_KEY',
],
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
Post statistics
REST: the statistics object on each update, and GET /updates/:id/interactions.json
Performance data for sent posts is available on Post.metrics, with values normalized across networks. Reading metrics needs a personal API key; App Clients can't read them. Individual interactions, such as each comment or retweet, aren't available. See Post Metrics.
Create a post
REST: POST /updates/create.json with profile_ids[], text, scheduled_at, media[photo], etc.
GraphQL:
mutation {
createPost(input: {
text: "Hello from the new API!"
channelId: "your_channel_id"
schedulingType: automatic
mode: addToQueue
}) {
... on PostActionSuccess {
post {
id
text
status
}
}
... on MutationError {
message
}
}
}
curl -X POST 'https://api.buffer.com' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{"query": "mutation {\n createPost(input: {\n text: \"Hello from the new API!\"\n channelId: \"your_channel_id\"\n schedulingType: automatic\n mode: addToQueue\n }) {\n ... on PostActionSuccess {\n post {\n id\n text\n status\n }\n }\n ... on MutationError {\n message\n }\n }\n}"}'
async function main() {
const response = await fetch('https://api.buffer.com', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY',
},
body: JSON.stringify({
query: `
mutation {
createPost(input: {
text: "Hello from the new API!"
channelId: "your_channel_id"
schedulingType: automatic
mode: addToQueue
}) {
... on PostActionSuccess {
post {
id
text
status
}
}
... on MutationError {
message
}
}
}
`,
}),
});
const data = await response.json();
console.log(JSON.stringify(data, null, 2));
}
main();
import requests
query = """
mutation {
createPost(input: {
text: "Hello from the new API!"
channelId: "your_channel_id"
schedulingType: automatic
mode: addToQueue
}) {
... on PostActionSuccess {
post {
id
text
status
}
}
... on MutationError {
message
}
}
}
"""
response = requests.post(
"https://api.buffer.com",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY",
},
json={
"query": query,
},
)
data = response.json()
print(data)
<?php
$query = '
mutation {
createPost(input: {
text: "Hello from the new API!"
channelId: "your_channel_id"
schedulingType: automatic
mode: addToQueue
}) {
... on PostActionSuccess {
post {
id
text
status
}
}
... on MutationError {
message
}
}
}
';
$payload = [
'query' => $query,
];
$ch = curl_init('https://api.buffer.com');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'Authorization: Bearer YOUR_API_KEY',
],
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
Key differences:
- Posts are created for a single
channelIdinstead of an array ofprofile_ids. To post to multiple channels, send one mutation per channel.- Use
mode: addToQueueto add to the queue, ormode: customScheduledwith adueAttimestamp for a specific time.- Errors are returned as typed unions in the response, not as HTTP status codes.
Edit a post
REST: POST /updates/:id/update.json
GraphQL:
mutation {
editPost(input: {
id: "your_post_id"
text: "Updated text"
}) {
... on PostActionSuccess {
post {
id
text
dueAt
}
}
... on MutationError {
message
}
}
}
curl -X POST 'https://api.buffer.com' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{"query": "mutation {\n editPost(input: {\n id: \"your_post_id\"\n text: \"Updated text\"\n }) {\n ... on PostActionSuccess {\n post {\n id\n text\n dueAt\n }\n }\n ... on MutationError {\n message\n }\n }\n}"}'
async function main() {
const response = await fetch('https://api.buffer.com', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY',
},
body: JSON.stringify({
query: `
mutation {
editPost(input: {
id: "your_post_id"
text: "Updated text"
}) {
... on PostActionSuccess {
post {
id
text
dueAt
}
}
... on MutationError {
message
}
}
}
`,
}),
});
const data = await response.json();
console.log(JSON.stringify(data, null, 2));
}
main();
import requests
query = """
mutation {
editPost(input: {
id: "your_post_id"
text: "Updated text"
}) {
... on PostActionSuccess {
post {
id
text
dueAt
}
}
... on MutationError {
message
}
}
}
"""
response = requests.post(
"https://api.buffer.com",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY",
},
json={
"query": query,
},
)
data = response.json()
print(data)
<?php
$query = '
mutation {
editPost(input: {
id: "your_post_id"
text: "Updated text"
}) {
... on PostActionSuccess {
post {
id
text
dueAt
}
}
... on MutationError {
message
}
}
}
';
$payload = [
'query' => $query,
];
$ch = curl_init('https://api.buffer.com');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'Authorization: Bearer YOUR_API_KEY',
],
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
Only the fields you send are changed. Leave out mode to keep the post where it is in the queue.
Delete a post
REST: POST /updates/:id/destroy.json
GraphQL:
mutation {
deletePost(input: { id: "your_post_id" }) {
... on DeletePostSuccess {
id
}
... on MutationError {
message
}
}
}
curl -X POST 'https://api.buffer.com' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{"query": "mutation {\n deletePost(input: { id: \"your_post_id\" }) {\n ... on DeletePostSuccess {\n id\n }\n ... on MutationError {\n message\n }\n }\n}"}'
async function main() {
const response = await fetch('https://api.buffer.com', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY',
},
body: JSON.stringify({
query: `
mutation {
deletePost(input: { id: "your_post_id" }) {
... on DeletePostSuccess {
id
}
... on MutationError {
message
}
}
}
`,
}),
});
const data = await response.json();
console.log(JSON.stringify(data, null, 2));
}
main();
import requests
query = """
mutation {
deletePost(input: { id: "your_post_id" }) {
... on DeletePostSuccess {
id
}
... on MutationError {
message
}
}
}
"""
response = requests.post(
"https://api.buffer.com",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY",
},
json={
"query": query,
},
)
data = response.json()
print(data)
<?php
$query = '
mutation {
deletePost(input: { id: "your_post_id" }) {
... on DeletePostSuccess {
id
}
... on MutationError {
message
}
}
}
';
$payload = [
'query' => $query,
];
$ch = curl_init('https://api.buffer.com');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'Authorization: Bearer YOUR_API_KEY',
],
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
Scheduling
REST: GET /profiles/:id/schedules.json and POST /profiles/:id/schedules/update.json
You can read a channel's posting schedule, but not change it through the API:
query {
channel(input: { id: "your_channel_id" }) {
postingSchedule {
day
times
paused
}
}
}
curl -X POST 'https://api.buffer.com' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{"query": "query {\n channel(input: { id: \"your_channel_id\" }) {\n postingSchedule {\n day\n times\n paused\n }\n }\n}"}'
async function main() {
const response = await fetch('https://api.buffer.com', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY',
},
body: JSON.stringify({
query: `
query {
channel(input: { id: "your_channel_id" }) {
postingSchedule {
day
times
paused
}
}
}
`,
}),
});
const data = await response.json();
console.log(JSON.stringify(data, null, 2));
}
main();
import requests
query = """
query {
channel(input: { id: "your_channel_id" }) {
postingSchedule {
day
times
paused
}
}
}
"""
response = requests.post(
"https://api.buffer.com",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY",
},
json={
"query": query,
},
)
data = response.json()
print(data)
<?php
$query = '
query {
channel(input: { id: "your_channel_id" }) {
postingSchedule {
day
times
paused
}
}
}
';
$payload = [
'query' => $query,
];
$ch = curl_init('https://api.buffer.com');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'Authorization: Bearer YOUR_API_KEY',
],
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
Instead of managing the time slots, you control scheduling per post:
- Add to queue: Set
mode: addToQueue - Custom time: Set
mode: customScheduledwithdueAtas an ISO 8601 timestamp (UTC) - Post now: Set
mode: shareNow - Next in the queue: Set
mode: shareNextto give the post the next open slot
Each of these is set via the mode field on createPost or editPost. createPost also requires schedulingType: use automatic for most channels, and notification for channels that only support reminders, such as Instagram personal profiles. On editPost, schedulingType is optional, and leaving it out keeps the post's current publishing method. See Automatic and notification publishing.
Links
REST: GET /links/shares.json?url=https://example.com
This endpoint has no direct equivalent in the GraphQL API. If you were using it for analytics, Buffer's analytics features are available in the dashboard.
Configuration
REST: GET /info/configuration.json
Platform configuration (character limits, supported media types, etc.) is no longer exposed as a standalone endpoint. These constraints are enforced server-side - if you exceed a limit, you'll get an InvalidInputError with a clear message. The text limit for each network is listed in Character Limits.
Pagination
The REST API used offset-based pagination (page=1&count=10). Our GraphQL API uses cursor-based pagination, which is more reliable when data changes between requests.
REST (before):
GET /profiles/:id/updates/sent.json?page=2&count=20
GraphQL (now):
query {
posts(
first: 20
after: "cursor_from_previous_page"
input: { organizationId: "your_org_id" }
) {
edges {
node { id, text }
}
pageInfo {
hasNextPage
endCursor
}
}
}
curl -X POST 'https://api.buffer.com' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-d '{"query": "query {\n posts(\n first: 20\n after: \"cursor_from_previous_page\"\n input: { organizationId: \"your_org_id\" }\n ) {\n edges {\n node { id, text }\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n}"}'
async function main() {
const response = await fetch('https://api.buffer.com', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY',
},
body: JSON.stringify({
query: `
query {
posts(
first: 20
after: "cursor_from_previous_page"
input: { organizationId: "your_org_id" }
) {
edges {
node { id, text }
}
pageInfo {
hasNextPage
endCursor
}
}
}
`,
}),
});
const data = await response.json();
console.log(JSON.stringify(data, null, 2));
}
main();
import requests
query = """
query {
posts(
first: 20
after: "cursor_from_previous_page"
input: { organizationId: "your_org_id" }
) {
edges {
node { id, text }
}
pageInfo {
hasNextPage
endCursor
}
}
}
"""
response = requests.post(
"https://api.buffer.com",
headers={
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY",
},
json={
"query": query,
},
)
data = response.json()
print(data)
<?php
$query = '
query {
posts(
first: 20
after: "cursor_from_previous_page"
input: { organizationId: "your_org_id" }
) {
edges {
node { id, text }
}
pageInfo {
hasNextPage
endCursor
}
}
}
';
$payload = [
'query' => $query,
];
$ch = curl_init('https://api.buffer.com');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'Authorization: Bearer YOUR_API_KEY',
],
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
To paginate, pass the endCursor from the previous response as the after argument in your next query. See the Pagination guide for more details.
Error handling
The REST API used HTTP status codes (401, 404, 429, etc.) and numeric error codes in the body. Our GraphQL API always returns HTTP 200 and uses typed error unions instead.
REST (before):
HTTP 403
{
"code": 1023,
"error": "Profile update quota exceeded."
}
GraphQL (now):
{
"data": {
"createPost": {
"message": "Queue limit reached"
}
}
}
Always include ... on MutationError { message } as a catch-all in your mutations. See Error Handling for the full guide.
Rate limits
The GraphQL API applies rate limits across 15-minute, 24-hour, and 30-day windows. All of your API keys and MCP connections share one quota, which depends on your Buffer plan. Its 30-day limit grows with the number of unlocked channels in your organization, up to your plan's maximum. Each App Client gets its own quota, which grows with the number of Buffer users who have authorized it.
Every response includes RateLimit headers so you can track your remaining quota, and exceeding a limit returns HTTP 429 with a RATE_LIMIT_EXCEEDED error. See the Rate Limits guide for the full details.
Concepts that don't carry over
A few REST API features work differently or aren't yet available in our GraphQL API:
/updates/:id/share.json(post immediately) - useeditPostwithmode: shareNowfor an existing post, ormode: shareNowoncreatePostfor a new one/updates/:id/move_to_top.json- useeditPostwithmode: shareNext/profiles/:id/updates/reorder.jsonand/profiles/:id/updates/shuffle.json- not available/profiles/:id/schedules/update.json- posting schedules can be read but not changed/updates/:id/interactions.json- individual interactions are not available. UsePost.metricsfor totals/user/deauthorize.json- API keys can be revoked from your account settings. People who authorized an App Client can disconnect it from their Buffer account settings/links/shares.json- share counts are not available via the API/info/configuration.json- platform limits are enforced server-side with clear validation errors. See Character Limits
Tools for exploring the GraphQL API
GraphQL API comes with a set of tools to explore the schema and learn more about the supported methods:
- GraphQL for REST Developers - a short primer on queries, mutations, and how GraphQL differs from the REST model you're used to.
- Buffer API Explorer - run queries and mutations right in your browser, with schema-aware autocomplete and inline docs. No local setup required.
- Buffer CLI - run queries and mutations from your terminal, and use
buffer schemato discover fields, input types, and enum values before writing any code.