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

# Create message

> Create a new message in a thread.



## OpenAPI

````yaml post /v1/threads/{thread_id}/messages
openapi: 3.1.0
info:
  title: SeekrFlow API
  description: SeekrFlow API Documentation
  termsOfService: http://www.seekr.com/support
  contact:
    name: Seekr API Support
    url: http://www.seekr.com/contact
    email: contact@seekr.com
  version: 5.30.1
servers:
  - url: https://flow.seekr.com
    description: SeekrBuild server base URL
security: []
paths:
  /v1/threads/{thread_id}/messages:
    post:
      tags:
        - Threads
      summary: Create message
      description: Create a new message in a thread.
      operationId: create_message_endpoint_v1_threads__thread_id__messages_post
      parameters:
        - name: thread_id
          in: path
          required: true
          schema:
            type: string
            title: Thread Id
        - name: include_parts
          in: query
          required: false
          schema:
            type: boolean
            default: false
            title: Include Parts
        - name: x-team-id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Team-Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ThreadMessageRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThreadMessageResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    ThreadMessageRequest:
      properties:
        role:
          type: string
          enum:
            - user
            - system
            - tool
          title: Role
        content:
          anyOf:
            - type: string
            - items:
                oneOf:
                  - $ref: '#/components/schemas/InputText'
                  - $ref: '#/components/schemas/InputImage'
                  - $ref: '#/components/schemas/InputFile'
                discriminator:
                  propertyName: type
                  mapping:
                    input_file:
                      $ref: '#/components/schemas/InputFile'
                    input_image:
                      $ref: '#/components/schemas/InputImage'
                    input_text:
                      $ref: '#/components/schemas/InputText'
              type: array
          title: Content
        meta_data:
          additionalProperties: true
          type: object
          title: Meta Data
      type: object
      required:
        - role
        - content
      title: ThreadMessageRequest
      description: |-
        Pydantic model for creating a thread message request.

        Attributes:
            role (str): The role of the message sender.
            content (Union[str, list[InputMessage], list[OutputMessage]]): The content of the message.
            meta_data (Optional[dict[str, Any]]): Optional metadata dictionary.
    ThreadMessageResponse:
      properties:
        id:
          type: string
          title: Id
        object:
          type: string
          title: Object
          default: thread.message
        created_at:
          type: string
          format: date-time
          title: Created At
        thread_id:
          type: string
          title: Thread Id
        role:
          type: string
          title: Role
        content:
          anyOf:
            - type: string
            - items:
                oneOf:
                  - $ref: '#/components/schemas/InputText'
                  - $ref: '#/components/schemas/InputImage'
                  - $ref: '#/components/schemas/InputFile'
                discriminator:
                  propertyName: type
                  mapping:
                    input_file:
                      $ref: '#/components/schemas/InputFile'
                    input_image:
                      $ref: '#/components/schemas/InputImage'
                    input_text:
                      $ref: '#/components/schemas/InputText'
              type: array
            - items:
                oneOf:
                  - $ref: '#/components/schemas/OutputText'
                  - $ref: '#/components/schemas/OutputGuardrail'
                discriminator:
                  propertyName: type
                  mapping:
                    output_guardrail:
                      $ref: '#/components/schemas/OutputGuardrail'
                    output_text:
                      $ref: '#/components/schemas/OutputText'
              type: array
          title: Content
        parts:
          anyOf:
            - items:
                oneOf:
                  - $ref: '#/components/schemas/MessageTextPart'
                  - $ref: '#/components/schemas/MessageReasoningPart'
                  - $ref: '#/components/schemas/MessageFilePart'
                  - $ref: '#/components/schemas/MessageDataPart'
                  - $ref: '#/components/schemas/MessageToolCallPart'
                  - $ref: '#/components/schemas/MessageToolErrorPart'
                  - $ref: '#/components/schemas/MessageToolResultPart'
                discriminator:
                  propertyName: type
                  mapping:
                    data:
                      $ref: '#/components/schemas/MessageDataPart'
                    file:
                      $ref: '#/components/schemas/MessageFilePart'
                    reasoning:
                      $ref: '#/components/schemas/MessageReasoningPart'
                    text:
                      $ref: '#/components/schemas/MessageTextPart'
                    tool-call:
                      $ref: '#/components/schemas/MessageToolCallPart'
                    tool-error:
                      $ref: '#/components/schemas/MessageToolErrorPart'
                    tool-result:
                      $ref: '#/components/schemas/MessageToolResultPart'
              type: array
            - type: 'null'
          title: Parts
        agent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Id
        run_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Run Id
        meta_data:
          additionalProperties: true
          type: object
          title: Meta Data
      type: object
      required:
        - thread_id
        - role
        - content
      title: ThreadMessageResponse
      description: >-
        Thread message shape returned by the thread API.


        `parts` are opt-in so existing clients keep the previous response shape
        by default.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    InputText:
      properties:
        text:
          type: string
          title: Text
        type:
          type: string
          const: input_text
          title: Type
      type: object
      required:
        - text
        - type
      title: InputText
      description: A text input to be sent to the model.
    InputImage:
      properties:
        detail:
          type: string
          enum:
            - high
            - low
            - auto
          title: Detail
        type:
          type: string
          const: input_image
          title: Type
        file_id:
          anyOf:
            - type: string
            - type: 'null'
          title: File Id
        image_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Image Url
      type: object
      required:
        - detail
        - type
      title: InputImage
      description: An image input to be sent to the model.
    InputFile:
      properties:
        type:
          type: string
          const: input_file
          title: Type
        file_id:
          type: string
          title: File Id
      type: object
      required:
        - type
        - file_id
      title: InputFile
      description: A file input to be sent to the model.
    OutputText:
      properties:
        text:
          type: string
          title: Text
        type:
          type: string
          const: output_text
          title: Type
        annotations:
          items:
            type: string
          type: array
          title: Annotations
      type: object
      required:
        - text
        - type
        - annotations
      title: OutputText
      description: A text output from the model.
    OutputGuardrail:
      properties:
        type:
          type: string
          const: output_guardrail
          title: Type
        text:
          type: string
          title: Text
        guardrail:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Guardrail
      type: object
      required:
        - type
        - text
        - guardrail
      title: OutputGuardrail
      description: A guardrail output from the model.
    MessageTextPart:
      properties:
        id:
          type: string
          title: Id
        type:
          type: string
          const: text
          title: Type
        text:
          type: string
          title: Text
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
      type: object
      required:
        - type
        - text
      title: MessageTextPart
      description: A text part persisted alongside a thread message.
    MessageReasoningPart:
      properties:
        id:
          type: string
          title: Id
        type:
          type: string
          const: reasoning
          title: Type
        text:
          type: string
          title: Text
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
      type: object
      required:
        - type
        - text
      title: MessageReasoningPart
      description: A reasoning part persisted alongside a thread message.
    MessageFilePart:
      properties:
        id:
          type: string
          title: Id
        type:
          type: string
          const: file
          title: Type
        file_id:
          anyOf:
            - type: string
            - type: 'null'
          title: File Id
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
        mime_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Mime Type
        detail:
          anyOf:
            - type: string
              enum:
                - high
                - low
                - auto
            - type: 'null'
          title: Detail
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
      type: object
      required:
        - type
      title: MessageFilePart
      description: A file or image part persisted alongside a thread message.
    MessageDataPart:
      properties:
        id:
          type: string
          title: Id
        type:
          type: string
          const: data
          title: Type
        data:
          anyOf:
            - {}
            - type: 'null'
          title: Data
        data_ref:
          anyOf:
            - $ref: '#/components/schemas/PublicStoredObjectRef'
            - $ref: '#/components/schemas/StoredObjectRef'
            - type: 'null'
          title: Data Ref
        data_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Data Type
        mime_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Mime Type
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
      type: object
      required:
        - type
      title: MessageDataPart
      description: A structured data part persisted alongside a thread message.
    MessageToolCallPart:
      properties:
        id:
          type: string
          title: Id
        type:
          type: string
          const: tool-call
          title: Type
        tool_name:
          type: string
          title: Tool Name
        tool_call_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Call Id
        args:
          anyOf:
            - {}
            - type: 'null'
          title: Args
        args_ref:
          anyOf:
            - $ref: '#/components/schemas/PublicStoredObjectRef'
            - $ref: '#/components/schemas/StoredObjectRef'
            - type: 'null'
          title: Args Ref
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
      type: object
      required:
        - type
        - tool_name
      title: MessageToolCallPart
      description: A tool-call part persisted alongside a thread message.
    MessageToolErrorPart:
      properties:
        id:
          type: string
          title: Id
        type:
          type: string
          const: tool-error
          title: Type
        tool_name:
          type: string
          title: Tool Name
        tool_call_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Call Id
        input:
          anyOf:
            - {}
            - type: 'null'
          title: Input
        input_ref:
          anyOf:
            - $ref: '#/components/schemas/PublicStoredObjectRef'
            - $ref: '#/components/schemas/StoredObjectRef'
            - type: 'null'
          title: Input Ref
        mime_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Mime Type
        error_text:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Text
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
      type: object
      required:
        - type
        - tool_name
      title: MessageToolErrorPart
      description: A tool-input-error part persisted alongside a thread message.
    MessageToolResultPart:
      properties:
        id:
          type: string
          title: Id
        type:
          type: string
          const: tool-result
          title: Type
        tool_name:
          type: string
          title: Tool Name
        tool_call_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Call Id
        output:
          anyOf:
            - {}
            - type: 'null'
          title: Output
        output_ref:
          anyOf:
            - $ref: '#/components/schemas/PublicStoredObjectRef'
            - $ref: '#/components/schemas/StoredObjectRef'
            - type: 'null'
          title: Output Ref
        mime_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Mime Type
        is_error:
          type: boolean
          title: Is Error
          default: false
        error_text:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Text
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
      type: object
      required:
        - type
        - tool_name
      title: MessageToolResultPart
      description: A tool-result part persisted alongside a thread message.
    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
    PublicStoredObjectRef:
      properties:
        object_id:
          type: string
          title: Object Id
        size_bytes:
          type: integer
          title: Size Bytes
        mime_type:
          type: string
          title: Mime Type
        sha256:
          anyOf:
            - type: string
            - type: 'null'
          title: Sha256
        preview_text:
          anyOf:
            - type: string
            - type: 'null'
          title: Preview Text
        truncated:
          type: boolean
          title: Truncated
          default: false
      type: object
      required:
        - object_id
        - size_bytes
        - mime_type
      title: PublicStoredObjectRef
      description: Client-safe reference to an object stored outside the message row.
    StoredObjectRef:
      properties:
        object_id:
          type: string
          title: Object Id
        path:
          anyOf:
            - type: string
            - type: 'null'
          title: Path
        size_bytes:
          type: integer
          title: Size Bytes
        mime_type:
          type: string
          title: Mime Type
        sha256:
          anyOf:
            - type: string
            - type: 'null'
          title: Sha256
        preview_text:
          anyOf:
            - type: string
            - type: 'null'
          title: Preview Text
        truncated:
          type: boolean
          title: Truncated
          default: false
      type: object
      required:
        - object_id
        - size_bytes
        - mime_type
      title: StoredObjectRef
      description: Reference to an object stored outside the message row.
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      description: Authorization Bearer Token
      in: header
      name: Authorization

````