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

# Read recent message history

> Returns the last 10 chat items for a design (user prompts, AI
responses, artifact versions, manual edits). Use `?skip=N` to paginate
backwards through older items. Page size is fixed at 10.

Because the editor is collaborative, the user (or other agents) may
have sent prompts or made changes between your tool calls. Use this
to stay in sync with the current state.

Code contents are omitted from chat items to keep the response small.
Use `POST /v3/designs/{editorId}/artifacts/{artifactId}/files/read`
to read full file contents.




## OpenAPI

````yaml openapi-v3.yml get /v3/designs/{editorId}/messages
openapi: 3.0.3
info:
  title: Magic Patterns API (v3)
  version: 3.0.0
  description: |
    The Magic Patterns API v3 provides programmatic access to design generation,
    iteration, and code-level editing. v3 mirrors the surface of the Magic
    Patterns MCP server — a single key authenticates both transports.

    v3 bills against your normal Magic Patterns credit balance. There is no
    separate API subscription. Free tier users can call v3 up to their credit
    limit, identical to web and MCP usage.

    For the legacy v2 single-shot creation endpoint (separate $99/mo plan),
    see the v2 reference.
servers:
  - url: https://api.magicpatterns.com/api
security:
  - ApiKeyAuth: []
tags:
  - name: Health
  - name: Design Systems
  - name: Designs
  - name: Artifacts
paths:
  /v3/designs/{editorId}/messages:
    get:
      tags:
        - Designs
      summary: Read recent message history
      description: |
        Returns the last 10 chat items for a design (user prompts, AI
        responses, artifact versions, manual edits). Use `?skip=N` to paginate
        backwards through older items. Page size is fixed at 10.

        Because the editor is collaborative, the user (or other agents) may
        have sent prompts or made changes between your tool calls. Use this
        to stay in sync with the current state.

        Code contents are omitted from chat items to keep the response small.
        Use `POST /v3/designs/{editorId}/artifacts/{artifactId}/files/read`
        to read full file contents.
      operationId: getDesignMessagesV3
      parameters:
        - $ref: '#/components/parameters/EditorId'
        - $ref: '#/components/parameters/Skip'
      responses:
        '200':
          description: Paginated chat history.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatHistoryPage'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  parameters:
    EditorId:
      name: editorId
      in: path
      required: true
      description: The design's editor ID.
      schema:
        type: string
        example: abc123
    Skip:
      name: skip
      in: query
      required: false
      description: Number of most-recent items to skip (for pagination). Defaults to 0.
      schema:
        type: integer
        minimum: 0
        default: 0
  schemas:
    ChatHistoryPage:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ChatHistoryItem'
        hasMore:
          type: boolean
          description: >-
            True if there are older items beyond this page. Paginate with
            `?skip=`.
    ChatHistoryItem:
      type: object
      properties:
        id:
          type: string
        role:
          type: string
          description: One of `user`, `assistant`, `app`.
          example: assistant
        app:
          type: string
          nullable: true
          description: Origin label for `app`-role items (e.g. `api`, `mcp`).
        content:
          type: array
          items: {}
          description: Item content blocks (summarized — code is omitted).
        timeCreated:
          type: integer
          description: Milliseconds since the Unix epoch.
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Human-readable error message.
          example: You do not have access to this resource.
  responses:
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: The caller does not have access to this resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: The requested design or artifact does not exist.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-mp-api-key
      description: >
        Magic Patterns API key. The same key authenticates v3 REST and the

        MCP server. Create one at
        https://www.magicpatterns.com/settings/api-keys.

````