# Update a visitor

Sending a PUT request to /visitors will result in an update of an existing Visitor.

Option 1. You can update a visitor by passing in the user_id of the visitor in the Request body.

Option 2. You can update a visitor by passing in the id of the visitor in the Request body.

Endpoint: PUT /visitors
Version: Preview
Security: bearerAuth

## Header parameters:

  - `Intercom-Version` (string)
    Intercom API version.By default, it's equal to the version set in the app package.
    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", "Preview"

## Request fields (application/json):

  - `id` (string)
    A unique identified for the visitor which is given by Intercom.
    Example: "8a88a590-e"

  - `user_id` (string)
    A unique identified for the visitor which is given by you.
    Example: "123"

  - `name` (string)
    The visitor's name.
    Example: "Christian Bale"

  - `custom_attributes` (object)
    The custom attributes which are set for the visitor.
    Example: {"paid_subscriber":true,"monthly_spend":155.5,"team_mates":9}

## Response 200 fields (application/json):

  - `type` (string)
    Value is 'visitor'
    Example: "visitor"

  - `id` (string)
    The Intercom defined id representing the Visitor.
    Example: "530370b477ad7120001d"

  - `user_id` (string)
    Automatically generated identifier for the Visitor.
    Example: "8a88a590-e1c3-41e2-a502-e0649dbf721c"

  - `anonymous` (boolean)
    Identifies if this visitor is anonymous.

  - `email` (string)
    The email of the visitor.
    Example: "jane.doe@example.com"

  - `phone` (string,null)
    The phone number of the visitor.
    Example: "555-555-5555"

  - `name` (string,null)
    The name of the visitor.
    Example: "Jane Doe"

  - `pseudonym` (string,null)
    The pseudonym of the visitor.
    Example: "Red Duck from Dublin"

  - `avatar` (object)

  - `avatar.type` (string)
    Example: "avatar"

  - `avatar.image_url` (string,null)
    This object represents the avatar associated with the visitor.
    Example: "https://example.com/avatar.png"

  - `app_id` (string)
    The id of the app the visitor is associated with.
    Example: "hfi1bx4l"

  - `companies` (object)

  - `companies.type` (string)
    The type of the object
    Enum: "company.list"

  - `companies.companies` (array)

  - `companies.companies.type` (string)
    Value is company
    Enum: "company"

  - `companies.companies.id` (string)
    The Intercom defined id representing the company.
    Example: "531ee472cce572a6ec000006"

  - `companies.companies.name` (string)
    The name of the company.
    Example: "Blue Sun"

  - `companies.companies.app_id` (string)
    The Intercom defined code of the workspace the company is associated to.
    Example: "ecahpwf5"

  - `companies.companies.plan` (object)

  - `companies.companies.plan.type` (string)
    Value is always "plan"
    Example: "plan"

  - `companies.companies.plan.id` (string)
    The id of the plan
    Example: "269315"

  - `companies.companies.plan.name` (string)
    The name of the plan
    Example: "Pro"

  - `companies.companies.company_id` (string)
    The company id you have defined for the company.
    Example: "6"

  - `companies.companies.remote_created_at` (integer)
    The time the company was created by you.
    Example: 1663597223

  - `companies.companies.created_at` (integer)
    The time the company was added in Intercom.
    Example: 1663597223

  - `companies.companies.updated_at` (integer)
    The last time the company was updated.
    Example: 1663597223

  - `companies.companies.last_request_at` (integer)
    The time the company last recorded making a request.
    Example: 1663597223

  - `companies.companies.size` (integer)
    The number of employees in the company.
    Example: 100

  - `companies.companies.website` (string)
    The URL for the company website.
    Example: "https://www.intercom.com"

  - `companies.companies.industry` (string)
    The industry that the company operates in.
    Example: "Software"

  - `companies.companies.monthly_spend` (integer)
    How much revenue the company generates for your business.
    Example: 100

  - `companies.companies.session_count` (integer)
    How many sessions the company has recorded.
    Example: 100

  - `companies.companies.user_count` (integer)
    The number of users in the company.
    Example: 100

  - `companies.companies.custom_attributes` (object)
    The custom attributes you have set on the company.
    Example: {"paid_subscriber":true,"monthly_spend":155.5,"team_mates":9}

  - `companies.companies.tags` (object)
    The list of tags associated with the company

  - `companies.companies.tags.type` (string)
    The type of the object
    Enum: "tag.list"

  - `companies.companies.tags.tags` (array)

  - `companies.companies.tags.tags.type` (string)
    value is "tag"
    Example: "tag"

  - `companies.companies.tags.tags.id` (string)
    The id of the tag
    Example: "123456"

  - `companies.companies.tags.tags.name` (string)
    The name of the tag
    Example: "Test tag"

  - `companies.companies.segments` (object)
    The list of segments associated with the company

  - `companies.companies.segments.type` (string)
    The type of the object
    Enum: "segment.list"

  - `companies.companies.segments.segments` (array)

  - `companies.companies.segments.segments.type` (string)
    The type of object.
    Enum: "segment"

  - `companies.companies.segments.segments.id` (string)
    The unique identifier representing the segment.
    Example: "56203d253cba154d39010062"

  - `companies.companies.segments.segments.name` (string)
    The name of the segment.
    Example: "Active"

  - `companies.companies.segments.segments.created_at` (integer)
    The time the segment was created.
    Example: 1394621988

  - `companies.companies.segments.segments.updated_at` (integer)
    The time the segment was updated.
    Example: 1394622004

  - `companies.companies.segments.segments.person_type` (string)
    Type of the contact: contact (lead) or user.
    Enum: "contact", "user"

  - `companies.companies.segments.segments.count` (integer,null)
    The number of items in the user segment. It's returned when include_count=true is included in the request.
    Example: 3

  - `companies.companies.notes` (object)
    The list of notes associated with the company

  - `companies.companies.notes.type` (string)
    The type of the object
    Enum: "note.list"

  - `companies.companies.notes.notes` (array)

  - `companies.companies.notes.notes.type` (string)
    String representing the object's type. Always has the value note.
    Example: "note"

  - `companies.companies.notes.notes.id` (string)
    The id of the note.
    Example: "17495962"

  - `companies.companies.notes.notes.created_at` (integer)
    The time the note was created.
    Example: 1674589321

  - `companies.companies.notes.notes.company` (object,null)
    Represents the company that the note was created about.

  - `companies.companies.notes.notes.company.type` (string)
    String representing the object's type. Always has the value company.
    Example: "company"

  - `companies.companies.notes.notes.company.id` (string)
    The id of the company.
    Example: "6329bd9ffe4e2e91dac76188"

  - `companies.companies.notes.notes.author` (object,null)
    Admins are teammate accounts that have access to a workspace.

  - `companies.companies.notes.notes.author.type` (string)
    String representing the object's type. Always has the value admin.
    Example: "admin"

  - `companies.companies.notes.notes.author.id` (string)
    The id representing the admin.
    Example: "1295"

  - `companies.companies.notes.notes.author.name` (string)
    The name of the admin.
    Example: "Joe Example"

  - `companies.companies.notes.notes.author.email` (string)
    The email of the admin.
    Example: "jdoe@example.com"

  - `companies.companies.notes.notes.author.job_title` (string)
    The job title of the admin.
    Example: "Associate"

  - `companies.companies.notes.notes.author.away_mode_enabled` (boolean)
    Identifies if this admin is currently set in away mode.

  - `companies.companies.notes.notes.author.away_mode_reassign` (boolean)
    Identifies if this admin is set to automatically reassign new conversations to the apps default inbox.

  - `companies.companies.notes.notes.author.away_status_reason_id` (integer,null)
    The unique identifier of the away status reason
    Example: 12345

  - `companies.companies.notes.notes.author.has_inbox_seat` (boolean)
    Identifies if this admin has a paid inbox seat to restrict/allow features that require them.
    Example: true

  - `companies.companies.notes.notes.author.team_ids` (array)
    This object represents the avatar associated with the admin.
    Example: [814865]

  - `companies.companies.notes.notes.author.avatar` (string,null)
    Image for the associated team or teammate
    Example: "https://picsum.photos/200/300"

  - `companies.companies.notes.notes.author.team_priority_level` (object,null)
    Admin priority levels for teams

  - `companies.companies.notes.notes.author.team_priority_level.primary_team_ids` (array,null)
    The primary team ids for the team
    Example: [814865]

  - `companies.companies.notes.notes.author.team_priority_level.secondary_team_ids` (array,null)
    The secondary team ids for the team
    Example: [493881]

  - `companies.companies.notes.notes.author.role` (object,null)
    The role assigned to this admin. Only present if the admin has a role assigned.

  - `companies.companies.notes.notes.author.role.type` (string)
    String representing the object's type. Always has the value role.
    Example: "role"

  - `companies.companies.notes.notes.author.role.id` (string)
    The id of the role.
    Example: "1"

  - `companies.companies.notes.notes.author.role.name` (string)
    The name of the role.
    Example: "Support Agent"

  - `companies.companies.notes.notes.body` (string)
    The body text of the note.
    Example: "<p>Text for the note.</p>"

  - `location_data` (object)

  - `location_data.type` (string)
    Example: "location_data"

  - `location_data.city_name` (string)
    The city name of the visitor.
    Example: "Dublin"

  - `location_data.continent_code` (string)
    The continent code of the visitor.
    Example: "EU"

  - `location_data.country_code` (string)
    The country code of the visitor.
    Example: "IRL"

  - `location_data.country_name` (string)
    The country name of the visitor.
    Example: "Ireland"

  - `location_data.postal_code` (string)
    The postal code of the visitor.
    Example: "D02 N960"

  - `location_data.region_name` (string)
    The region name of the visitor.
    Example: "Leinster"

  - `location_data.timezone` (string)
    The timezone of the visitor.
    Example: "Europe/Dublin"

  - `las_request_at` (integer)
    The time the Lead last recorded making a request.
    Example: 1663597260

  - `created_at` (integer)
    The time the Visitor was added to Intercom.
    Example: 1663597223

  - `remote_created_at` (integer)
    The time the Visitor was added to Intercom.
    Example: 1663597223

  - `signed_up_at` (integer)
    The time the Visitor signed up for your product.
    Example: 1663597223

  - `updated_at` (integer)
    The last time the Visitor was updated.
    Example: 1663597260

  - `session_count` (integer)
    The number of sessions the Visitor has had.
    Example: 1

  - `social_profiles` (object)

  - `social_profiles.type` (string)
    The type of the object
    Enum: "social_profile.list"

  - `social_profiles.social_profiles` (array)

  - `owner_id` (string,null)
    The id of the admin that owns the Visitor.
    Example: "5169261"

  - `unsubscribed_from_emails` (boolean)
    Whether the Visitor is unsubscribed from emails.

  - `marked_email_as_spam` (boolean)
    Identifies if this visitor has marked an email as spam.

  - `has_hard_bounced` (boolean)
    Identifies if this visitor has had a hard bounce.

  - `tags` (object)

  - `tags.type` (string)
    The type of the object
    Enum: "tag.list"

  - `tags.tags` (array)

  - `tags.tags.type` (string)
    The type of the object
    Enum: "tag"

  - `tags.tags.id` (string)
    The id of the tag.
    Example: "8482"

  - `tags.tags.name` (string)
    The name of the tag.
    Example: "tag_name"

  - `segments` (object)

  - `segments.type` (string)
    The type of the object
    Enum: "segment.list"

  - `segments.segments` (array)

  - `custom_attributes` (object)
    The custom attributes you have set on the Visitor.

  - `referrer` (string,null)
    The referer of the visitor.
    Example: "https://www.google.com/"

  - `utm_campaign` (string,null)
    The utm_campaign of the visitor.
    Example: "intercom-link"

  - `utm_content` (string,null)
    The utm_content of the visitor.
    Example: "banner"

  - `utm_medium` (string,null)
    The utm_medium of the visitor.
    Example: "email"

  - `utm_source` (string,null)
    The utm_source of the visitor.
    Example: "Intercom"

  - `utm_term` (string,null)
    The utm_term of the visitor.
    Example: "messenger"

  - `do_not_track` (boolean,null)
    Identifies if this visitor has do not track enabled.

## Response 401 fields (application/json):

  - `type` (string, required)
    The type is error.list
    Example: "error.list"

  - `request_id` (string,null)
    Example: "f93ecfa8-d08a-4325-8694-89aeb89c8f85"

  - `errors` (array, required)
    An array of one or more error objects

  - `errors.code` (string, required)
    A string indicating the kind of error, used to further qualify the HTTP response code
    Example: "unauthorized"

  - `errors.message` (string,null)
    Optional. Human readable description of the error.
    Example: "Access Token Invalid"

  - `errors.field` (string,null)
    Optional. Used to identify a particular field or query parameter that was in error.
    Example: "email"


