---
title: "Create an Agent"
method: POST
path: "/api/v1/agents"
tags: ["agents"]
---

# Create an Agent

`POST /api/v1/agents`

## Request

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

Creates an Agent with a caller-assigned ID. Returns 409 if the ID already exists. Creates all four environments unless production_only is set for a FLEET agent. agent_type defaults to CUSTOM. The authenticated user becomes the owner when available. Requires permission to create projects. The response does not include runtime bindings.

## Request body

- AgentplatformAgentCreate
  - `agent_type` 'CUSTOM' | 'CODING'
  - `id` string, required: Unique agent identifier: 1-63 lowercase letters, digits, or hyphens, starting with a letter and ending with a letter or digit.
  - `name` string: Display name. Defaults to the agent ID.
  - `production_only` boolean: ProductionOnly creates only the PRODUCTION environment. It is accepted only when SourceType is FLEET; other sources always get all four environments.
  - `source_type` 'LSD' | 'MDA' | 'EXTERNAL' | 'FLEET', required

## Response `201`

Created

- 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
- `409`: Conflict

## Changes

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

[Operation history](https://skmtc.dev/langchain-ai/apis/langsmith/changes/api/v1/agents/post.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)
