{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"You can use this endpoint to perform the following operations:\n\n  **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.\n\n  **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.\n\n  **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.\n\n  **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.\n\n  **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.\n\nEach operation will return a tag object.\n\nContacts 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.\n\nRequires the `write_tags` or `write_users_companies` OAuth scope.\n","properties":{"headers":{"type":"object","properties":{"Intercom-Version":{"$ref":"#/definitions/intercom_version","enum":["2.17"]}},"required":[],"additionalProperties":false},"body":{"anyOf":[{"$ref":"#/definitions/create_or_update_tag_request"},{"$ref":"#/definitions/tag_company_request"},{"$ref":"#/definitions/untag_company_request"},{"$ref":"#/definitions/tag_multiple_users_request"}],"examples":[{"name":"test"}]}},"required":[],"additionalProperties":false,"definitions":{"intercom_version":{"description":"Intercom API version.</br>If you omit the header, the API uses the version set in your app package, and 1.0 if none is set.","type":"string","enum":["1.0","1.1","1.2","1.3","1.4","2.0","2.1","2.2","2.3","2.4","2.5","2.6","2.7","2.8","2.9","2.10","2.11","2.12","2.13","2.14","2.15","2.16","2.17"],"examples":["2.17"]},"create_or_update_tag_request":{"description":"You can create or update an existing tag, and optionally apply it to a list of contact or company ids.","type":"object","title":"Create or Update Tag Request Payload","properties":{"name":{"type":"string","maxLength":191,"description":"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.","examples":["Independent"]},"id":{"type":"string","description":"The id of tag to updates.","examples":["656452352"]},"ids_to_add":{"type":"array","description":"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.","items":{"type":"string"},"examples":[["536e564f316c83104c000020"]]},"taggable_type":{"type":"string","description":"Whether the ids in `ids_to_add` are contacts or companies. Defaults to `user`.","enum":["user","company"],"examples":["user"]}},"required":["name"]},"tag_company_request":{"description":"You can tag a single company or a list of companies.","type":"object","title":"Tag Company Request Payload","properties":{"name":{"type":"string","maxLength":191,"description":"The name of the tag, which will be created if not found. Names can be at most 191 characters long.","examples":["Independent"]},"companies":{"type":"array","items":{"properties":{"id":{"type":"string","description":"The Intercom defined id representing the company.","examples":["531ee472cce572a6ec000006"]},"company_id":{"type":"string","description":"The company id you have defined for the company.","examples":["6"]},"name":{"type":"string","description":"The name of the company, used to look it up when neither `id` nor `company_id` is given.","examples":["Intercom"]}}},"description":"The id, company_id or name of the company can be passed as input parameters. Companies that cannot be found are skipped."}},"required":["name","companies"]},"untag_company_request":{"description":"You can tag a single company or a list of companies.","type":"object","title":"Untag Company Request Payload","properties":{"name":{"type":"string","maxLength":191,"description":"The name of the tag which will be untagged from the company. Names can be at most 191 characters long.","examples":["Independent"]},"companies":{"type":"array","items":{"properties":{"id":{"type":"string","description":"The Intercom defined id representing the company.","examples":["531ee472cce572a6ec000006"]},"company_id":{"type":"string","description":"The company id you have defined for the company.","examples":["6"]},"name":{"type":"string","description":"The name of the company, used to look it up when neither `id` nor `company_id` is given.","examples":["Intercom"]},"untag":{"type":"boolean","description":"Always set to true","examples":[true]}},"required":["untag"]},"description":"The id, company_id or name of the company can be passed as input parameters. Companies that cannot be found are skipped."}},"required":["name","companies"]},"tag_multiple_users_request":{"description":"You can tag or untag a list of users.","type":"object","title":"Tag Users Request Payload","properties":{"name":{"type":"string","maxLength":191,"description":"The name of the tag, which will be created if not found. Names can be at most 191 characters long.","examples":["Independent"]},"users":{"type":"array","description":"The id, user_id or email of the user can be passed as input parameters. Users that cannot be found are skipped.","items":{"properties":{"id":{"type":"string","description":"The Intercom defined id representing the user.","examples":["5f7f0d217289f8d2f4262080"]},"user_id":{"type":"string","description":"The user id you have defined for the user, used to look it up when `id` is not given.","examples":["25"]},"email":{"type":"string","description":"The email address of the user, used to look it up when neither `id` nor `user_id` is given.","examples":["jane@example.com"]},"untag":{"type":"boolean","description":"Set to true to remove the tag from this user instead of applying it.","examples":[true]}}}}},"required":["name","users"]}}},"name":"Create or update a tag, Tag or untag companies, Tag contacts","id":"intercom.createtag","example":{},"maxRequests":1,"summary":false}}