---
updatedAt: 2026-04-27T13:21:55.000Z
agentTools:
  projectIndex: https://developers.karte.io/llms.txt
---

# Get messages for a specific user.

KARTE Talk に送信されたメッセージを取得します。

#### Required Scope
APIの実行に必要なScopeです。
```
talk.message.get
```

#### Required Role
管理画面でScopeを追加する際に必要な権限です。
```
KARTE Talk > メッセージ閲覧
```


# OpenAPI definition

````json
{
  "openapi": "3.0.0",
  "servers": [
    {
      "url": "https://api.karte.io",
      "description": "Production server"
    },
    {
      "url": "https://api-jp.karte.io",
      "description": "Production JP server. リージョン固定オプションのプロジェクトはこちらのエンドポイントを利用してください."
    }
  ],
  "info": {
    "version": "2.0.0",
    "title": "Talk"
  },
  "paths": {
    "/v2/talk/message/get": {
      "post": {
        "tags": [
          "Message"
        ],
        "summary": "Get messages for a specific user.",
        "description": "KARTE Talk に送信されたメッセージを取得します。\n\n#### Required Scope\nAPIの実行に必要なScopeです。\n```\ntalk.message.get\n```\n\n#### Required Role\n管理画面でScopeを追加する際に必要な権限です。\n```\nKARTE Talk > メッセージ閲覧\n```\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user_id"
                ],
                "properties": {
                  "user_id": {
                    "type": "string",
                    "description": "取得する対象ユーザーのID"
                  },
                  "options": {
                    "description": "取得するときの条件",
                    "type": "object",
                    "properties": {
                      "limit": {
                        "description": "取得する最大レコード数を指定します。最大50件",
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50,
                        "default": 1
                      },
                      "date_before_exclusive": {
                        "type": "string",
                        "description": "指定した日時より前のメッセージを取得します。日時のフォーマットはISO String (YYYY-MM-DDTHH:mm:ss.sssZ) です。"
                      },
                      "message_id": {
                        "type": "string",
                        "description": "取得するメッセージの ID を指定します。"
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArrayOfMessages"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "x-karte-api",
            "schema": {
              "type": "string"
            },
            "description": "今後利用する可能性のある予約語です。現在は設定不要です。"
          },
          {
            "in": "header",
            "name": "authorization",
            "schema": {
              "type": "string"
            },
            "description": "認証情報を含むトークンです。\"Authorization\" ヘッダーに `Bearer <token>` の形式で設定してください。"
          },
          {
            "in": "header",
            "name": "content-type",
            "schema": {
              "type": "string"
            },
            "description": "リクエストのコンテンツタイプを指定します。通常は `application/json` を使用してください。"
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "Message": {
        "type": "object",
        "properties": {
          "content": {
            "type": "object",
            "description": "チャットの内容",
            "properties": {
              "text": {
                "type": "string",
                "nullable": true,
                "description": "メッセージの内容"
              },
              "image": {
                "type": "string",
                "nullable": true,
                "description": "画像の URL"
              }
            },
            "additionalProperties": false
          },
          "user_id": {
            "type": "string",
            "description": "チャットのユーザーのID"
          },
          "visitor_id": {
            "type": "string",
            "description": "チャットのユーザーのvisitor用ID"
          },
          "account_id": {
            "type": "string",
            "nullable": true
          },
          "sender_id": {
            "type": "string",
            "description": "メッセージを送信した担当者のID",
            "nullable": true
          },
          "date": {
            "type": "string",
            "description": "メッセージを受信した日時"
          },
          "profile_name": {
            "type": "string",
            "description": "メッセージを送信した担当者の名前",
            "nullable": true
          }
        },
        "required": [
          "content",
          "user_id",
          "visitor_id",
          "sender_id",
          "date",
          "profile_name"
        ],
        "additionalProperties": false
      },
      "ArrayOfMessages": {
        "type": "object",
        "properties": {
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Message"
            }
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "x-explorer-enabled": false
}
````