Buffer
Buffer API integration with managed authentication. Schedule and manage social media posts across multiple platforms. Use this skill when users want to schedule posts, manage channels, view organizations, or create content ideas in Buffer. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).
安装 / 下载方式
TotalClaw CLI推荐
totalclaw install clawskills:byungkyu~buffer-apicURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/clawskills%3Abyungkyu~buffer-api/file -o buffer-api.mdGit 仓库获取源码
git clone https://github.com/openclaw/skills/commit/69988edc3a7177796228c34763f7270dba7225d4# Buffer
Access the Buffer GraphQL API with managed authentication. Schedule and manage social media posts across Instagram, Facebook, Twitter, LinkedIn, TikTok, and more.
## Quick Start
```bash
# Get account info with organizations
python <<'EOF'
import urllib.request, os, json
data = json.dumps({
"query": "query { account { id email organizations { id name } } }"
}).encode()
req = urllib.request.Request('https://gateway.maton.ai/buffer/', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
```
## Base URL
```
https://gateway.maton.ai/buffer/
```
Buffer uses a single GraphQL endpoint. All queries and mutations are sent as POST requests to this endpoint.
## Authentication
All requests require the Maton API key in the Authorization header:
```
Authorization: Bearer $MATON_API_KEY
```
**Environment Variable:** Set your API key as `MATON_API_KEY`:
```bash
export MATON_API_KEY="YOUR_API_KEY"
```
### Getting Your API Key
1. Sign in or create an account at [maton.ai](https://maton.ai)
2. Go to [maton.ai/settings](https://maton.ai/settings)
3. Copy your API key
## Connection Management
Manage your Buffer connections at `https://ctrl.maton.ai`.
### List Connections
```bash
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections?app=buffer&status=ACTIVE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
```
### Create Connection
```bash
python <<'EOF'
import urllib.request, os, json
data = json.dumps({'app': 'buffer'}).encode()
req = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
```
### Get Connection
```bash
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
```
**Response:**
```json
{
"connection": {
"connection_id": "a71282a3-52be-473d-9273-22b4546dc146",
"status": "ACTIVE",
"creation_time": "2026-03-12T00:18:28.327860Z",
"last_updated_time": "2026-03-12T00:18:42.818009Z",
"url": "https://connect.maton.ai/?session_token=...",
"app": "buffer",
"metadata": {},
"method": "API_KEY"
}
}
```
### Delete Connection
```bash
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
```
### Specifying Connection
If you have multiple Buffer connections, specify which one to use with the `Maton-Connection` header:
```bash
python <<'EOF'
import urllib.request, os, json
data = json.dumps({"query": "query { account { id } }"}).encode()
req = urllib.request.Request('https://gateway.maton.ai/buffer/', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
req.add_header('Maton-Connection', 'a71282a3-52be-473d-9273-22b4546dc146')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
```
If omitted, the gateway uses the default (oldest) active connection.
## API Reference
### Get Account
```bash
python <<'EOF'
import urllib.request, os, json
data = json.dumps({
"query": """
query {
account {
id
email
name
avatar
timezone
createdAt
preferences {
timeFormat
startOfWeek
}
}
}
"""
}).encode()
req = urllib.request.Request('https://gateway.maton.ai/buffer/', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
```
**Response:**
```json
{
"data": {
"account": {
"id": "69846f7479b75e6487fa3482",
"email": "user@example.com",
"name": "John Doe",
"avatar": "https://...",
"timezone": "America/New_York",
"createdAt": "2024-01-15T10:30:00Z",
"preferences": {
"timeFormat": "12h",
"startOfWeek": "sunday"
}
}
}
}
```
### Get Organizations
```bash
python <<'EOF'
import urllib.request, os, json
data = json.dumps({
"query": """
query {
account {
organizations {
id
name
channels {
id
name
service
avatar
isDisconnected
}
}
}
}
"""
}).encode()
req = urllib.request.Request('https://gateway.maton.ai/buffer/', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
```
**Response:**
```json
{
"data": {
"account": {
"organizations": [
{
"id": "69846f7479b75e6487fa3484",
"name": "My Organization",
"channels": [
{
"id": "channel123",
"name": "My Twitter",
"service": "twitter",
"avatar": "https://...",
"isDisconnected": false
}
]
}
]
}
}
}
```
### Get Channels
```bash
python <<'EOF'
import urllib.request, os, json
data = json.dumps({
"query": """
query GetChannels($organizationId: OrganizationId!) {
channels(organizationId: $organizationId) {
id
name
service
displayName
avatar
timezone
isDisconnected
isQueuePaused
postingSchedule {
days
times
}
}
}
""",
"variables": {
"organizationId": "69846f7479b75e6487fa3484"
}
}).encode()
req = urllib.request.Request('https://gateway.maton.ai/buffer/', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
```
### Get Single Channel
```bash
python <<'EOF'
import urllib.request, os, json
data = json.dumps({
"query": """
query GetChannel($channelId: ChannelId!) {
channel(channelId: $channelId) {
id
name
service
displayName
avatar
timezone
postingSchedule {
days
times
}
postingGoal {
postsPerWeek
progress
}
}
}
""",
"variables": {
"channelId": "channel123"
}
}).encode()
req = urllib.request.Request('https://gateway.maton.ai/buffer/', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
```
### List Posts
```bash
python <<'EOF'
import urllib.request, os, json
data = json.dumps({
"query": """
query GetPosts($channelId: ChannelId!, $status: PostStatus, $first: Int) {
posts(