v0 Platform API/API Reference/Chats

Get Chat Message

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

GET/v1/chats/{chatId}/messages/{messageId}

Usage

TypeScript Example
import { v0 } from 'v0-sdk'

const result = await v0.chats.getMessage()

console.log(result)

API Signature

Request

Path Parameters

chatId: string

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

messageId: string

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

Response

id: string

A unique identifier for the message.

object: 'message'

Fixed value identifying this object as a message.

content: string

The main text content of the message.

experimental_content?: string[]

The parsed content of the message as an array structure containing AST nodes. This is an experimental field that may change.

createdAt: string

The ISO timestamp representing when the message was created.

updatedAt?: string

The ISO timestamp representing when the message was last updated.

type: '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'

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

role: 'user' | 'assistant'

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

finishReason?: 'stop' | 'length' | 'content-filter' | 'tool-calls' | 'error' | 'other' | 'unknown'

The reason why the message generation finished.

apiUrl: string

API URL to access this message via the API.

parentId?: stringnull

The ID of the parent message.

chatId: string

The ID of the chat to which this message belongs.