---
title: "Patch Chat"
method: PATCH
path: "/v1/agents/{chat_id}"
tags: ["SDK API"]
---

# Patch Chat

`PATCH /v1/agents/{chat_id}`

Patches a chat.

This endpoint allows users to update specific fields of a chat identified by its `chat_id`.

- **chat_id**: The unique identifier of the chat to be patched. This field cannot be updated.
- **request**: A ChatModel object containing the fields to be updated. Only fields that are provided
  will be updated. The ID of the user who owns the chat and the chat's ID cannot be updated.

**Responses:**
- 200: Returns the updated ChatModel.
- 404: If the chat is not found.
- 500: If there is an internal server error.

## Path parameters

- `chat_id` string, required

## Request body

- AgentRequestPartial
  - `id` string, uuid, nullable
  - `user_id` string, nullable
  - `original_chat_id` string, uuid, nullable
  - `title` string, nullable
  - `history` object[], nullable
  - `vars` object, nullable
  - `prompt` string, nullable
  - `public` boolean, nullable
  - `system_prompt` string, nullable
  - `model` string, nullable — Model name must start with one of ['@openai/', '@anthropic/', '@groq/', '@google/', '@togetherai/', '@openrouter/'].
  - `mcp_servers` string[], nullable
  - `tools` string[], nullable — List of tool slugs available to the agent
  - `slug` string, nullable
  - `price_in_cents` integer, nullable
  - `trial_period_in_days` integer, nullable
  - `upsell_description` UpsellDescription
    - `description` string, required
    - `use_cases` string[], required
  - `agent_builder_run_id` string, uuid, nullable

## Response `200`

Agent successfully patched

- AgentModel
  - `id` string, uuid, required
  - `prompt` string, nullable
  - `vars` object, nullable
  - `original_chat_id` string, uuid, nullable
  - `title` string, nullable
  - `history` object[], nullable
  - `public` boolean, nullable
  - `system_prompt` string, nullable
  - `model` string, nullable
  - `mcp_servers` string[], nullable
  - `tools` string[], nullable — List of tool slugs available to the agent
  - `slug` string, nullable
  - `price_in_cents` integer, nullable
  - `trial_period_in_days` integer, nullable
  - `upsell_description` UpsellDescription
    - `description` string, required
    - `use_cases` string[], required
  - `agent_builder_run_id` string, uuid, nullable
  - `count_runs` integer, nullable
  - `user_id` string, required
  - `created_at` string, date-time, nullable
  - `updated_at` string, date-time, nullable
  - `last_ran_at` string, date-time, nullable
  - `user_feedback` 'approved' | 'rejected' | 'pending'

## Other responses

- `400` — Invalid request
- `403` — You don't have permission to access this chat
- `404` — Agent not found
- `422` — Validation Error
- `500` — Internal server error

---

[API](https://skmtc.net/toolhouse/apis/toolhouse-api.md) · [All operations](https://skmtc.net/toolhouse/apis/toolhouse-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/toolhouse/toolhouse-api/versions/6e3bad3564b3/schema)
