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

# Get message history for a thread

> Retrieve the message history for a specific thread.

export const ScopesList = ({scopes = [], description = "この API には、次のいずれかのスコープが必要です。"}) => {
  if (!scopes || scopes.length === 0) {
    return null;
  }
  const sortedScopes = scopes.sort((a, b) => a.localeCompare(b));
  return <div>
      <div className="text-sm mb-2">{description}</div>
      <div>
        {sortedScopes.map((scope, index) => <div key={index}>
            <code>
              <span className="text-xs">{scope}</span>
            </code>
          </div>)}
      </div>
    </div>;
};

export const SupportedProducts = ({marketing, sales, service, cms, marketingLevel, salesLevel, serviceLevel, cmsLevel}) => {
  const translations = {
    header: "サポートされる製品",
    description: "次のいずれかの製品またはそれ以上が必要です。",
    productNames: {
      marketing: "Marketing Hub",
      sales: "Sales Hub",
      service: "Service Hub",
      cms: "Content Hub"
    },
    tiers: {
      free: "無料ツール",
      starter: "Starter",
      professional: "Professional",
      enterprise: "Enterprise"
    }
  };
  const translateTier = tier => {
    if (!tier) return '';
    const lowerTier = tier.toLowerCase();
    return translations.tiers[lowerTier] || tier;
  };
  const products = [{
    name: marketing ? translations.productNames.marketing : '',
    level: translateTier(marketingLevel),
    icon: "https://mintlify-assets.b-cdn.net/Icons/marketing-bolt.svg",
    alt: "Marketing Hub"
  }, {
    name: sales ? translations.productNames.sales : '',
    level: translateTier(salesLevel),
    icon: "https://mintlify-assets.b-cdn.net/Icons/sales-star.svg",
    alt: "Sales Hub"
  }, {
    name: service ? translations.productNames.service : '',
    level: translateTier(serviceLevel),
    icon: "https://mintlify-assets.b-cdn.net/Icons/service-heart.svg",
    alt: "Service Hub"
  }, {
    name: cms ? translations.productNames.cms : '',
    level: translateTier(cmsLevel),
    icon: "https://mintlify-assets.b-cdn.net/Icons/content-play.svg",
    alt: "Content Hub"
  }].filter(product => product.name && product.level);
  if (products.length === 0) return null;
  return <div>
      <div className="text-sm mb-2">{translations.description}</div>
      <div className={`grid ${products.length === 1 ? 'grid-cols-1' : 'grid-cols-2'} gap-1.5`}>
        {products.map((product, index) => <div key={index} style={{
    display: 'flex',
    alignItems: 'center'
  }}>
            <img src={product.icon} alt={product.alt} className="w-3.5 h-3.5 mr-1.5 mt-2.5 mb-2.5 flex-shrink-0 align-middle" />
            <span className="font-medium mr-1 text-sm">{product.name} -</span>
            <span className="text-sm">{product.level}</span>
          </div>)}
      </div>
    </div>;
};

<AccordionGroup>
  <Accordion title="Supported products" defaultOpen="true" icon="cubes">
    <SupportedProducts marketing={true} sales={true} service={true} cms={true} marketingLevel="FREE" salesLevel="FREE" serviceLevel="FREE" cmsLevel="FREE" />
  </Accordion>

  <Accordion title="Required Scopes" icon="key">
    <ScopesList
      scopes={[
  'conversations.read'
]}
    />
  </Accordion>
</AccordionGroup>


## OpenAPI

````yaml specs/legacy/v3/conversations-conversations-v3.json GET /conversations/v3/conversations/threads/{threadId}/messages
openapi: 3.0.1
info:
  title: Conversations Inbox & Messages
  description: Basepom for all HubSpot Projects
  version: v3
  x-hubspot-product-tier-requirements:
    marketing: FREE
    sales: FREE
    service: FREE
    cms: FREE
    commerce: FREE
    crmHub: FREE
    dataHub: FREE
  x-hubspot-related-documentation:
    - name: Inbox & Messages Guide
      url: >-
        https://developers.hubspot.com/docs/guides/api/conversations/inbox-and-messages
servers:
  - url: https://api.hubapi.com
security: []
tags:
  - name: Actors
  - name: Basic
  - name: Channel accounts
  - name: Channels
  - name: Inboxes
  - name: Messages
  - name: Threads
paths:
  /conversations/v3/conversations/threads/{threadId}/messages:
    get:
      tags:
        - Threads
      summary: Get message history for a thread
      description: Retrieve the message history for a specific thread.
      operationId: get-/conversations/v3/conversations/threads/{threadId}/messages
      parameters:
        - name: threadId
          in: path
          description: ''
          required: true
          style: simple
          explode: false
          schema:
            type: integer
            format: int64
        - name: after
          in: query
          description: >-
            The paging cursor token of the last successfully read resource will
            be returned as the `paging.next.after` JSON property of a paged
            response containing more results.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: archived
          in: query
          description: Whether to return only results that have been archived.
          required: false
          style: form
          explode: true
          schema:
            type: boolean
        - name: limit
          in: query
          description: The maximum number of results to display per page.
          required: false
          style: form
          explode: true
          schema:
            type: integer
            format: int32
        - name: property
          in: query
          description: ''
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: sort
          in: query
          description: ''
          required: false
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/CollectionResponsePublicMessageForwardPaging
        default:
          $ref: '#/components/responses/Error'
          description: ''
      security:
        - oauth2:
            - conversations.read
components:
  schemas:
    CollectionResponsePublicMessageForwardPaging:
      required:
        - results
      type: object
      properties:
        paging:
          $ref: '#/components/schemas/ForwardPaging'
        results:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/PublicConversationsMessage'
              - $ref: '#/components/schemas/PublicComment'
              - $ref: '#/components/schemas/PublicWelcomeMessage'
              - $ref: '#/components/schemas/PublicAssignmentMessage'
              - $ref: '#/components/schemas/PublicThreadStatusChange'
              - $ref: '#/components/schemas/PublicThreadInboxChange'
    ForwardPaging:
      type: object
      properties:
        next:
          $ref: '#/components/schemas/NextPage'
    PublicConversationsMessage:
      required:
        - archived
        - attachments
        - channelAccountId
        - channelId
        - client
        - conversationsThreadId
        - createdAt
        - createdBy
        - direction
        - id
        - recipients
        - senders
        - text
        - truncationStatus
        - type
      type: object
      properties:
        archived:
          type: boolean
        attachments:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/PublicFile'
              - $ref: '#/components/schemas/PublicLocation'
              - $ref: '#/components/schemas/PublicContact'
              - $ref: '#/components/schemas/PublicUnsupportedContent'
              - $ref: '#/components/schemas/PublicMessageHeader'
              - $ref: '#/components/schemas/PublicQuickReplies'
              - $ref: '#/components/schemas/PublicWhatsAppTemplateMetadata'
              - $ref: '#/components/schemas/PublicSocialMetadataAttachment'
        channelAccountId:
          type: string
        channelId:
          type: string
        client:
          $ref: '#/components/schemas/PublicClient'
        conversationsThreadId:
          type: string
        createdAt:
          type: string
          format: date-time
        createdBy:
          type: string
        direction:
          type: string
          enum:
            - INCOMING
            - OUTGOING
        id:
          type: string
        inReplyToId:
          type: string
        recipients:
          type: array
          items:
            $ref: '#/components/schemas/PublicRecipient'
        richText:
          type: string
        senders:
          type: array
          items:
            $ref: '#/components/schemas/PublicSender'
        status:
          $ref: '#/components/schemas/PublicMessageStatus'
        subject:
          type: string
        text:
          type: string
        truncationStatus:
          type: string
          enum:
            - NOT_TRUNCATED
            - TRUNCATED
            - TRUNCATED_TO_MOST_RECENT_REPLY
        type:
          type: string
          default: MESSAGE
          enum:
            - MESSAGE
        updatedAt:
          type: string
          format: date-time
      x-hubspot-sub-type-impl: true
    PublicComment:
      required:
        - archived
        - attachments
        - client
        - conversationsThreadId
        - createdAt
        - createdBy
        - id
        - recipients
        - richText
        - senders
        - text
        - type
      type: object
      properties:
        archived:
          type: boolean
        attachments:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/PublicFile'
              - $ref: '#/components/schemas/PublicLocation'
              - $ref: '#/components/schemas/PublicContact'
              - $ref: '#/components/schemas/PublicUnsupportedContent'
              - $ref: '#/components/schemas/PublicMessageHeader'
              - $ref: '#/components/schemas/PublicQuickReplies'
              - $ref: '#/components/schemas/PublicWhatsAppTemplateMetadata'
              - $ref: '#/components/schemas/PublicSocialMetadataAttachment'
        client:
          $ref: '#/components/schemas/PublicClient'
        conversationsThreadId:
          type: string
        createdAt:
          type: string
          format: date-time
        createdBy:
          type: string
        id:
          type: string
        recipients:
          type: array
          items:
            $ref: '#/components/schemas/PublicRecipient'
        richText:
          type: string
        senders:
          type: array
          items:
            $ref: '#/components/schemas/PublicSender'
        text:
          type: string
        type:
          type: string
          default: COMMENT
          enum:
            - COMMENT
        updatedAt:
          type: string
          format: date-time
      x-hubspot-sub-type-impl: true
    PublicWelcomeMessage:
      required:
        - archived
        - channelAccountId
        - channelId
        - client
        - conversationsThreadId
        - createdAt
        - createdBy
        - id
        - recipients
        - senders
        - text
        - type
      type: object
      properties:
        archived:
          type: boolean
        channelAccountId:
          type: string
        channelId:
          type: string
        client:
          $ref: '#/components/schemas/PublicClient'
        conversationsThreadId:
          type: string
        createdAt:
          type: string
          format: date-time
        createdBy:
          type: string
        id:
          type: string
        recipients:
          type: array
          items:
            $ref: '#/components/schemas/PublicRecipient'
        richText:
          type: string
        senders:
          type: array
          items:
            $ref: '#/components/schemas/PublicSender'
        text:
          type: string
        type:
          type: string
          default: WELCOME_MESSAGE
          enum:
            - WELCOME_MESSAGE
        updatedAt:
          type: string
          format: date-time
      x-hubspot-sub-type-impl: true
    PublicAssignmentMessage:
      required:
        - archived
        - client
        - conversationsThreadId
        - createdAt
        - createdBy
        - id
        - recipients
        - senders
        - type
      type: object
      properties:
        archived:
          type: boolean
        assignedFrom:
          type: string
        assignedTo:
          type: string
        client:
          $ref: '#/components/schemas/PublicClient'
        conversationsThreadId:
          type: string
        createdAt:
          type: string
          format: date-time
        createdBy:
          type: string
        id:
          type: string
        recipients:
          type: array
          items:
            $ref: '#/components/schemas/PublicRecipient'
        senders:
          type: array
          items:
            $ref: '#/components/schemas/PublicSender'
        type:
          type: string
          default: ASSIGNMENT
          enum:
            - ASSIGNMENT
        updatedAt:
          type: string
          format: date-time
      x-hubspot-sub-type-impl: true
    PublicThreadStatusChange:
      required:
        - archived
        - client
        - conversationsThreadId
        - createdAt
        - createdBy
        - id
        - newStatus
        - recipients
        - senders
        - type
      type: object
      properties:
        archived:
          type: boolean
        client:
          $ref: '#/components/schemas/PublicClient'
        conversationsThreadId:
          type: string
        createdAt:
          type: string
          format: date-time
        createdBy:
          type: string
        id:
          type: string
        newStatus:
          type: string
          enum:
            - CLOSED
            - OPEN
        recipients:
          type: array
          items:
            $ref: '#/components/schemas/PublicRecipient'
        senders:
          type: array
          items:
            $ref: '#/components/schemas/PublicSender'
        type:
          type: string
          default: THREAD_STATUS_CHANGE
          enum:
            - THREAD_STATUS_CHANGE
        updatedAt:
          type: string
          format: date-time
      x-hubspot-sub-type-impl: true
    PublicThreadInboxChange:
      required:
        - archived
        - client
        - conversationsThreadId
        - createdAt
        - createdBy
        - fromInboxId
        - id
        - recipients
        - senders
        - toInboxId
        - type
      type: object
      properties:
        archived:
          type: boolean
        client:
          $ref: '#/components/schemas/PublicClient'
        conversationsThreadId:
          type: string
        createdAt:
          type: string
          format: date-time
        createdBy:
          type: string
        fromInboxId:
          type: string
        id:
          type: string
        recipients:
          type: array
          items:
            $ref: '#/components/schemas/PublicRecipient'
        senders:
          type: array
          items:
            $ref: '#/components/schemas/PublicSender'
        toInboxId:
          type: string
        type:
          type: string
          default: THREAD_INBOX_CHANGE
          enum:
            - THREAD_INBOX_CHANGE
        updatedAt:
          type: string
          format: date-time
      x-hubspot-sub-type-impl: true
    Error:
      required:
        - category
        - correlationId
        - message
      type: object
      properties:
        category:
          type: string
          description: The error category
        context:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: Context about the error condition
          example: >-
            {invalidPropertyName=[propertyValue], missingScopes=[scope1,
            scope2]}
        correlationId:
          type: string
          description: >-
            A unique identifier for the request. Include this value with any
            error reports or support tickets
          format: uuid
          example: aeb5f871-7f07-4993-9211-075dc63e7cbf
        errors:
          type: array
          description: further information about the error
          items:
            $ref: '#/components/schemas/ErrorDetail'
        links:
          type: object
          additionalProperties:
            type: string
          description: >-
            A map of link names to associated URIs containing documentation
            about the error or recommended remediation steps
        message:
          type: string
          description: >-
            A human readable message describing the error along with remediation
            steps where appropriate
          example: An error occurred
        subCategory:
          type: string
          description: >-
            A specific category that contains more specific detail about the
            error
      example:
        message: Invalid input (details will vary based on the error)
        correlationId: aeb5f871-7f07-4993-9211-075dc63e7cbf
        category: VALIDATION_ERROR
        links:
          knowledge-base: https://www.hubspot.com/products/service/knowledge-base
    NextPage:
      required:
        - after
      type: object
      properties:
        after:
          type: string
          description: A paging cursor token for retrieving subsequent pages.
        link:
          type: string
          description: A URL that can be used to retrieve the next page results.
      description: >-
        Specifies the paging information needed to retrieve the next set of
        results in a paginated API response
    PublicFile:
      title: FILE
      required:
        - fileId
        - fileUsageType
        - type
      type: object
      properties:
        fileId:
          type: string
        fileUsageType:
          type: string
          enum:
            - AUDIO
            - IMAGE
            - OTHER
            - STICKER
            - VOICE_RECORDING
        name:
          type: string
        type:
          type: string
          default: FILE
          enum:
            - FILE
        url:
          type: string
      x-hubspot-sub-type-impl: true
    PublicLocation:
      title: LOCATION
      required:
        - latitude
        - longitude
        - type
      type: object
      properties:
        address:
          type: string
        latitude:
          type: number
        longitude:
          type: number
        name:
          type: string
        type:
          type: string
          default: LOCATION
          enum:
            - LOCATION
        url:
          type: string
      x-hubspot-sub-type-impl: true
    PublicContact:
      title: CONTACT
      required:
        - contactProfile
        - type
      type: object
      properties:
        contactProfile:
          $ref: '#/components/schemas/ContactProfile'
        type:
          type: string
          default: CONTACT
          enum:
            - CONTACT
      x-hubspot-sub-type-impl: true
    PublicUnsupportedContent:
      title: UNSUPPORTED_CONTENT
      required:
        - type
      type: object
      properties:
        type:
          type: string
          default: UNSUPPORTED_CONTENT
          enum:
            - UNSUPPORTED_CONTENT
      x-hubspot-sub-type-impl: true
    PublicMessageHeader:
      title: MESSAGE_HEADER
      required:
        - type
      type: object
      properties:
        fileId:
          type: integer
          format: int64
        text:
          type: string
        type:
          type: string
          default: MESSAGE_HEADER
          enum:
            - MESSAGE_HEADER
      x-hubspot-sub-type-impl: true
    PublicQuickReplies:
      title: QUICK_REPLIES
      required:
        - allowMultiSelect
        - allowUserInput
        - quickReplies
        - type
      type: object
      properties:
        allowMultiSelect:
          type: boolean
        allowUserInput:
          type: boolean
        quickReplies:
          type: array
          items:
            $ref: '#/components/schemas/QuickReply'
        type:
          type: string
          default: QUICK_REPLIES
          enum:
            - QUICK_REPLIES
      x-hubspot-sub-type-impl: true
    PublicWhatsAppTemplateMetadata:
      title: WHATSAPP_TEMPLATE_METADATA
      required:
        - crmObjectIds
        - parameters
        - type
      type: object
      properties:
        contentId:
          type: integer
          format: int64
        crmObjectIds:
          type: object
          additionalProperties:
            type: integer
            format: int64
        mappedTemplateId:
          type: integer
          format: int64
        parameters:
          type: object
          additionalProperties:
            type: string
        rootMicId:
          type: integer
          format: int64
        type:
          type: string
          default: WHATSAPP_TEMPLATE_METADATA
          enum:
            - WHATSAPP_TEMPLATE_METADATA
      x-hubspot-sub-type-impl: true
    PublicSocialMetadataAttachment:
      title: SOCIAL_MEDIA_METADATA
      required:
        - socialMetadata
        - type
      type: object
      properties:
        socialMetadata:
          $ref: '#/components/schemas/SocialMetadata'
        type:
          type: string
          default: SOCIAL_MEDIA_METADATA
          enum:
            - SOCIAL_MEDIA_METADATA
      x-hubspot-sub-type-impl: true
    PublicClient:
      required:
        - clientType
      type: object
      properties:
        clientType:
          type: string
          description: The type of the client.
          enum:
            - HUBSPOT
            - INTEGRATION
            - SYSTEM
            - UNKNOWN
        integrationAppId:
          type: integer
          description: The ID of the client if the client is an integration.
          format: int32
    PublicRecipient:
      required:
        - deliveryIdentifier
      type: object
      properties:
        actorId:
          type: string
        deliveryIdentifier:
          $ref: '#/components/schemas/PublicDeliveryIdentifier'
        name:
          type: string
        recipientField:
          type: string
    PublicSender:
      type: object
      properties:
        actorId:
          type: string
        deliveryIdentifier:
          $ref: '#/components/schemas/PublicDeliveryIdentifier'
        name:
          type: string
        senderField:
          type: string
    PublicMessageStatus:
      required:
        - statusType
      type: object
      properties:
        failureDetails:
          $ref: '#/components/schemas/PublicMessageFailureDetails'
        statusType:
          type: string
          enum:
            - FAILED
            - READ
            - RECEIVED
            - SENT
    ErrorDetail:
      required:
        - message
      type: object
      properties:
        code:
          type: string
          description: The status code associated with the error detail
        context:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: Context about the error condition
          example: '{missingScopes=[scope1, scope2]}'
        in:
          type: string
          description: The name of the field or parameter in which the error was found.
        message:
          type: string
          description: >-
            A human readable message describing the error along with remediation
            steps where appropriate
        subCategory:
          type: string
          description: >-
            A specific category that contains more specific detail about the
            error
    ContactProfile:
      required:
        - addresses
        - emails
        - phones
        - urls
      type: object
      properties:
        addresses:
          type: array
          items:
            $ref: '#/components/schemas/ContactAddress'
        emails:
          type: array
          items:
            $ref: '#/components/schemas/ContactEmail'
        name:
          $ref: '#/components/schemas/ContactName'
        org:
          $ref: '#/components/schemas/ContactOrg'
        phones:
          type: array
          items:
            $ref: '#/components/schemas/ContactPhone'
        urls:
          type: array
          items:
            $ref: '#/components/schemas/ContactUrl'
    QuickReply:
      required:
        - value
        - valueType
      type: object
      properties:
        label:
          type: string
        value:
          type: string
        valueType:
          type: string
          enum:
            - TEXT
            - URL
    SocialMetadata:
      required:
        - mediaType
      type: object
      properties:
        description:
          type: string
        id:
          type: string
        mediaTitle:
          type: string
        mediaType:
          type: string
          enum:
            - ARTICLE
            - AUDIO
            - CAROUSEL
            - DOCUMENT
            - GIF
            - LINK
            - NONE
            - PHOTO
            - POLL
            - STORY
            - VIDEO
        mediaUrl:
          type: string
        mediaUrlString:
          type: string
        thumbnailUrl:
          type: string
    PublicDeliveryIdentifier:
      required:
        - type
        - value
      type: object
      properties:
        type:
          type: string
          description: >-
            The type of identifier. HS_EMAIL_ADDRESS for email addresses;
            HS_PHONE_NUMBER for a phone number; CHANNEL_SPECIFIC_OPAQUE_ID for
            channels that use their own proprietary identifiers, like Facebook
            Messenger or LiveChat.
          enum:
            - CHANNEL_SPECIFIC_OPAQUE_ID
            - HS_EMAIL_ADDRESS
            - HS_PHONE_NUMBER
            - HS_SHORT_CODE
        value:
          type: string
          description: >-
            A string representation of the PublicDeliveryIdentifier, either an
            an E.164 phone number, an email address, or a channel-specific
            identifier.
    PublicMessageFailureDetails:
      required:
        - errorMessageTokens
      type: object
      properties:
        errorMessage:
          type: string
        errorMessageTokens:
          type: object
          additionalProperties:
            type: string
    ContactAddress:
      type: object
      properties:
        city:
          type: string
        country:
          type: string
        countryCode:
          type: string
        state:
          type: string
        street:
          type: string
        type:
          type: string
          enum:
            - HOME
            - WORK
        zip:
          type: string
    ContactEmail:
      required:
        - email
      type: object
      properties:
        email:
          type: string
        type:
          type: string
          enum:
            - HOME
            - WORK
    ContactName:
      type: object
      properties:
        firstName:
          type: string
        lastName:
          type: string
        middleName:
          type: string
        prefix:
          type: string
        suffix:
          type: string
    ContactOrg:
      type: object
      properties:
        company:
          type: string
        department:
          type: string
        title:
          type: string
    ContactPhone:
      required:
        - phone
      type: object
      properties:
        phone:
          type: string
        type:
          type: string
          enum:
            - CELL
            - HOME
            - MAIN
            - WORK
    ContactUrl:
      required:
        - url
      type: object
      properties:
        type:
          type: string
          enum:
            - HOME
            - WORK
        url:
          type: string
  responses:
    Error:
      description: An error occurred.
      content:
        '*/*':
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://app.hubspot.com/oauth/authorize
          tokenUrl: https://api.hubapi.com/oauth/v1/token
          scopes:
            conversations.read: ''
            conversations.write: ''

````