Create and Update Tags

$ curl https://api.intercom.io/tags \
-X POST \
-H 'Authorization:Bearer <Your access token>' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' -d'
{
  "name": "Independent"
}'
HTTP/1.1 200 Ok

{
  "type": "tag",
  "name": "Independent",
  "id": "17513"
}
intercom.tags.tag(name: 'Independent', users: [{ id: "42ea2f1b93891f6a99000427" }])
<?php
$intercom->tags->tag(["name" => "php-tag"]);
?>
Tag t = new Tag().setName("Independent");
t = Tag.create(t);
$ curl https://api.intercom.io/tags \
-X POST \
-H 'Authorization:Bearer <Your access token>' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' -d'
{
  "id": "17513",
  "name": "Independent"
}'
HTTP/1.1 200 Ok

{
  "type": "tag",
  "name": "Independent",
  "id": "17513"
}
intercom.tags.tag(name: 'Independent', users: [ { id: "42ea2f1b93891f6a99000427" } ])
<?php
$intercom->tags->tag(["id" => "1160078", "name" => "php-tag-new"]);
?>
tag.setName("independent");
Tag.update(tag);

You can create a new tag by submitting a POST to https://api.intercom.io/tags along with a name for the tag. The tag name may contain whitespace and punctuation.

If the same tag name is sent multiple times, only one tag will be created for that name - this lets you avoid checking if a tag exists first.

Tag names are case insensitive - 'MyTag' and 'mytag' will result in a single tag being created.

A tag's name can also be updated by posting a tag to https://api.intercom.io/tags. The submitted tag object will contain the id of the tag to update and a new name for the tag. A successful request will update the name value for that tag and return the updated tag in the response.

Attributes

AttributeRequiredDescription
nameYesThe name of the tag, which will be created if not found, or the new name for the tag if this is an update request.
idYes for updateThe id of tag to updates.

Returns

The newly created or updated tag object containing its name and id fields.