> ## Documentation Index
> Fetch the complete documentation index at: https://studio.assembly.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Get unread message channels for a user

> Returns the messaging channels where the specified user has unread messages, plus an aggregate total. When userId is omitted, the requester's own user is used.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/message-channels/unread
openapi: 3.0.0
info:
  contact: {}
  title: Assembly API
  version: 0.0.1
servers:
  - url: https://api.assembly.com
security: []
paths:
  /v1/message-channels/unread:
    get:
      tags:
        - Message Channels
      summary: Get unread message channels for a user
      description: >-
        Returns the messaging channels where the specified user has unread
        messages, plus an aggregate total. When userId is omitted, the
        requester's own user is used.
      operationId: list-unread-message-channels
      parameters:
        - description: >-
            Internal user or client id whose unread channels to summarize.
            Defaults to the requester's user id.
          in: query
          name: userId
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/messagechannel.UnreadSummary'
          description: OK
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/dispatcher.Error'
          description: Missing or invalid API key
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/dispatcher.Error'
          description: User not found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/dispatcher.Error'
          description: Unexpected server error
      security:
        - APIKeyHeader: []
components:
  schemas:
    messagechannel.UnreadSummary:
      properties:
        totalUnreadCount:
          description: >-
            TotalUnreadCount is the aggregate number of unread messages across
            all returned channels.
          example: 5
          type: integer
        unreadChannels:
          description: >-
            UnreadChannels are the channels in which the member has at least one
            unread message.
          items:
            $ref: '#/components/schemas/messagechannel.MessageChannel'
          type: array
      type: object
    dispatcher.Error:
      properties:
        code:
          type: string
        data: {}
        message:
          type: string
      type: object
    messagechannel.MessageChannel:
      properties:
        clientId:
          description: >-
            ClientID is the id of the client associated with an individual
            channel.
          example: client_abc123
          type: string
        companyId:
          description: CompanyID is the id of the company associated with the channel.
          example: company_abc123
          type: string
        createdAt:
          description: CreatedAt is the time the channel was created.
          example: '2023-01-01T00:00:00Z'
          format: date-time
          type: string
        id:
          description: ID is the unique identifier of the message channel.
          example: abc123
          format: uuid
          type: string
        lastMessageDate:
          description: >-
            LastMessage is the time the most recent message was sent in the
            channel.
          example: '2023-01-03T00:00:00Z'
          format: date-time
          nullable: true
          type: string
        lastRead:
          description: >-
            LastRead is the time the viewer last read the channel. Populated
            alongside UnreadCount; omitted otherwise.
          example: '2023-01-02T12:00:00Z'
          format: date-time
          type: string
        memberIds:
          description: MemberIds are the user ids that belong to the channel.
          example:
            - user_abc123
            - user_def456
          items:
            type: string
          type: array
        membershipEntityId:
          description: >-
            MembershipEntityId is the id of the entity (company or client) the
            channel is scoped to.
          example: client_abc123
          type: string
        membershipType:
          description: >-
            MembershipType describes whether the channel is scoped to a company,
            a single client, or an ad-hoc group.
          enum:
            - company
            - individual
            - group
          example: individual
          type: string
        object:
          description: Object is the resource type discriminator, always "messageChannel".
          example: messageChannel
          type: string
        unreadCount:
          description: >-
            UnreadCount is the number of unread messages for the viewer.
            Populated by the /unread

            endpoint and by the list endpoint when includeUnread=true; omitted
            otherwise.
          example: 3
          type: integer
        updatedAt:
          description: UpdatedAt is the time the channel was last updated.
          example: '2023-01-02T00:00:00Z'
          format: date-time
          type: string
      type: object
  securitySchemes:
    APIKeyHeader:
      in: header
      name: X-API-KEY
      type: apiKey

````