API Status Get API Key

Get Tags

Try in Explorer

Fetch a page of an organization's tags, sorted by name. Pass the previous page's pageInfo.endCursor as after to fetch the next page.

query GetTags {
  tagsV2(
    after: "cursor_to_start_after",
    first: 20,
    input: {organizationId: "some_organization_id", filter: {isLocked: false}}
  ) {
    pageInfo {
      startCursor
      endCursor
      hasNextPage
    }
    edges {
      node {
        id
        name
        color
        colorName
        isLocked
      }
    }
    totalCount
  }
}
curl -X POST 'https://api.buffer.com' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -d '{"query": "query GetTags {\n  tagsV2(\n    after: \"cursor_to_start_after\",\n    first: 20,\n    input: {organizationId: \"some_organization_id\", filter: {isLocked: false}}\n  ) {\n    pageInfo {\n      startCursor\n      endCursor\n      hasNextPage\n    }\n    edges {\n      node {\n        id\n        name\n        color\n        colorName\n        isLocked\n      }\n    }\n    totalCount\n  }\n}"}'
async function getTags() {
  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 GetTags {
        tagsV2(
          after: "cursor_to_start_after",
          first: 20,
          input: {organizationId: "some_organization_id", filter: {isLocked: false}}
        ) {
          pageInfo {
            startCursor
            endCursor
            hasNextPage
          }
          edges {
            node {
              id
              name
              color
              colorName
              isLocked
            }
          }
          totalCount
        }
      }
      `,
    }),
  });

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

getTags();
import requests

query = """
query GetTags {
  tagsV2(
    after: "cursor_to_start_after",
    first: 20,
    input: {organizationId: "some_organization_id", filter: {isLocked: false}}
  ) {
    pageInfo {
      startCursor
      endCursor
      hasNextPage
    }
    edges {
      node {
        id
        name
        color
        colorName
        isLocked
      }
    }
    totalCount
  }
}
"""

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 GetTags {
  tagsV2(
    after: "cursor_to_start_after",
    first: 20,
    input: {organizationId: "some_organization_id", filter: {isLocked: false}}
  ) {
    pageInfo {
      startCursor
      endCursor
      hasNextPage
    }
    edges {
      node {
        id
        name
        color
        colorName
        isLocked
      }
    }
    totalCount
  }
}
';

$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);