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

# List messages

> Read only this visitor's public message history. Authorization and resource ownership are evaluated on every request.



## OpenAPI

````yaml /openapi/widget.json get /api/v1/chat/visitor/messages
openapi: 3.1.0
info:
  title: Widget API
  version: 1.0.0
  description: >-
    Embed Writine chat on your own site. These endpoints need no Writine
    account: the widget routes are authorised by your site origin allowlist, and
    the visitor routes by a token issued when a conversation starts.
servers:
  - url: https://api.writine.com
    description: Production
security: []
paths:
  /api/v1/chat/visitor/messages:
    get:
      summary: List messages
      description: >-
        Read only this visitor's public message history. Authorization and
        resource ownership are evaluated on every request.
      operationId: chat_get__api_v1_chat_visitor_messages
      parameters:
        - in: query
          name: after
          schema:
            type: integer
            minimum: 0
        - in: query
          name: limit
          schema:
            type: integer
            minimum: 0
        - in: header
          name: Origin
          required: true
          schema:
            type: string
            format: uri
          description: >-
            Must exactly match the website's allowlist. Visitor tokens are bound
            to this origin.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  result:
                    type: object
                    properties:
                      items:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              maxLength: 100
                            sequence:
                              type: integer
                              minimum: 0
                            conversation_id:
                              type: string
                              maxLength: 100
                            client_id:
                              type: string
                              maxLength: 100
                            author_id:
                              type: string
                              maxLength: 100
                            author_type:
                              type: string
                              enum:
                                - staff
                                - visitor
                            kind:
                              type: string
                              enum:
                                - message
                                - note
                            body:
                              type: string
                              maxLength: 8000
                            created_at:
                              type: string
                              format: date-time
                            author_name:
                              type: string
                              maxLength: 80
                            author_avatar:
                              type: string
                              maxLength: 100
                          required:
                            - id
                            - sequence
                            - conversation_id
                            - client_id
                            - author_id
                            - author_type
                            - kind
                            - body
                            - created_at
                            - author_name
                            - author_avatar
                          additionalProperties: false
                      next_cursor:
                        type: integer
                        minimum: 0
                      has_more:
                        type: boolean
                    required:
                      - items
                      - next_cursor
                      - has_more
                    additionalProperties: false
                  message:
                    type: string
                    maxLength: 256
                required:
                  - success
                  - result
                  - message
                additionalProperties: false
        '400':
          description: Typed error envelope
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  result:
                    type: object
                    properties:
                      code:
                        type: string
                        maxLength: 256
                    required:
                      - code
                    additionalProperties: false
                  message:
                    type: string
                    maxLength: 256
                required:
                  - success
                  - result
                  - message
                additionalProperties: false
        '401':
          description: Typed error envelope
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  result:
                    type: object
                    properties:
                      code:
                        type: string
                        maxLength: 256
                    required:
                      - code
                    additionalProperties: false
                  message:
                    type: string
                    maxLength: 256
                required:
                  - success
                  - result
                  - message
                additionalProperties: false
        '403':
          description: Typed error envelope
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  result:
                    type: object
                    properties:
                      code:
                        type: string
                        maxLength: 256
                    required:
                      - code
                    additionalProperties: false
                  message:
                    type: string
                    maxLength: 256
                required:
                  - success
                  - result
                  - message
                additionalProperties: false
        '404':
          description: Typed error envelope
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  result:
                    type: object
                    properties:
                      code:
                        type: string
                        maxLength: 256
                    required:
                      - code
                    additionalProperties: false
                  message:
                    type: string
                    maxLength: 256
                required:
                  - success
                  - result
                  - message
                additionalProperties: false
        '409':
          description: Typed error envelope
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  result:
                    type: object
                    properties:
                      code:
                        type: string
                        maxLength: 256
                    required:
                      - code
                    additionalProperties: false
                  message:
                    type: string
                    maxLength: 256
                required:
                  - success
                  - result
                  - message
                additionalProperties: false
        '429':
          description: Typed error envelope
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  result:
                    type: object
                    properties:
                      code:
                        type: string
                        maxLength: 256
                    required:
                      - code
                    additionalProperties: false
                  message:
                    type: string
                    maxLength: 256
                required:
                  - success
                  - result
                  - message
                additionalProperties: false
        '500':
          description: Typed error envelope
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  result:
                    type: object
                    properties:
                      code:
                        type: string
                        maxLength: 256
                    required:
                      - code
                    additionalProperties: false
                  message:
                    type: string
                    maxLength: 256
                required:
                  - success
                  - result
                  - message
                additionalProperties: false
        '503':
          description: Typed error envelope
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  result:
                    type: object
                    properties:
                      code:
                        type: string
                        maxLength: 256
                    required:
                      - code
                    additionalProperties: false
                  message:
                    type: string
                    maxLength: 256
                required:
                  - success
                  - result
                  - message
                additionalProperties: false
      security:
        - Visitor token: []
components:
  securitySchemes:
    Visitor token:
      type: http
      scheme: bearer
      description: Opaque, 24-hour, conversation-scoped visitor credential

````

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