---
updatedAt: 2026-04-15T11:43:58.000Z
agentTools:
  projectIndex: https://developers.happeo.com/llms.txt
---

# Continue conversation with tool task update

Updates a tool task and continues the conversation if appropriate. This endpoint:

1. Optionally updates the tool task with provided data (if request body is provided)
2. Checks if the tool task state requires AI continuation (input-required, completed, failed)
3. If the entry is the last entry in the discussion and AI continuation is needed, streams the AI response
4. Otherwise, returns the discussion entry with updated tool task information

This is the preferred endpoint for frontend applications that want to update tool tasks and potentially trigger AI responses.


# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Chat API",
    "version": "1.0",
    "description": "Chat API for managing discussions, entries, tool tasks, and AI conversations with streaming responses."
  },
  "tags": [
    {
      "name": "Chat",
      "description": "Chat system endpoints for managing discussions, entries, and AI conversations"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-universe-auth"
      }
    },
    "schemas": {
      "UpdateToolTaskDTO": {
        "type": "object",
        "required": [
          "state"
        ],
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "submitted",
              "working",
              "input-required",
              "completed",
              "canceled",
              "failed"
            ],
            "description": "New state for the tool task"
          },
          "message": {
            "type": "string",
            "description": "Optional status message"
          },
          "response": {
            "type": "string",
            "description": "Tool execution response (required when state is completed)"
          }
        }
      }
    }
  },
  "paths": {
    "/chats/{discussionId}/tool-tasks/{toolTaskId}": {
      "post": {
        "summary": "Continue conversation with tool task update",
        "description": "Updates a tool task and continues the conversation if appropriate. This endpoint:\n\n1. Optionally updates the tool task with provided data (if request body is provided)\n2. Checks if the tool task state requires AI continuation (input-required, completed, failed)\n3. If the entry is the last entry in the discussion and AI continuation is needed, streams the AI response\n4. Otherwise, returns the discussion entry with updated tool task information\n\nThis is the preferred endpoint for frontend applications that want to update tool tasks and potentially trigger AI responses.\n",
        "tags": [
          "Chat"
        ],
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "discussionId",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The unique identifier of the discussion"
          },
          {
            "in": "path",
            "name": "toolTaskId",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The unique identifier of the tool task"
          },
          {
            "in": "header",
            "name": "x-universe-auth",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "JWT authentication token"
          }
        ],
        "requestBody": {
          "required": false,
          "description": "Optional tool task update data. If not provided, only triggers continuation without updating the task.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateToolTaskDTO"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Discussion entry with tool task processed, returned as NDJSON stream",
            "content": {
              "application/x-ndjson": {
                "schema": {
                  "type": "string",
                  "description": "NDJSON stream containing the discussion entry with tool task in toolTasks array, and potentially AI continuation"
                },
                "examples": {
                  "no_ai_continuation": {
                    "summary": "No AI continuation needed",
                    "description": "When the tool task doesn't trigger AI response or entry is not the last one",
                    "value": "{\"id\":\"entry-123\",\"role\":\"model\",\"toolName\":\"fetch_user_data\",\"toolTaskIds\":[\"task-456\"],\"toolTasks\":[{\"id\":\"task-456\",\"name\":\"fetch_user_data\",\"status\":{\"state\":\"completed\",\"message\":\"Data fetched\"},\"_links\":{\"self\":\"/chats/disc-123/tool-tasks/task-456\"}}]}\n"
                  },
                  "ai_continuation": {
                    "summary": "AI continuation triggered",
                    "description": "When the tool task update triggers an AI response continuation",
                    "value": "{\"id\":\"entry-456\",\"role\":\"tool\",\"toolResponse\":\"{\\\"name\\\":\\\"fetch_user_data\\\",\\\"response\\\":{\\\"state\\\":\\\"completed\\\",\\\"message\\\":\\\"Data fetched successfully\\\"}}\",\"timestamp\":1694123456789}\n{\"role\":\"model\",\"content\":\"Based on the fetched data, I can see that...\",\"streaming\":true}\n"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - validation failed, tool task not connected to entry, or other error"
          },
          "401": {
            "description": "Unauthorized - invalid or missing authentication"
          },
          "404": {
            "description": "Discussion, entry, or tool task not found"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    }
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ]
}
```