Tag companies

Example Request & Response

$ curl https://api.intercom.io/tags \
-XPOST \
-H 'Authorization:Bearer <Your access token>' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' -d'
{
  "name": "Independent",
  "companies": [
    {
      "id" : "53427b7ecce5722303000003"
    }
  ]
}
HTTP/1.1 200 Ok

{
  "type": "tag",
  "name": "Independent",
  "id": "17513"
}
intercom.tags.tag(name: 'Independent', users: [{ id: "42ea2f1b93891f6a99000427" }, { email: "foo@bar.com" }])
<?php
# Note that you can use either id, user_id or email to tag a user.
# You only need to use one per user, e.g. the below will tag
# three users if each identifier is for a different, unique user
$intercom->tags->tag([
    "name" => "VIPs",
    "users" => [
        ["id" => "5977e20941abfc5aae4552d1"],
        ["user_id" => "12345"],
        ["email" => "camus@phil.com"]
    ]
]);
?>
User one = new User().setEmail("river@serenity.io");
User two = new User().setEmail("simon@serenity.io")
List<User> users = Lists.newArrayList(one, two);
Tag.tag(tag, new UserCollection(users));

You can tag a single or a list of companies.

Request Body Parameters

ParametersTypeRequiredDescription
nameStringYesThe name of the tag, which will be created if not found.
companiesObjectYesAn array of objects with the unique id or company_id of the company to be tagged.

Response

This will return a Tag Model for the tag that was applied to the given company.