Join Buffer’s first Build Contest. October 28 - November 13

Register
API Status Get API Key

Selectable Team Members

Try in Explorer

Find selectable team members on a channel. This operation is experimental. Requires the notes:read scope.

See Team Members for scopes, search and pagination, and Notes to use a returned URN in a mention.

query SelectableTeamMembers {
  selectableTeamMembers(
    input: {
      scope: { channelId: "YOUR_CHANNEL_ID" }
      search: "alex"
    }
    first: 20
    after: null
  ) {
    edges {
      cursor
      node { id urn name email avatar isLocked }
    }
    pageInfo { hasNextPage endCursor }
  }
}
curl -X POST 'https://api.buffer.com' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -d '{"query": "query SelectableTeamMembers {\n  selectableTeamMembers(\n    input: {\n      scope: { channelId: \"YOUR_CHANNEL_ID\" }\n      search: \"alex\"\n    }\n    first: 20\n    after: null\n  ) {\n    edges {\n      cursor\n      node { id urn name email avatar isLocked }\n    }\n    pageInfo { hasNextPage endCursor }\n  }\n}"}'
async function selectableTeamMembers() {
  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 SelectableTeamMembers {
        selectableTeamMembers(
          input: {
            scope: { channelId: "YOUR_CHANNEL_ID" }
            search: "alex"
          }
          first: 20
          after: null
        ) {
          edges {
            cursor
            node { id urn name email avatar isLocked }
          }
          pageInfo { hasNextPage endCursor }
        }
      }
      `,
    }),
  });

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

selectableTeamMembers();
import requests

query = """
query SelectableTeamMembers {
  selectableTeamMembers(
    input: {
      scope: { channelId: "YOUR_CHANNEL_ID" }
      search: "alex"
    }
    first: 20
    after: null
  ) {
    edges {
      cursor
      node { id urn name email avatar isLocked }
    }
    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 SelectableTeamMembers {
  selectableTeamMembers(
    input: {
      scope: { channelId: "YOUR_CHANNEL_ID" }
      search: "alex"
    }
    first: 20
    after: null
  ) {
    edges {
      cursor
      node { id urn name email avatar isLocked }
    }
    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);

For organization members, replace scope with { organizationId: "YOUR_ORGANIZATION_ID" }. Omit search to list all eligible members. Reset after when the scope or search changes.