API Status Get API Key

Update Tag

Try in Explorer

Rename or recolor an existing tag. Both fields are replaced, so send the current value for the one you are not changing. Requires the posts:write scope.

mutation UpdateTag {
  updateTag(input: {
    id: "some_tag_id",
    tag: {
      name: "Summer sales 2026"
      color: "#2AF598"
    }
  }) {
    ... on TagActionSuccess {
      tag {
        id
        name
        color
        colorName
        isLocked
      }
    }
    ... on MutationError {
      message
    }
  }
}
curl -X POST 'https://api.buffer.com' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -d '{"query": "mutation UpdateTag {\n  updateTag(input: {\n    id: \"some_tag_id\",\n    tag: {\n      name: \"Summer sales 2026\"\n      color: \"#2AF598\"\n    }\n  }) {\n    ... on TagActionSuccess {\n      tag {\n        id\n        name\n        color\n        colorName\n        isLocked\n      }\n    }\n    ... on MutationError {\n      message\n    }\n  }\n}"}'
async function updateTag() {
  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 UpdateTag {
        updateTag(input: {
          id: "some_tag_id",
          tag: {
            name: "Summer sales 2026"
            color: "#2AF598"
          }
        }) {
          ... on TagActionSuccess {
            tag {
              id
              name
              color
              colorName
              isLocked
            }
          }
          ... on MutationError {
            message
          }
        }
      }
      `,
    }),
  });

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

updateTag();
import requests

query = """
mutation UpdateTag {
  updateTag(input: {
    id: "some_tag_id",
    tag: {
      name: "Summer sales 2026"
      color: "#2AF598"
    }
  }) {
    ... on TagActionSuccess {
      tag {
        id
        name
        color
        colorName
        isLocked
      }
    }
    ... 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 UpdateTag {
  updateTag(input: {
    id: "some_tag_id",
    tag: {
      name: "Summer sales 2026"
      color: "#2AF598"
    }
  }) {
    ... on TagActionSuccess {
      tag {
        id
        name
        color
        colorName
        isLocked
      }
    }
    ... 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);