{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"Sending a PUT request to `/visitors` will result in an update of an existing Visitor.\n\n**Option 1.** You can update a visitor by passing in the `user_id` of the visitor in the Request body.\n\n**Option 2.** You can update a visitor by passing in the `id` of the visitor in the Request body.\n\nSending an `email` promotes the visitor to a lead. When that happens the response is a contact object with a `role` of `lead`, not a visitor object.\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/update_visitor_request","examples":[{"id":"6762f30c1bb69f9f2193bc5e","name":"Gareth Bale"}]}},"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"]},"update_visitor_request":{"description":"Update an existing visitor.","type":"object","title":"Update Visitor Request Payload","properties":{"id":{"type":"string","description":"A unique identified for the visitor which is given by Intercom. Used to look the visitor up; it is not changed by this request.","examples":["8a88a590-e"]},"user_id":{"type":"string","description":"A unique identified for the visitor which is given by you. Used to look the visitor up; it is not changed by this request.","examples":["123"]},"name":{"type":"string","description":"The visitor's name.","examples":["Christian Bale"]},"email":{"type":"string","description":"The visitor's email address. Sending this promotes the visitor to a lead and the response becomes a contact object.","examples":["winstonsmith@truth.org"]},"phone":{"type":"string","description":"The visitor's phone number.","examples":["+353871234567"]},"owner_id":{"type":"integer","description":"The id of the teammate who owns the visitor.","examples":[991267734]},"last_request_at":{"type":"integer","description":"The time the visitor was last seen, as a Unix timestamp.","examples":[1663597223]},"last_seen_ip":{"type":"string","description":"The IP address the visitor was last seen from.","examples":["1.2.3.4"]},"last_seen_user_agent":{"type":"string","description":"The user agent the visitor was last seen with.","examples":["Mozilla/5.0"]},"unsubscribed_from_emails":{"type":"boolean","description":"Whether the visitor is unsubscribed from emails.","examples":[false]},"language_override":{"type":"string","description":"The language to send the visitor messages in, overriding the language we detect.","examples":["fr"]},"avatar":{"type":"string","description":"An image URL for the visitor's avatar.","examples":["https://example.org/128Wu8Q.jpg"]},"companies":{"type":"array","description":"The companies to associate the visitor with. Only applied when the same request sends `email`, which promotes the visitor to a lead.","items":{"type":"object"}},"utm_campaign":{"type":"string","description":"The campaign the visitor arrived from.","examples":["intercom-link"]},"utm_content":{"type":"string","description":"The content the visitor arrived from.","examples":["banner"]},"utm_medium":{"type":"string","description":"The medium the visitor arrived from.","examples":["email"]},"utm_source":{"type":"string","description":"The source the visitor arrived from.","examples":["Intercom"]},"utm_term":{"type":"string","description":"The search term the visitor arrived from.","examples":["messenger"]},"custom_attributes":{"type":"object","description":"The custom attributes which are set for the visitor.","additionalProperties":{"anyOf":[{"type":["string","null"]},{"type":"integer"},{"type":"number"},{"type":"boolean"}]},"examples":[{"paid_subscriber":true,"monthly_spend":155.5,"team_mates":9}]}},"anyOf":[{"required":["id"]},{"required":["user_id"]}]}}},"name":"Update a visitor","id":"intercom.updatevisitor","example":{},"maxRequests":1,"summary":false}}