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

# Create thread

> Creates a new thread masquerading as the specified agent



## OpenAPI

````yaml /api_v1.json post /api/v1/puppet/{namespace}/{sessionId}/{agentName}/thread
openapi: 3.1.0
info:
  title: Coral Server API
  version: '1.0'
servers: []
security: []
tags: []
externalDocs:
  url: /
paths:
  /api/v1/puppet/{namespace}/{sessionId}/{agentName}/thread:
    post:
      tags:
        - puppet
      summary: Create thread
      description: Creates a new thread masquerading as the specified agent
      operationId: puppetCreateThread
      parameters:
        - name: namespace
          in: path
          description: The session's namespace
          required: true
          deprecated: false
          explode: false
          schema:
            type: string
            title: String
        - name: sessionId
          in: path
          description: The session's ID
          required: true
          deprecated: false
          explode: false
          schema:
            type: string
            title: String
        - name: agentName
          in: path
          description: The agent's name
          required: true
          deprecated: false
          explode: false
          schema:
            type: string
            title: String
      requestBody:
        description: Thread creation input
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateThreadInput'
        required: false
      responses:
        '200':
          description: Success
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateThreadOutput'
        '404':
          description: Agent not found
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RouteException'
      deprecated: false
      security:
        - token: []
components:
  schemas:
    CreateThreadInput:
      type: object
      properties:
        threadName:
          type: string
          description: >-
            The name of the thread to create, this should be a short summary of
            the intended topic
          title: String
        participantNames:
          type: array
          description: >-
            The list of participants to include in the thread, this should
            include any agent that is expected to be involved in the thread's
            topic.  You do not need to include yourself in this list.
          items:
            type: string
            title: String
          title: ArrayList<String>
      required:
        - participantNames
        - threadName
      title: CreateThreadInput
    CreateThreadOutput:
      type: object
      properties:
        thread:
          $ref: '#/components/schemas/SessionThread'
      required:
        - thread
      title: CreateThreadOutput
    RouteException:
      type: object
      properties:
        message:
          type: string
          title: String
      required:
        - message
      title: RouteException
    SessionThread:
      type: object
      properties:
        id:
          type: string
          title: String
        name:
          type: string
          title: String
        creatorName:
          type: string
          title: String
        participants:
          type: array
          items:
            type: string
            title: String
          title: LinkedHashSet<String>
          uniqueItems: true
        messages:
          type: array
          items:
            $ref: '#/components/schemas/SessionThreadMessage'
          title: ArrayList<SessionThreadMessage>
        state:
          anyOf:
            - type: object
              properties:
                state:
                  type: string
                  enum:
                    - closed
                  title: String
                summary:
                  type: string
                  title: String
                timestamp:
                  type: string
                  title: UTC timestamp ISO-8601
              required:
                - state
                - summary
                - timestamp
              title: closed
            - type: object
              properties:
                state:
                  type: string
                  enum:
                    - open
                  title: String
              required:
                - state
              title: open
          discriminator:
            propertyName: state
          title: SessionThreadState
        timestamp:
          type: string
          title: UTC timestamp ISO-8601
      required:
        - creatorName
        - id
        - messages
        - name
        - participants
        - state
        - timestamp
      title: SessionThread
    SessionThreadMessage:
      type: object
      properties:
        id:
          type: string
          title: String
        threadId:
          type: string
          title: String
        text:
          type: string
          title: String
        senderName:
          type: string
          title: String
        mentionNames:
          type: array
          items:
            type: string
            title: String
          title: LinkedHashSet<String>
          uniqueItems: true
        timestamp:
          type: string
          title: UTC timestamp ISO-8601
      required:
        - id
        - mentionNames
        - senderName
        - text
        - threadId
        - timestamp
      title: SessionThreadMessage
  securitySchemes:
    token:
      type: http
      scheme: bearer
      bearerFormat: Configured token

````