# Retrieve a visitor with User ID

`GET /visitors`

> This is a subset of the full specification, limited to the `GET /visitors` operation.
>
> You can find the full specification here: /_bundle/docs/references/@2.11/rest-api/api.intercom.io.yaml

```yaml
openapi: 3.0.1
info:
  title: Intercom API
  version: '2.11'
  description: This is a subset of the full specification, limited to the `GET /visitors` operation.
  contact:
    name: Intercom Developer Hub
    url: https://developers.intercom.com
  license:
    name: MIT
    url: https://spdx.org/licenses/MIT
servers:
  - url: https://api.intercom.io
    description: The production API server
  - url: https://api.eu.intercom.io
    description: The european API server
  - url: https://api.au.intercom.io
    description: The australian API server
security:
  - bearerAuth: []
tags:
  - name: Visitors
    description: Everything about your Visitors
paths:
  /visitors:
    get:
      summary: Retrieve a visitor with User ID
      parameters:
        - name: Intercom-Version
          in: header
          schema:
            $ref: '#/components/schemas/intercom_version'
        - name: user_id
          in: query
          description: The user_id of the Visitor you want to retrieve.
          required: true
          schema:
            type: string
      tags:
        - Visitors
      operationId: retrieveVisitorWithUserId
      description: You can fetch the details of a single visitor.
      responses:
        '200':
          description: successful
          content:
            application/json:
              examples:
                successful:
                  value:
                    type: visitor
                    id: 667d61ce8a68186f43bafe9b
                    user_id: 3ecf64d0-9ed1-4e9f-88e1-da7d6e6782f3
                    anonymous: true
                    email: ''
                    phone: null
                    name: null
                    pseudonym: null
                    avatar:
                      type: avatar
                      image_url: null
                    app_id: this_is_an_id677_that_should_be_at_least_
                    companies:
                      type: company.list
                      companies: []
                    location_data: {}
                    last_request_at: null
                    created_at: 1719493070
                    remote_created_at: 1719493070
                    signed_up_at: 1719493070
                    updated_at: 1719493070
                    session_count: 0
                    social_profiles:
                      type: social_profile.list
                      social_profiles: []
                    owner_id: null
                    unsubscribed_from_emails: false
                    marked_email_as_spam: false
                    has_hard_bounced: false
                    tags:
                      type: tag.list
                      tags: []
                    segments:
                      type: segment.list
                      segments: []
                    custom_attributes: {}
                    referrer: null
                    utm_campaign: null
                    utm_content: null
                    utm_medium: null
                    utm_source: null
                    utm_term: null
                    do_not_track: null
              schema:
                $ref: '#/components/schemas/visitor'
        '401':
          description: Unauthorized
          content:
            application/json:
              examples:
                Unauthorized:
                  value:
                    type: error.list
                    request_id: 25dace4f-4916-492c-823b-f0cca227dff0
                    errors:
                      - code: unauthorized
                        message: Access Token Invalid
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: Visitor not found
          content:
            application/json:
              examples:
                Visitor not found:
                  value:
                    type: error.list
                    request_id: 7359afef-98f5-4b22-9de7-902f7a214729
                    errors:
                      - code: not_found
                        message: Visitor Not Found
              schema:
                $ref: '#/components/schemas/error'
components:
  schemas:
    company:
      title: Company
      type: object
      x-tags:
        - Companies
      description: Companies allow you to represent organizations using your product. Each company will have its own description and be associated with contacts. You can fetch, create, update and list companies.
      required:
        - company_id
        - id
        - app_id
        - name
        - remote_created_at
        - created_at
        - updated_at
        - last_request_at
        - monthly_spend
        - session_count
        - user_count
        - size
        - website
        - industry
      properties:
        type:
          type: string
          description: Value is `company`
          enum:
            - company
          example: company
        id:
          type: string
          description: The Intercom defined id representing the company.
          example: 531ee472cce572a6ec000006
        name:
          type: string
          description: The name of the company.
          example: Blue Sun
        app_id:
          type: string
          description: The Intercom defined code of the workspace the company is associated to.
          example: ecahpwf5
        plan:
          type: object
          properties:
            type:
              type: string
              description: Value is always "plan"
              example: plan
              enum:
                - plan
            id:
              type: string
              description: The id of the plan
              example: '269315'
            name:
              type: string
              description: The name of the plan
              example: Pro
        company_id:
          type: string
          description: The company id you have defined for the company.
          example: '6'
        remote_created_at:
          type: integer
          description: The time the company was created by you.
          example: 1663597223
        created_at:
          type: integer
          description: The time the company was added in Intercom.
          example: 1663597223
        updated_at:
          type: integer
          description: The last time the company was updated.
          example: 1663597223
        last_request_at:
          type: integer
          description: The time the company last recorded making a request.
          example: 1663597223
        size:
          type: integer
          description: The number of employees in the company.
          example: 100
        website:
          type: string
          description: The URL for the company website.
          example: https://www.intercom.com
        industry:
          type: string
          description: The industry that the company operates in.
          example: Software
        monthly_spend:
          type: integer
          description: How much revenue the company generates for your business.
          example: 100
        session_count:
          type: integer
          description: How many sessions the company has recorded.
          example: 100
        user_count:
          type: integer
          description: The number of users in the company.
          example: 100
        custom_attributes:
          type: object
          description: The custom attributes you have set on the company.
          additionalProperties:
            type: string
          example:
            paid_subscriber: true
            monthly_spend: 155.5
            team_mates: 9
        tags:
          type: object
          description: The list of tags associated with the company
          properties:
            type:
              type: string
              description: The type of the object
              enum:
                - tag.list
            tags:
              type: array
              items:
                $ref: '#/components/schemas/tag_basic'
        segments:
          type: object
          description: The list of segments associated with the company
          properties:
            type:
              type: string
              description: The type of the object
              enum:
                - segment.list
            segments:
              type: array
              items:
                $ref: '#/components/schemas/segment'
    error:
      type: object
      title: Error
      description: The API will return an Error List for a failed request, which will contain one or more Error objects.
      properties:
        type:
          type: string
          description: The type is error.list
          example: error.list
        request_id:
          type: string
          nullable: true
          format: uuid
          description: ''
          example: f93ecfa8-d08a-4325-8694-89aeb89c8f85
        errors:
          type: array
          description: An array of one or more error objects
          items:
            properties:
              code:
                type: string
                description: A string indicating the kind of error, used to further qualify the HTTP response code
                example: unauthorized
              message:
                type: string
                nullable: true
                description: Optional. Human readable description of the error.
                example: Access Token Invalid
              field:
                type: string
                nullable: true
                description: Optional. Used to identify a particular field or query parameter that was in error.
                example: email
            required:
              - code
      required:
        - type
        - errors
    intercom_version:
      description: Intercom API version.</br>By default, it's equal to the version set in the app package.
      type: string
      example: '2.11'
      default: '2.11'
      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'
        - Preview
    segment:
      title: Segment
      type: object
      x-tags:
        - Segments
      description: A segment is a group of your contacts defined by the rules that you set.
      required:
        - type
        - id
        - name
        - created_at
        - person_type
      properties:
        type:
          type: string
          description: The type of object.
          enum:
            - segment
          example: segment
        id:
          type: string
          description: The unique identifier representing the segment.
          example: 56203d253cba154d39010062
        name:
          type: string
          description: The name of the segment.
          example: Active
        created_at:
          type: integer
          description: The time the segment was created.
          example: 1394621988
        updated_at:
          type: integer
          description: The time the segment was updated.
          example: 1394622004
        person_type:
          type: string
          description: 'Type of the contact: contact (lead) or user.'
          enum:
            - contact
            - user
          example: contact
        count:
          type: integer
          description: The number of items in the user segment. It's returned when `include_count=true` is included in the request.
          example: 3
          nullable: true
    tag_basic:
      title: Tag
      type: object
      x-tags:
        - Tags
      description: A tag allows you to label your contacts, companies, and conversations and list them using that tag.
      properties:
        type:
          type: string
          description: value is "tag"
          example: tag
        id:
          type: string
          description: The id of the tag
          example: '123456'
        name:
          type: string
          description: The name of the tag
          example: Test tag
    visitor:
      title: Visitor
      type: object
      description: Visitors are useful for representing anonymous people that have not yet been identified. They usually represent website visitors. Visitors are not visible in Intercom platform. The Visitors resource provides methods to fetch, update, convert and delete.
      properties:
        type:
          type: string
          description: Value is 'visitor'
          default: visitor
          example: visitor
        id:
          type: string
          description: The Intercom defined id representing the Visitor.
          example: 530370b477ad7120001d
        user_id:
          type: string
          description: Automatically generated identifier for the Visitor.
          example: 8a88a590-e1c3-41e2-a502-e0649dbf721c
        anonymous:
          type: boolean
          description: Identifies if this visitor is anonymous.
          example: false
        email:
          type: string
          format: email
          description: The email of the visitor.
          example: jane.doe@example.com
        phone:
          type: string
          nullable: true
          description: The phone number of the visitor.
          example: 555-555-5555
        name:
          type: string
          nullable: true
          description: The name of the visitor.
          example: Jane Doe
        pseudonym:
          type: string
          nullable: true
          description: The pseudonym of the visitor.
          example: Red Duck from Dublin
        avatar:
          type: object
          properties:
            type:
              type: string
              description: ''
              default: avatar
              example: avatar
            image_url:
              type: string
              format: uri
              nullable: true
              description: This object represents the avatar associated with the visitor.
              example: https://example.com/avatar.png
        app_id:
          type: string
          description: The id of the app the visitor is associated with.
          example: hfi1bx4l
        companies:
          type: object
          properties:
            type:
              type: string
              description: The type of the object
              enum:
                - company.list
              example: company.list
            companies:
              type: array
              items:
                $ref: '#/components/schemas/company'
        location_data:
          type: object
          properties:
            type:
              type: string
              description: ''
              default: location_data
              example: location_data
            city_name:
              type: string
              description: The city name of the visitor.
              example: Dublin
            continent_code:
              type: string
              description: The continent code of the visitor.
              example: EU
            country_code:
              type: string
              description: The country code of the visitor.
              example: IRL
            country_name:
              type: string
              description: The country name of the visitor.
              example: Ireland
            postal_code:
              type: string
              description: The postal code of the visitor.
              example: D02 N960
            region_name:
              type: string
              description: The region name of the visitor.
              example: Leinster
            timezone:
              type: string
              description: The timezone of the visitor.
              example: Europe/Dublin
        las_request_at:
          type: integer
          description: The time the Lead last recorded making a request.
          example: 1663597260
        created_at:
          type: integer
          description: The time the Visitor was added to Intercom.
          example: 1663597223
        remote_created_at:
          type: integer
          description: The time the Visitor was added to Intercom.
          example: 1663597223
        signed_up_at:
          type: integer
          description: The time the Visitor signed up for your product.
          example: 1663597223
        updated_at:
          type: integer
          description: The last time the Visitor was updated.
          example: 1663597260
        session_count:
          type: integer
          description: The number of sessions the Visitor has had.
          example: 1
        social_profiles:
          type: object
          properties:
            type:
              type: string
              description: The type of the object
              enum:
                - social_profile.list
              example: social_profile.list
            social_profiles:
              type: array
              items:
                type: string
        owner_id:
          type: string
          nullable: true
          description: The id of the admin that owns the Visitor.
          example: '5169261'
        unsubscribed_from_emails:
          type: boolean
          description: Whether the Visitor is unsubscribed from emails.
          example: false
        marked_email_as_spam:
          type: boolean
          description: Identifies if this visitor has marked an email as spam.
          example: false
        has_hard_bounced:
          type: boolean
          description: Identifies if this visitor has had a hard bounce.
          example: false
        tags:
          type: object
          properties:
            type:
              type: string
              description: The type of the object
              enum:
                - tag.list
              example: tag.list
            tags:
              type: array
              items:
                properties:
                  type:
                    type: string
                    description: The type of the object
                    enum:
                      - tag
                    example: tag
                  id:
                    type: string
                    description: The id of the tag.
                    example: '8482'
                  name:
                    type: string
                    description: The name of the tag.
                    example: tag_name
        segments:
          type: object
          properties:
            type:
              type: string
              description: The type of the object
              enum:
                - segment.list
              example: segment.list
            segments:
              type: array
              items:
                type: string
        custom_attributes:
          type: object
          description: The custom attributes you have set on the Visitor.
          additionalProperties:
            type: string
        referrer:
          type: string
          nullable: true
          description: The referer of the visitor.
          example: https://www.google.com/
        utm_campaign:
          type: string
          nullable: true
          description: The utm_campaign of the visitor.
          example: intercom-link
        utm_content:
          type: string
          nullable: true
          description: The utm_content of the visitor.
          example: banner
        utm_medium:
          type: string
          nullable: true
          description: The utm_medium of the visitor.
          example: email
        utm_source:
          type: string
          nullable: true
          description: The utm_source of the visitor.
          example: Intercom
        utm_term:
          type: string
          nullable: true
          description: The utm_term of the visitor.
          example: messenger
        do_not_track:
          type: boolean
          nullable: true
          description: Identifies if this visitor has do not track enabled.
          example: false
      required:
        - type
        - id
        - user_id
        - anonymous
        - email
        - phone
        - name
        - app_id
        - created_at
        - signed_up_at
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
```
