API Status Get API Key

Create Notification Post

Try in Explorer

Create a post that Buffer sends as a reminder to the Buffer mobile app, so someone can publish it by hand. Instagram personal profiles and Facebook Groups only accept notification posts.

Set schedulingType to notification. Everything else works like any other post. See Automatic and notification publishing for which channels support it.

mutation CreatePost {
  createPost(
    input: {
      text: "Hello there, this is another one!"
      channelId: "some_channel_id"
      schedulingType: notification
      mode: addToQueue
      assets: [
        {
          image: {
            url: "https://images.unsplash.com/photo-1742850541164-8eb59ecb3282?q=80&w=3388&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
          }
        }
      ]
    }
  ) {
    ... on PostActionSuccess {
      post {
        id
        schedulingType
        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 CreatePost {\n  createPost(\n    input: {\n      text: \"Hello there, this is another one!\"\n      channelId: \"some_channel_id\"\n      schedulingType: notification\n      mode: addToQueue\n      assets: [\n        {\n          image: {\n            url: \"https://images.unsplash.com/photo-1742850541164-8eb59ecb3282?q=80&w=3388&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\"\n          }\n        }\n      ]\n    }\n  ) {\n    ... on PostActionSuccess {\n      post {\n        id\n        schedulingType\n        dueAt\n      }\n    }\n    ... on MutationError {\n      message\n    }\n  }\n}"}'
async function createPost() {
  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 {
        createPost(
          input: {
            text: "Hello there, this is another one!"
            channelId: "some_channel_id"
            schedulingType: notification
            mode: addToQueue
            assets: [
              {
                image: {
                  url: "https://images.unsplash.com/photo-1742850541164-8eb59ecb3282?q=80&w=3388&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
                }
              }
            ]
          }
        ) {
          ... on PostActionSuccess {
            post {
              id
              schedulingType
              dueAt
            }
          }
          ... on MutationError {
            message
          }
        }
      }
      `,
    }),
  });

  const data = await response.json();
  console.log(JSON.stringify(data, null, 2));
}

createPost();
import requests

query = """
mutation CreatePost {
  createPost(
    input: {
      text: "Hello there, this is another one!"
      channelId: "some_channel_id"
      schedulingType: notification
      mode: addToQueue
      assets: [
        {
          image: {
            url: "https://images.unsplash.com/photo-1742850541164-8eb59ecb3282?q=80&w=3388&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
          }
        }
      ]
    }
  ) {
    ... on PostActionSuccess {
      post {
        id
        schedulingType
        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 CreatePost {
  createPost(
    input: {
      text: "Hello there, this is another one!"
      channelId: "some_channel_id"
      schedulingType: notification
      mode: addToQueue
      assets: [
        {
          image: {
            url: "https://images.unsplash.com/photo-1742850541164-8eb59ecb3282?q=80&w=3388&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
          }
        }
      ]
    }
  ) {
    ... on PostActionSuccess {
      post {
        id
        schedulingType
        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);