# List attached segments for contact

`GET /contacts/{contact_id}/segments`

> This is a subset of the full specification, limited to the `GET /contacts/{contact_id}/segments` 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 /contacts/{contact_id}/segments` 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: Contacts
    description: Everything about your contacts
  - name: Segments
    description: Everything about your Segments
paths:
  /contacts/{contact_id}/segments:
    get:
      summary: List attached segments for contact
      parameters:
        - name: contact_id
          in: path
          description: The unique identifier for the contact which is given by Intercom
          example: 63a07ddf05a32042dffac965
          required: true
          schema:
            type: string
        - name: Intercom-Version
          in: header
          schema:
            $ref: '#/components/schemas/intercom_version'
      tags:
        - Contacts
        - Segments
      operationId: listSegmentsForAContact
      description: You can fetch a list of segments that are associated to a contact.
      responses:
        '200':
          description: successful
          content:
            application/json:
              examples:
                successful:
                  value:
                    type: list
                    data:
                      - type: segment
                        id: 667d60998a68186f43bafda1
                        name: segment
                        created_at: 1719492761
                        updated_at: 1719492761
                        person_type: user
              schema:
                $ref: '#/components/schemas/contact_segments'
        '401':
          description: Unauthorized
          content:
            application/json:
              examples:
                Unauthorized:
                  value:
                    type: error.list
                    request_id: d2927c64-9c5a-4593-997b-381f8c2356ea
                    errors:
                      - code: unauthorized
                        message: Access Token Invalid
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: Contact not found
          content:
            application/json:
              examples:
                Contact not found:
                  value:
                    type: error.list
                    request_id: 7d4ab1a9-5990-4338-b5d9-0f3f55f1acb7
                    errors:
                      - code: not_found
                        message: User Not Found
              schema:
                $ref: '#/components/schemas/error'
components:
  schemas:
    contact_segments:
      title: Segments
      type: object
      description: A list of segments objects attached to a specific contact.
      properties:
        type:
          type: string
          description: The type of the object
          enum:
            - list
          example: list
        data:
          type: array
          description: Segment objects associated with the contact.
          items:
            $ref: '#/components/schemas/segment'
      required:
        - type
        - data
    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
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
```
