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

# Get message

> メッセージ1件を ID 指定で取得します。

ワークスペースに公開されているメッセージが対象です。
次のいずれかに当てはまる場合は、存在の有無を明かさずすべて 404 を返します。
- 指定 ID のメッセージが存在しない、または別ワークスペースのものである
- メッセージが削除済みである
- ワークスペースの共有設定でメッセージが公開されていない
- 通常のメッセージではない（バウンス・自動返信など）

メールを取り込んだメンバーが退職したり、メール連携を解除したりしても、
取り込み済みのメッセージは引き続き取得できます。

公開されていない項目は `null` になります。詳細は `subject` / `text` の説明を
参照してください。

`participants` は常に完全な配列を返します（件数による打ち切りやページングは
ありません）。1 件もない場合は空配列を返し、フィールド自体を省略することはありません。

紐づく CRM レコード（Company / Deal）はこのレスポンスには含まれません。
`GET /v2/activities/{activityId}` の `links` を参照してください
（`GET /v2/activities` の `source_type=MESSAGE` の項目で `source_id` が
メッセージIDと一致します）。

添付ファイルの本体は返しません。




## OpenAPI

````yaml /openapi.yaml get /v2/messages/{messageId}
openapi: 3.1.0
info:
  title: Frictio Public API
  version: 1.0.0-beta
servers:
  - url: https://public-api.frictio.ai
security:
  - ApiKeyAuth: []
paths:
  /v2/messages/{messageId}:
    get:
      summary: Get message
      description: |
        メッセージ1件を ID 指定で取得します。

        ワークスペースに公開されているメッセージが対象です。
        次のいずれかに当てはまる場合は、存在の有無を明かさずすべて 404 を返します。
        - 指定 ID のメッセージが存在しない、または別ワークスペースのものである
        - メッセージが削除済みである
        - ワークスペースの共有設定でメッセージが公開されていない
        - 通常のメッセージではない（バウンス・自動返信など）

        メールを取り込んだメンバーが退職したり、メール連携を解除したりしても、
        取り込み済みのメッセージは引き続き取得できます。

        公開されていない項目は `null` になります。詳細は `subject` / `text` の説明を
        参照してください。

        `participants` は常に完全な配列を返します（件数による打ち切りやページングは
        ありません）。1 件もない場合は空配列を返し、フィールド自体を省略することはありません。

        紐づく CRM レコード（Company / Deal）はこのレスポンスには含まれません。
        `GET /v2/activities/{activityId}` の `links` を参照してください
        （`GET /v2/activities` の `source_type=MESSAGE` の項目で `source_id` が
        メッセージIDと一致します）。

        添付ファイルの本体は返しません。
      operationId: getV2Message
      parameters:
        - $ref: '#/components/parameters/workspaceId'
        - $ref: '#/components/parameters/messageId'
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2Message'
        '400':
          $ref: '#/components/responses/V2BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/V2NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  parameters:
    workspaceId:
      name: X-Workspace-Id
      in: header
      required: true
      description: ワークスペースID
      schema:
        type: string
      example: e1f2a3b4-...
    messageId:
      name: messageId
      in: path
      required: true
      description: メッセージID
      schema:
        type: string
        format: uuid
      example: 0d2f1b7c-3a44-4c8e-9f10-6b5e2d8a4c31
  schemas:
    V2Message:
      allOf:
        - $ref: '#/components/schemas/V2MessageListItem'
        - type: object
          required:
            - text
          properties:
            text:
              type:
                - string
                - 'null'
              description: |
                本文（プレーンテキスト、全文）。ワークスペースの共有設定で本文が
                公開されていない場合は `null` です。本文が元から空のメッセージも `null` です。
                この2つは区別できません。
                一覧（`GET /v2/messages`）にはこの項目は含まれません。
    V2MessageListItem:
      type: object
      required:
        - id
        - header_message_id
        - thread_id
        - subject
        - received_at
        - is_internal
        - is_group_email
        - participants
      properties:
        id:
          type: string
          format: uuid
          description: |
            メッセージID。`GET /v2/activities` の `source_type` が `MESSAGE` の項目では
            `source_id` と一致します。
            UUID 形式でない値を指定した場合は 400 になります。
          example: 0d2f1b7c-3a44-4c8e-9f10-6b5e2d8a4c31
        header_message_id:
          type: string
          description: |
            RFC 5322 の `Message-ID` ヘッダ。メール送信元が付与する識別子で、
            プロバイダに依存しない重複排除キーとして使えます。
          example: <CAF=abc123@mail.gmail.com>
        thread_id:
          type:
            - string
            - 'null'
          description: |
            スレッドID。同一スレッドの判定に使えます。
            `GET /v2/messages` の `thread_id` に渡すとスレッド内のメッセージを取得できます。
            取得できない場合は `null` です。
          example: 19821a3c9f0b1d2e
        subject:
          type:
            - string
            - 'null'
          description: |
            件名。ワークスペースの共有設定で件名が公開されていない場合は `null` です。
            件名が元から空のメッセージも `null` です。この2つは区別できません。
        received_at:
          type: string
          format: date-time
          description: 送受信日時（UTC）。
          example: '2026-08-27T04:12:33.000Z'
        is_internal:
          type: boolean
          description: |
            参加者（From / To / Cc）が全員社内メンバーのメッセージかどうか。
            現在のAPIでは社内メッセージを公開対象に含めません。
        is_group_email:
          type: boolean
          description: メーリングリスト等のグループ宛メッセージかどうか。
        participants:
          type: array
          description: >
            参加者の全件。`FROM` → `TO` → `CC` → `BCC` の順、同一 `role` 内は `handle`
            の昇順で返します。
          items:
            $ref: '#/components/schemas/V2MessageParticipant'
      example:
        id: 0d2f1b7c-3a44-4c8e-9f10-6b5e2d8a4c31
        header_message_id: <CAF=abc123@mail.gmail.com>
        thread_id: 19821a3c9f0b1d2e
        subject: 'Re: 見積のご確認'
        received_at: '2026-08-27T04:12:33.000Z'
        is_internal: false
        is_group_email: false
        participants:
          - handle: sato@example.com
            display_name: 佐藤 花子
            role: FROM
            contact_id: 7a9c4e51-8b26-4d03-9f18-2e6b5c47d90a
          - handle: eigyo@syslea.co.jp
            display_name: null
            role: TO
            contact_id: null
    V2Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
            request_id:
              type: string
    Error:
      type: object
      required:
        - statusCode
        - message
      properties:
        statusCode:
          type: integer
          description: HTTPステータスコード
          example: 404
        message:
          type: string
          description: エラーメッセージ
          example: Meeting not found
        error:
          type: string
          description: |
            エラー種別。メッセージ文字列付きで例外が生成された場合のみ含まれます。
          example: Not Found
    V2MessageParticipant:
      type: object
      description: メッセージの参加者1名。`role` はメールヘッダ上の役割です。
      required:
        - handle
        - display_name
        - role
        - contact_id
      properties:
        handle:
          type: string
          description: メールアドレス。
          example: sato@example.com
        display_name:
          type:
            - string
            - 'null'
          description: 表示名。メールヘッダに含まれない場合は `null` です。
          example: 佐藤 花子
        role:
          type: string
          enum:
            - FROM
            - TO
            - CC
            - BCC
        contact_id:
          type:
            - string
            - 'null'
          format: uuid
          description: |
            対応する Contact のID。未紐付けの場合、または参照先が公開範囲外の場合は `null` です。
          example: 7a9c4e51-8b26-4d03-9f18-2e6b5c47d90a
  responses:
    V2BadRequest:
      description: 不正なリクエスト
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/V2Error'
    Unauthorized:
      description: APIキーが無効、失効、期限切れ、または未指定です
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            invalidApiKey:
              summary: 無効な API キー
              value:
                statusCode: 401
                message: Invalid API key
                error: Unauthorized
            missingApiKey:
              summary: API キー未指定
              value:
                statusCode: 401
                message: Missing X-Api-Key header
                error: Unauthorized
    Forbidden:
      description: 権限エラー
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 403
            message: Forbidden
    V2NotFound:
      description: リソースが見つからない
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/V2Error'
    TooManyRequests:
      description: レートリミット超過
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 429
            message: Too Many Requests
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.