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

# List messages

> Messages in order. Poll for status, next_action, outline, cost_credits and preview_video_url. status: queued, running, stopping, paused, completed, failed or stopped. next_action is set only when paused: confirm_outline (confirm or revise the outline) or reply (answer the assistant with a prompt). completed, paused, failed and stopped are terminal for that message. outline is present once an outline exists: title, total_scenes, estimated_duration_seconds, visual_style, confirmed and scenes [{index,title,intent,type,estimated_duration_seconds}].

export const XpilotArticleMetadata = () => <script type="application/ld+json" data-xpilot-article-metadata="" dangerouslySetInnerHTML={{
  __html: "{\"@context\":\"https://schema.org\",\"@id\":\"https://developers.x-pilot.ai/api-reference/list-messages#apireference\",\"author\":{\"@type\":\"Organization\",\"@id\":\"https://www.x-pilot.ai/#organization\",\"name\":\"X-Pilot\",\"url\":\"https://www.x-pilot.ai/\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https://developers.x-pilot.ai/images/integration-api.png\",\"width\":1200,\"height\":675,\"caption\":\"REST requests use a scoped API key. Keys, credits and usage are managed in the App console.\"}}"
}} />;

<XpilotArticleMetadata />

export const XpilotBreadcrumb = () => <nav aria-label="Breadcrumb" className="xpilot-breadcrumb"><ol><li><a href="/api-reference/list-conversations">Video Agent</a></li><li aria-current="page"><span aria-hidden="true">/</span><span>List messages</span></li></ol></nav>;

<XpilotBreadcrumb />

<p className="xpilot-doc-author">Documentation by <a href="https://www.x-pilot.ai/">X-Pilot</a></p>

Required scope: `video_agents:read`.

[Manage API keys](https://app.x-pilot.ai/developers/console) · [Authentication and recovery](/api-reference)

export const XpilotDocFigure = () => <figure className="xpilot-doc-figure"><img src="/images/integration-api.png" alt="An application sends a scoped API key to the X-Pilot REST API and receives an HTTP status and JSON response." width="1200" height="675" loading="lazy" /><figcaption>REST requests use a scoped API key. Keys, credits and usage are managed in the App console.</figcaption></figure>;

<XpilotDocFigure />


## OpenAPI

````yaml openapi.json GET /v1/video-agents/conversations/{conversation_id}/messages
openapi: 3.0.3
info:
  title: X-Pilot Developer API
  version: 1.1.0
  description: >-
    Generated from the same public REST contract used by the X-Pilot app. REST
    uses scoped API Keys. MCP OAuth tokens do not authenticate REST requests.
servers:
  - url: https://api.x-pilot.ai
    description: Production; confirm the deployed base URL in Developer Console.
security:
  - BearerAuth: []
tags:
  - name: Video Agent
  - name: Renders
  - name: Brand kits
  - name: Account & capacity
  - name: Assets
  - name: Voices & audio
  - name: Avatars
paths:
  /v1/video-agents/conversations/{conversation_id}/messages:
    get:
      tags:
        - Video Agent
      summary: List messages
      description: >-
        Messages in order. Poll for status, next_action, outline, cost_credits
        and preview_video_url. status: queued, running, stopping, paused,
        completed, failed or stopped. next_action is set only when paused:
        confirm_outline (confirm or revise the outline) or reply (answer the
        assistant with a prompt). completed, paused, failed and stopped are
        terminal for that message. outline is present once an outline exists:
        title, total_scenes, estimated_duration_seconds, visual_style, confirmed
        and scenes [{index,title,intent,type,estimated_duration_seconds}].
      operationId: list-messages
      parameters:
        - name: conversation_id
          in: path
          required: true
          description: An owned video agent conversation ID.
          schema:
            type: string
            description: An owned video agent conversation ID.
      responses:
        '200':
          description: Success
          content:
            application/json:
              example:
                data:
                  items:
                    - conversation_id: <conversation_id>
                      message_id: <message_id>
                      status: paused
                      next_action: confirm_outline
                      outline:
                        title: Solar energy in 3 minutes
                        total_scenes: 2
                        estimated_duration_seconds: 45
                        visual_style: clean_lecture
                        confirmed: false
                        scenes:
                          - index: 1
                            title: Why the sun matters
                            intent: Hook
                            type: normal
                            estimated_duration_seconds: 20
                          - index: 2
                            title: How panels convert light
                            intent: Explain the photovoltaic effect
                            type: normal
                            estimated_duration_seconds: 25
                      created_at: 1791849600
                      error: null
                      query: Create a short lesson about solar energy.
                      answer: ...
                      message_files: []
                      preview_video_url: null
                      cost_credits: 12.5
                  total: 1
        '400':
          description: Check parameter types, required fields and idempotency key.
          content:
            application/json:
              example:
                error:
                  code: invalid_parameter
                  message: Check parameter types, required fields and idempotency key.
                request_id: <request_id>
        '401':
          description: Use an active scoped API Key. MCP OAuth tokens cannot call REST.
          content:
            application/json:
              example:
                error:
                  code: invalid_token
                  message: >-
                    Use an active scoped API Key. MCP OAuth tokens cannot call
                    REST.
                request_id: <request_id>
        '403':
          description: Check the credential scope and resource ownership.
          content:
            application/json:
              example:
                error:
                  code: insufficient_scope
                  message: Check the credential scope and resource ownership.
                request_id: <request_id>
        '404':
          description: Use an existing owned conversation, message, brand kit or render ID.
          content:
            application/json:
              example:
                error:
                  code: not_found
                  message: >-
                    Use an existing owned conversation, message, brand kit or
                    render ID.
                request_id: <request_id>
        '429':
          description: >-
            Credential/workspace rate or concurrency limit reached. Respect
            Retry-After before retrying.
          content:
            application/json:
              example:
                error:
                  code: rate_limited
                  message: >-
                    Credential/workspace rate or concurrency limit reached.
                    Respect Retry-After before retrying.
                  retry_after: 60
                request_id: <request_id>
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            curl --fail-with-body --request GET \
              --url "$XPILOT_API_BASE_URL/v1/video-agents/conversations/%3Cconversation_id%3E/messages" \
              --header "Authorization: Bearer $XPILOT_API_KEY"
        - lang: javascript
          label: JavaScript
          source: >-
            const response = await fetch(process.env.XPILOT_API_BASE_URL +
            "/v1/video-agents/conversations/%3Cconversation_id%3E/messages", {
              method: "GET",
              headers: {
                Authorization: `Bearer ${process.env.XPILOT_API_KEY}`,
              },
            });

            const result = await response.json();

            if (!response.ok) throw new Error(JSON.stringify(result));

            console.log(result);
        - lang: python
          label: Python
          source: |-
            import os, json, requests

            response = requests.request(
                "GET",
                os.environ["XPILOT_API_BASE_URL"] + "/v1/video-agents/conversations/%3Cconversation_id%3E/messages",
                headers={
                    "Authorization": "Bearer " + os.environ["XPILOT_API_KEY"],
                },
                timeout=70,
            )
            print(response.status_code, response.text)
            response.raise_for_status()
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Scoped X-Pilot API key

````

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