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

# Post Chat Messages

> Accept a message and kick off background A2A processing.



## OpenAPI

````yaml /openapi/em-talk2data-v2.yaml post /talk2data/chat/messages
openapi: 3.1.0
info:
  title: Talk to Data Service
  version: 3.2.0-dev1
servers: []
security: []
paths:
  /talk2data/chat/messages:
    post:
      tags:
        - chat
      summary: Post Chat Messages
      description: Accept a message and kick off background A2A processing.
      operationId: post_chat_messages_talk2data_chat_messages_post
      parameters:
        - name: x-project-id
          in: header
          required: true
          schema:
            type: string
            description: Project identifier
            title: X-Project-Id
          description: Project identifier
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatMessageRequest'
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatMessageAcceptedResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ChatMessageRequest:
      properties:
        session_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Session Id
        message:
          type: string
          maxLength: 10000
          minLength: 1
          title: Message
        context:
          anyOf:
            - $ref: '#/components/schemas/MessageContext'
            - type: 'null'
      type: object
      required:
        - message
      title: ChatMessageRequest
      description: Request body for POST /api/chat/messages.
    ChatMessageAcceptedResponse:
      properties:
        session_id:
          type: string
          title: Session Id
        turn_id:
          type: string
          title: Turn Id
      type: object
      required:
        - session_id
        - turn_id
      title: ChatMessageAcceptedResponse
      description: Accepted response for POST /talk2data/chat/messages.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    MessageContext:
      properties:
        datasources:
          items:
            $ref: '#/components/schemas/DatasourceContext-Input'
          type: array
          title: Datasources
        artifacts:
          items:
            $ref: '#/components/schemas/ArtifactContext'
          type: array
          title: Artifacts
        attachments:
          items:
            $ref: '#/components/schemas/AttachmentContext'
          type: array
          title: Attachments
      type: object
      title: MessageContext
      description: 'Context for a chat message: datasources, artifacts, attachments.'
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    DatasourceContext-Input:
      properties:
        type:
          type: string
          const: datasource
          title: Type
          default: datasource
        resource_uri:
          type: string
          maxLength: 512
          title: Resource Uri
        datasource_type:
          type: string
          title: Datasource Type
          default: database
        datasource_name:
          type: string
          maxLength: 255
          title: Datasource Name
        datasource_description:
          anyOf:
            - type: string
              maxLength: 1000
            - type: 'null'
          title: Datasource Description
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
        selected_schemas:
          anyOf:
            - items:
                $ref: '#/components/schemas/DatasourceSelectedSchema'
              type: array
            - type: 'null'
          title: Selected Schemas
      type: object
      required:
        - resource_uri
        - datasource_name
      title: DatasourceContext
      description: Selected datasource for the message context.
    ArtifactContext:
      properties:
        resource_uri:
          type: string
          maxLength: 255
          title: Resource Uri
        artifact_type:
          type: string
          title: Artifact Type
        artifact_title:
          anyOf:
            - type: string
            - type: 'null'
          title: Artifact Title
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
      type: object
      required:
        - resource_uri
        - artifact_type
      title: ArtifactContext
      description: Referenced artifact for follow-up questions.
    AttachmentContext:
      properties:
        resource_uri:
          type: string
          maxLength: 255
          title: Resource Uri
        filename:
          type: string
          title: Filename
        content_type:
          type: string
          title: Content Type
      type: object
      required:
        - resource_uri
        - filename
        - content_type
      title: AttachmentContext
      description: Uploaded file reference from assets registry.
    DatasourceSelectedSchema:
      properties:
        schema_name:
          type: string
          title: Schema Name
        schema_fqn:
          anyOf:
            - type: string
            - type: 'null'
          title: Schema Fqn
        selected_tables:
          anyOf:
            - items:
                $ref: '#/components/schemas/DatasourceSelectedTable'
              type: array
            - type: 'null'
          title: Selected Tables
      type: object
      required:
        - schema_name
      title: DatasourceSelectedSchema
      description: A schema the user scoped, with optional table list.
    DatasourceSelectedTable:
      properties:
        table_name:
          type: string
          title: Table Name
        table_fqn:
          anyOf:
            - type: string
            - type: 'null'
          title: Table Fqn
      type: object
      required:
        - table_name
      title: DatasourceSelectedTable
      description: A table the user scoped within a schema.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````