Get Chat Message

Retrieves detailed information about a specific message within a chat, including content, files, model configuration, and demo URLs.

GET /chats/{chatId}/messages/{messageId}
import { v0 } from 'v0-sdk'

const result = await v0.chats.getMessage()

console.log(result)
GET /chats/{chatId}/messages/{messageId}
curl -X GET https://api.v0.dev/chats/{chatId}/messages/{messageId} \
  -H "Authorization: Bearer $V0_API_KEY" \
  -H "Content-Type: application/json"

Parameters

Path Parameters

chatId string Required

The unique identifier of the chat containing the message. Provided as a path parameter.


messageId string Required

The unique identifier of the message to retrieve. Provided as a path parameter.


Response

Response Body

id string Required

A unique identifier for the message.


object string Required

Fixed value identifying this object as a message.


content string Required

The main text content of the message.


createdAt string Required

The ISO timestamp representing when the message was created.


updatedAt string

The ISO timestamp representing when the message was last updated.


type enum Required

Indicates the format or category of the message, such as plain text or code.

Possible values:

  • message
  • forked-block
  • forked-chat
  • open-in-v0
  • refinement
  • added-environment-variables
  • added-integration
  • deleted-file
  • moved-file
  • renamed-file
  • edited-file
  • replace-src
  • reverted-block
  • fix-with-v0
  • auto-fix-with-v0
  • sync-git

role enum Required

Specifies whether the message was sent by the user or the assistant.

Possible values:

  • user
  • assistant

apiUrl string Required

API URL to access this message via the API.


chatId string Required

The ID of the chat to which this message belongs.