Skip to main content
POST
/
agents
Create an agent
curl --request POST \
  --url https://api.smith.langchain.com/v1/deepagents/agents \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --data '
{
  "name": "research-assistant",
  "description": "Research assistant that can search the web and summarize sources.",
  "permissions": {
    "identity": "personal",
    "visibility": "user"
  },
  "runtime": {
    "model": {
      "model_id": "claude-sonnet-4-6"
    }
  },
  "instructions": "You are a careful research assistant. Search for sources, keep notes, and return concise answers with citations.",
  "tools": {
    "tools": [
      {
        "name": "tavily_web_search",
        "mcp_server_url": "https://tools.langchain.com",
        "mcp_server_name": "Fleet",
        "display_name": "tavily_web_search"
      }
    ],
    "interrupt_config": {
      "https://tools.langchain.com::tavily_web_search::Fleet": true
    }
  }
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "description": "<string>",
  "owner_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "permissions": {
    "identity": "personal",
    "visibility": "tenant",
    "tenant_access_level": "read",
    "shared_users": {
      "read": [
        "<string>"
      ],
      "run": [
        "<string>"
      ],
      "update": [
        "<string>"
      ]
    }
  },
  "runtime": {
    "model": {
      "model_id": "claude-sonnet-4-6"
    }
  },
  "extras": {},
  "revision": "<string>",
  "instructions": "<string>",
  "tools": {
    "tools": [
      {
        "name": "<string>",
        "mcp_server_url": "<string>",
        "mcp_server_name": "<string>",
        "display_name": "<string>"
      }
    ],
    "interrupt_config": {}
  },
  "subagents": [
    {
      "name": "<string>",
      "description": "<string>",
      "model_id": "<string>",
      "instructions": "<string>",
      "tools": {
        "tools": [
          {
            "name": "<string>",
            "mcp_server_url": "<string>",
            "mcp_server_name": "<string>",
            "display_name": "<string>"
          }
        ],
        "interrupt_config": {}
      }
    }
  ],
  "skills": [
    {
      "type": "inline",
      "name": "<string>",
      "description": "<string>",
      "instructions": "<string>",
      "files": {}
    }
  ],
  "files": {}
}

Documentation Index

Fetch the complete documentation index at: https://docs.langchain.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

X-Api-Key
string
header
default:LANGSMITH_API_KEY
required

Headers

X-User-Timezone
string

User timezone for runtime configuration stamping. Defaults to UTC when omitted.

Example:

"America/Los_Angeles"

Query Parameters

include_files
boolean
default:false

Include the raw file map in the agent response. Accepted truthy values are true and 1.

Body

application/json
name
string
required

Human-readable agent name. Must not be blank.

description
string

Short agent description.

permissions
object

Agent visibility and sharing configuration. When omitted on create, defaults to personal identity, tenant visibility, and read tenant access.

runtime
object
instructions
string

Agent system prompt. Written to AGENTS.md.

tools
object
subagents
object[]

Subagents. Each entry is written to subagents/<name>/AGENTS.md and, when provided, subagents/<name>/tools.json.

skills
object[]

Inline skills. Each entry is written to skills/<name>/SKILL.md and supporting files.

extras
object

Caller-defined key-value metadata attached to the agent.

files
object

Raw file map for paths not covered by typed fields. Keys are relative file paths. Setting a typed field and the corresponding files entry returns 422.

Response

Agent created.

id
string<uuid>
name
string
description
string
owner_id
string<uuid>
created_at
string<date-time>
updated_at
string<date-time>
permissions
object

Agent visibility and sharing configuration. When omitted on create, defaults to personal identity, tenant visibility, and read tenant access.

runtime
object
extras
object
revision
string

Revision token for the latest file tree commit.

instructions
string

Agent system prompt parsed from AGENTS.md.

tools
object
subagents
object[]
skills
object[]
files
object

Raw file map for paths not covered by typed fields. Keys are relative file paths. Setting a typed field and the corresponding files entry returns 422.