{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"You can merge a Visitor to a Contact of role type `lead` or `user`.\n\n> \uD83D\uDCD8 What happens upon a visitor being converted?\n>\n> If the User exists, then the Visitor will be merged into it, the Visitor deleted and the User returned. If the User does not exist, the Visitor will be converted to a User, with the User identifiers replacing it's Visitor identifiers.\n\nIdentify the visitor with `visitor.id` or `visitor.user_id`. The `user` object is required when `type` is `user`, and is not read when `type` is `lead`.\n\nRequires the `read_write_users` 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":{"$ref":"#/definitions/convert_visitor_request","examples":[{"visitor":{"user_id":"3ecf64d0-9ed1-4e9f-88e1-da7d6e6782f3"},"user":{"email":"foo@bar.com"},"type":"user"}]}},"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"]},"convert_visitor_request":{"description":"You can merge a Visitor to a Contact of role type lead or user.","type":"object","title":"Convert Visitor Request Payload","properties":{"type":{"type":"string","description":"Represents the role of the Contact model. Accepts `lead` or `user`.","examples":["user"]},"user":{"type":"object","description":"The unique identifiers retained after converting or merging. Required when `type` is `user`; not read when `type` is `lead`.","properties":{"id":{"type":"string","description":"The unique identifier for the contact which is given by Intercom.","examples":["8a88a590-e1c3-41e2-a502-e0649dbf721c"]},"user_id":{"type":"string","description":"A unique identifier for the contact which is given to Intercom, which will be represented as external_id.","examples":["8a88a590-e1c3-41e2-a502-e0649dbf721c"]},"email":{"type":"string","description":"The contact's email, retained by default if one is present.","examples":["winstonsmith@truth.org"]}},"anyOf":[{"required":["id"]},{"required":["user_id"]},{"required":["email"]}]},"visitor":{"type":"object","description":"The unique identifiers to convert a single Visitor. One of `id` or `user_id` is required; an `email` on its own does not identify a visitor.","properties":{"id":{"type":"string","description":"The unique identifier for the contact which is given by Intercom.","examples":["8a88a590-e1c3-41e2-a502-e0649dbf721c"]},"user_id":{"type":"string","description":"A unique identifier for the contact which is given to Intercom.","examples":["8a88a590-e1c3-41e2-a502-e0649dbf721c"]},"email":{"type":"string","description":"The visitor's email.","examples":["winstonsmith@truth.org"]}},"anyOf":[{"required":["id"]},{"required":["user_id"]}]}},"required":["type","visitor"]}}},"name":"Convert a visitor","id":"intercom.convertvisitor","example":{},"maxRequests":1,"summary":false}}