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

# Create a chat message

> Create a new message in a chat.
The response includes the latest message in the chat.



## OpenAPI

````yaml https://vectorify.ai/api.json post /chats/{chat}/messages
openapi: 3.1.0
info:
  title: Vectorify
  version: 1.0.0
servers:
  - url: https://api.vectorify.ai/v1
    description: Production
security:
  - apiKey: []
tags:
  - name: Query
  - name: Chats
  - name: Upserts
  - name: Items
  - name: Collections
paths:
  /chats/{chat}/messages:
    post:
      tags:
        - Chats
      summary: Create a chat message
      description: |-
        Create a new message in a chat.
        The response includes the latest message in the chat.
      operationId: messages.store
      parameters:
        - name: chat
          in: path
          required: true
          description: The chat ID
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/App.Http.Requests.Api.ChatMessage'
      responses:
        '201':
          description: '`ChatMessage`'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/ChatMessage'
                required:
                  - data
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    App.Http.Requests.Api.ChatMessage:
      type: object
      properties:
        text:
          type: string
      required:
        - text
      title: App.Http.Requests.Api.ChatMessage
    ChatMessage:
      type: object
      properties:
        id:
          type: string
        chat_id:
          type: string
        role:
          type: string
        user:
          $ref: '#/components/schemas/User'
        text:
          type: string
        text_html:
          type: string
        identifier:
          type:
            - string
            - 'null'
        feedback:
          type:
            - string
            - 'null'
        created_at:
          type: string
      required:
        - id
        - chat_id
        - role
        - text
        - text_html
        - identifier
        - feedback
        - created_at
      title: ChatMessage
    User:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        email:
          type: string
        avatar:
          type: string
        created_at:
          type: string
      required:
        - id
        - name
        - email
        - avatar
        - created_at
      title: User
  responses:
    ModelNotFoundException:
      description: Not found
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: Api-Key

````