Seekr Threads API

The Threads API from Seekr — 4 operation(s) for threads.

OpenAPI Specification

seekr-threads-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: SeekrFlow Threads 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.45.1
servers:
- url: https://flow.seekr.com
  description: SeekrBuild server base URL
tags:
- name: Threads
paths:
  /v1/threads/{thread_id}/messages:
    get:
      tags:
      - Threads
      summary: List Messages Endpoint
      description: List messages in a thread with pagination.
      operationId: list_messages_endpoint_v1_threads__thread_id__messages_get
      security:
      - APIKeyHeader: []
      parameters:
      - name: thread_id
        in: path
        required: true
        schema:
          type: string
          title: Thread Id
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          minimum: 0
          default: 20
          title: Limit
      - name: order
        in: query
        required: false
        schema:
          $ref: '#/components/schemas/OrderEnum'
          default: desc
      - name: offset
        in: query
        required: false
        schema:
          type: integer
          minimum: 0
          default: 0
          title: Offset
      - name: include_parts
        in: query
        required: false
        schema:
          type: boolean
          default: false
          title: Include Parts
      - name: expand_part_payloads
        in: query
        required: false
        schema:
          type: boolean
          default: false
          title: Expand Part Payloads
      - name: x-team-id
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Team-Id
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ThreadMessageResponse'
                title: Response List Messages Endpoint V1 Threads  Thread Id  Messages Get
        '422':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
      - Threads
      summary: Create Message Endpoint
      description: 'Create a new message in a thread.


        Message should contain role, content, and optional meta_data.'
      operationId: create_message_endpoint_v1_threads__thread_id__messages_post
      security:
      - APIKeyHeader: []
      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: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThreadMessageResponse'
        '422':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/threads:
    post:
      tags:
      - Threads
      summary: Create Thread Endpoint
      description: 'Create a new thread.


        Takes optional meta_data in the request body.'
      operationId: create_thread_endpoint_v1_threads_post
      security:
      - APIKeyHeader: []
      parameters:
      - 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/ThreadCreateRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Thread'
        '422':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
      - Threads
      summary: List Threads Endpoint
      description: List all threads.
      operationId: list_threads_endpoint_v1_threads_get
      security:
      - APIKeyHeader: []
      parameters:
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          minimum: 0
          default: 20
          title: Limit
      - name: order
        in: query
        required: false
        schema:
          $ref: '#/components/schemas/OrderEnum'
          default: desc
      - name: offset
        in: query
        required: false
        schema:
          type: integer
          minimum: 0
          default: 0
          title: Offset
      - name: x-team-id
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Team-Id
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Thread'
                title: Response List Threads Endpoint V1 Threads Get
        '422':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/threads/{thread_id}:
    delete:
      tags:
      - Threads
      summary: Delete Thread Endpoint
      description: 'Delete a thread by ID.


        Returns {''deleted'': True} if successful, or raises 422 if not found.'
      operationId: delete_thread_endpoint_v1_threads__thread_id__delete
      security:
      - APIKeyHeader: []
      parameters:
      - name: thread_id
        in: path
        required: true
        schema:
          type: string
          title: Thread Id
      - name: x-team-id
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Team-Id
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Delete Thread Endpoint V1 Threads  Thread Id  Delete
        '422':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
      - Threads
      summary: Get Thread Endpoint
      description: Get a thread by ID.
      operationId: get_thread_endpoint_v1_threads__thread_id__get
      security:
      - APIKeyHeader: []
      parameters:
      - name: thread_id
        in: path
        required: true
        schema:
          type: string
          title: Thread Id
      - name: x-team-id
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Team-Id
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Thread'
        '422':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/threads/{thread_id}/messages/{message_id}:
    patch:
      tags:
      - Threads
      summary: Update Message Endpoint
      description: 'Update a message''s content and/or metadata.


        Request body can contain optional content and meta_data fields.'
      operationId: update_message_endpoint_v1_threads__thread_id__messages__message_id__patch
      security:
      - APIKeyHeader: []
      parameters:
      - name: thread_id
        in: path
        required: true
        schema:
          type: string
          title: Thread Id
      - name: message_id
        in: path
        required: true
        schema:
          type: string
          title: Message 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/MessageUpdateRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThreadMessageResponse'
        '422':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
      - Threads
      summary: Get Message Endpoint
      description: Get a message by ID.
      operationId: get_message_endpoint_v1_threads__thread_id__messages__message_id__get
      security:
      - APIKeyHeader: []
      parameters:
      - name: thread_id
        in: path
        required: true
        schema:
          type: string
          title: Thread Id
      - name: message_id
        in: path
        required: true
        schema:
          type: string
          title: Message Id
      - name: include_parts
        in: query
        required: false
        schema:
          type: boolean
          default: false
          title: Include Parts
      - name: expand_part_payloads
        in: query
        required: false
        schema:
          type: boolean
          default: false
          title: Expand Part Payloads
      - name: x-team-id
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Team-Id
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThreadMessageResponse'
        '422':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - Threads
      summary: Delete Message Endpoint
      description: 'Delete a message by ID.


        Returns {''deleted'': True} if successful, or raises 422 if not found.'
      operationId: delete_message_endpoint_v1_threads__thread_id__messages__message_id__delete
      security:
      - APIKeyHeader: []
      parameters:
      - name: thread_id
        in: path
        required: true
        schema:
          type: string
          title: Thread Id
      - name: message_id
        in: path
        required: true
        schema:
          type: string
          title: Message Id
      - name: x-team-id
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: X-Team-Id
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Delete Message Endpoint V1 Threads  Thread Id  Messages  Message Id  Delete
        '422':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    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.
    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.
    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.
    Thread:
      properties:
        id:
          type: string
          title: Id
        object:
          type: string
          title: Object
          default: thread
        created_at:
          type: string
          format: date-time
          title: Created At
        status:
          $ref: '#/components/schemas/ThreadStatus'
          default: available
        active_run_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Active Run Id
        meta_data:
          additionalProperties: true
          type: object
          title: Meta Data
      type: object
      required:
      - id
      - created_at
      title: Thread
      description: 'A thread is a top-level conversation container.


        Threads can contain multiple messages from various assistants and users,

        providing a complete history of an interaction sequence.'
    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.
    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.
    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.
    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.
    ThreadMessageRequest:
      properties:
        role:
          type: string
          enum:
          - user
          - system
          - tool
          - developer
          - assistant
          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: '#/components/schemas/InputFile'
                  input_image: '#/components/schemas/InputImage'
                  input_text: '#/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.\n\nAttributes:\n    role (str): The role of the message sender.\n    content (Union[str, list[InputMessage], list[OutputMessage]]): The content of the message.\n    meta_data (Optional[dict[str, Any]]): Optional metadata dictionary."
    MessageUpdateRequest:
      properties:
        content:
          anyOf:
          - type: string
          - items:
              oneOf:
              - $ref: '#/components/schemas/InputText'
              - $ref: '#/components/schemas/InputImage'
              - $ref: '#/components/schemas/InputFile'
              discriminator:
                propertyName: type
                mapping:
                  input_file: '#/components/schemas/InputFile'
                  input_image: '#/components/schemas/InputImage'
                  input_text: '#/components/schemas/InputText'
            type: array
          - items:
              oneOf:
              - $ref: '#/components/schemas/OutputText'
              - $ref: '#/components/schemas/OutputGuardrail'
              discriminator:
                propertyName: type
                mapping:
                  output_guardrail: '#/components/schemas/OutputGuardrail'
                  output_text: '#/components/schemas/OutputText'
            type: array
          - type: 'null'
          title: Content
        meta_data:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Meta Data
      additionalProperties: false
      type: object
      title: MessageUpdateRequest
      description: "Pydantic model for updating a message request.\n\nAttributes:\n    content (Optional[str]): Optional content of the message.\n    meta_data (Optional[dict[str, Any]]): Optional metadata dictionary."
    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.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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.
    ThreadStatus:
      type: string
      enum:
      - available
      - locked
      title: ThreadStatus
      description: Available status for a thread.
    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.
    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.
    OrderEnum:
      type: string
      enum:
      - asc
      - desc
      title: OrderEnum
      description: Options for order query param in list endpoints.
    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.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    ThreadCreateRequest:
      properties:
        meta_data:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Meta Data
      type: object
      title: ThreadCreateRequest
      description: "Pydantic model for creating a thread request.\n\nAttributes:\n    meta_data (Optional[dict[str, Any]]): Optional metadata dictionary."
    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.
    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: '#/components/schemas/InputFile'
                  input_image: '#/components/schemas/InputImage'
                  input_text: '#/components/schemas/InputText'
            type: array
          - items:
              oneOf:
              - $ref: '#/components/schemas/OutputText'
              - $ref: '#/components/schemas/OutputGuardrail'
              discriminator:
                propertyName: type
                mapping:
                  output_guardrail: '#/components/schemas/OutputGuardrail'
                  output_text: '#/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: '#/components/schemas/MessageDataPart'
                  file: '#/components/schemas/MessageFilePart'
                  reasoning: '#/components/schemas/MessageReasoningPart'
                  text: '#/components/schemas/MessageTextPart'
                  tool-call: '#/components/schemas/MessageToolCallPart'
                  tool-error: '#/components/schemas/MessageToolErrorPart'
                  tool-result: '#/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.'
    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.
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      description: Your Seekr API key, sent in the Authorization header with no 'Bearer' prefix.
      in: header
      name: Authorization