Skip to content

Create or update a tag, Tag or untag companies, Tag contacts

Request

You can use this endpoint to perform the following operations:

1. Create a new tag: You can create a new tag by passing in the tag name as specified in "Create or Update Tag Request Payload" described below.

2. Update an existing tag: You can update an existing tag by passing the id of the tag as specified in "Create or Update Tag Request Payload" described below.

3. Tag Companies: You can tag single company or a list of companies. You can tag a company by passing in the tag name and the company details as specified in "Tag Company Request Payload" described below. Also, if the tag doesn't exist then a new one will be created automatically.

4. Untag Companies: You can untag a single company or a list of companies. You can untag a company by passing in the tag id and the company details as specified in "Untag Company Request Payload" described below.

5. Tag Multiple Users: You can tag a list of users. You can tag the users by passing in the tag name and the user details as specified in "Tag Users Request Payload" described below.

Each operation will return a tag object.

Contacts and companies listed in users or companies that do not exist are skipped: they are left out of the users and companies arrays in the response and the request still succeeds. With ids_to_add it depends on taggable_type: a contact id that does not exist returns a 404, while a company id that does not exist is skipped. With ids_to_add, the users and companies arrays in the response are always empty, and a 404 still leaves the tag created or renamed.

Requires the write_tags or write_users_companies OAuth scope.

Security
bearerAuth
Headers
Intercom-Versionstring(intercom_version)

Intercom API version.
If you omit the header, the API uses the version set in your app package, and 1.0 if none is set.

Enum:"1.0""1.1""1.2""1.3""1.4""2.0""2.1""2.2""2.3""2.4"
Example:2.17
Bodyapplication/json
Any of:

You can create or update an existing tag, and optionally apply it to a list of contact or company ids.

namestring, <= 191 charactersrequired

The name of the tag, which will be created if not found, or the new name for the tag if this is an update request. Names are case insensitive and can be at most 191 characters long. Creating a tag with a longer name returns a 400. When updating by id, a longer name or one that another tag already has returns 200 with the new name, but the tag keeps its old name.

Example:"Independent"
idstring

The id of tag to updates.

Example:"656452352"
ids_to_addArray of strings

The Intercom ids of the contacts or companies to apply the tag to. A contact id that does not exist returns a 404; a company id that does not exist is skipped. A 404 still leaves the tag created or renamed. The users and companies arrays in the response are always empty when this field is used.

Example:
[ "536e564f316c83104c000020" ]
taggable_typestring

Whether the ids in ids_to_add are contacts or companies. Defaults to user.

Enum:"user""company"
Example:"user"
curl -i -X POST \
  https://api.intercom.io/tags \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'Intercom-Version: 2.17' \
  -d '{
    "name": "test"
  }'

Responses

Action successful

Bodyapplication/json
typestring

value is "tag"

Example:"tag"
idstring

The id of the tag

Example:"123456"
namestring

The name of the tag

Example:"Test tag"
usersArray of objects or null

The users that were tagged or untagged.

Example:
[]
companiesArray of objects or null

The companies that were tagged or untagged.

Example:
[]
Response
{ "type": "tag", "id": "105", "name": "test", "users": [], "companies": [] }