# Retrieve a segment

You can fetch the details of a single segment.
The segment name is returned HTML-escaped, for example `&` as `&amp;`.
Requires the `read_users_companies` or `write_users_companies` OAuth scope.

Endpoint: GET /segments/{segment_id}
Version: 2.18
Security: bearerAuth

## Path parameters:

  - `segment_id` (string, required)
    The unique identified of a given segment.

## Query parameters:

  - `include_count` (boolean)
    Includes the count of contacts that belong to the segment. The count is added whenever this parameter has a value in the query string, even `false` or an empty one, so omit it entirely to leave it out. A bare `include_count` with no `=` adds no count.

## Header parameters:

  - `Intercom-Version` (string)

## Response 200 fields (application/json):

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

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

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

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

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

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

  - `count` (integer)
    The number of items in the user segment. It's returned when the request has `include_count` with a value. A company segment only gets a count when a contact segment has the same name, and it shows that segment's count.
    Example: 3

## Response 401 fields (application/json):

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

  - `request_id` (string)
    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)
    Optional. Human readable description of the error.
    Example: Access Token Invalid

## Response 404 fields (application/json):

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

  - `request_id` (string)
    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)
    Optional. Human readable description of the error.
    Example: Access Token Invalid

