---
title: "Update an Agent"
method: PATCH
path: "/api/v1/agents/{agent_id}"
tags: ["agents"]
---

# Update an Agent

`PATCH /api/v1/agents/{agent_id}`

## Request

- Base URL: `https://api.smith.langchain.com`
- URL: `https://api.smith.langchain.com/api/v1/agents/{agent_id}`
- Auth: one of:
  - API key in header `X-API-Key`
  - API key in header `X-Tenant-Id`
  - HTTP bearer

Updates an Agent's name, source_type, agent_type, or owner_id. Omitted fields keep their values. Changing or clearing owner_id additionally requires workspaces:manage; assigning an owner also requires workspaces:read and active workspace membership. Fleet ownership cannot be changed through this endpoint. Changing agent_type requires workspaces:manage in addition to project update access; repeating the current type is a no-op. Source type can change only for an EXTERNAL Agent without runtime bindings. The id is immutable and is rejected when present. Requires update permission on every environment project.

## Path parameters

- `agent_id` string, required

## Request body

- AgentplatformAgentUpdate
  - `agent_type` 'CUSTOM' | 'CODING'
  - `name` string: New display name. Omit to keep the current name.
  - `owner_id` string, uuid, nullable: Omit to leave the owner unchanged; null clears it.
  - `source_type` 'LSD' | 'MDA' | 'EXTERNAL' | 'FLEET'

## Response `200`

OK

- AgentplatformAgent
  - `agent_type` 'CUSTOM' | 'CODING', required
  - `avatar_url` string, nullable: AvatarURL is a short-lived URL for the agent avatar, when present.
  - `created_at` string, date-time, required
  - `environments` AgentplatformAgentEnvironment[], required
    - `agent_id` string, required
    - `environment` 'LOCAL' | 'DEVELOPMENT' | 'STAGING' | 'PRODUCTION', required
    - `id` string, uuid, required
    - `runtime_bindings` AgentplatformAgentRuntimeBinding[]
      - `agent_environment_id` string, uuid, required
      - `id` string, uuid, required
      - `source_id` string, required
    - `tracer_session_id` string, uuid, required
    - `tracer_session_name` string, required
  - `id` string, required
  - `name` string, required
  - `owner` string: Owner is the owner's full name, falling back to email when available.
  - `owner_id` string, uuid, nullable
  - `source_type` 'LSD' | 'MDA' | 'EXTERNAL' | 'FLEET', required
  - `tag_key_id` string, uuid, nullable
  - `tag_value_id` string, uuid, nullable

## Other responses

- `400`: Bad Request
- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict

## Changes

- **2026-10-27** `d1aa6d438ff0`: 1 info
  - added the optional property `avatar_url` to the response with the `200` status
- **2026-10-22** `e45f16e950dc`: 3 info
  - added the new optional request property `owner_id`
  - added the optional property `owner` to the response with the `200` status
  - added the optional property `owner_id` to the response with the `200` status
- **2026-10-21** `016683c2a6e3`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/langchain-ai/apis/langsmith/changes/api/v1/agents/:agent_id/patch.md)

---

[API](https://skmtc.dev/langchain-ai/apis/langsmith.md) - [All operations](https://skmtc.dev/langchain-ai/apis/langsmith/llms.txt) - [OpenAPI document](https://skmtc.dev/langchain-ai/apis/langsmith/revisions/7a01c01f75e8?raw)
