> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kubiya.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Agent

> Update an agent



## OpenAPI

````yaml https://control-plane.kubiya.ai/api/openapi.json patch /api/v1/agents/{agent_id}
openapi: 3.1.0
info:
  title: Agent Control Plane API
  description: Multi-tenant agent orchestration with Temporal workflows
  version: 1.0.0
servers: []
security:
  - BearerAuth: []
tags:
  - name: health
    description: 🏥 **Health & Status** - Check API health and availability
  - name: authentication
    description: 🔐 **Authentication** - Token validation and auth management
  - name: agents
    description: 🤖 **Agents** - Create and manage AI agents with custom capabilities
  - name: skills
    description: 🛠️ **Tool Sets** - Manage agent skills and tool configurations
  - name: integrations
    description: 🔌 **Integrations** - Connect to external services (Kubiya managed)
  - name: custom-integrations
    description: >-
      ⚙️ **Custom Integrations** - User-defined integration instances with env
      vars, secrets, and files
  - name: integration-templates
    description: >-
      📦 **Integration Templates** - Pre-configured templates for common
      services (PostgreSQL, Redis, MongoDB, etc.)
  - name: secrets
    description: 🔑 **Secrets** - Secure credential storage and retrieval
  - name: teams
    description: 👥 **Teams** - Team management and collaboration
  - name: workflows
    description: 📊 **Workflows** - Multi-step automation and orchestration
  - name: executions
    description: ▶️ **Executions** - Track and monitor workflow runs
  - name: jobs
    description: ⏰ **Jobs** - Scheduled and webhook-triggered tasks
  - name: policies
    description: 🛡️ **Policies** - Access control and security policies
  - name: analytics
    description: 📈 **Analytics** - Usage metrics and performance monitoring
  - name: projects
    description: 📁 **Projects** - Project organization and management
  - name: environments
    description: 🌍 **Environments** - Environment configuration (dev, staging, prod)
  - name: models
    description: 🧠 **Models** - LLM model configuration and management
  - name: runtimes
    description: ⚡ **Runtimes** - Agent execution runtime environments
  - name: workers
    description: 👷 **Workers** - Worker registration and heartbeat monitoring
  - name: storage
    description: 💾 **Storage** - File storage and cloud integration
  - name: context-graph
    description: 🕸️ **Context Graph** - Knowledge graph and context management
  - name: temporal-workflows
    description: >-
      ⚙️ **Temporal Workflows** - Background workflows for context graph
      ingestion, connector operations, and scheduled jobs
  - name: templates
    description: 📝 **Templates** - Reusable configuration templates
paths:
  /api/v1/agents/{agent_id}:
    patch:
      summary: Update Agent
      description: Update an agent
      operationId: update_agent_api_v1_agents__agent_id__patch
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AgentUpdate:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        system_prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: System Prompt
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        capabilities:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          title: Capabilities
        configuration:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Configuration
        state:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: State
        model_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Model Id
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
        llm_config:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Llm Config
        runtime:
          anyOf:
            - type: string
            - type: 'null'
          title: Runtime
        runner_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Runner Name
        team_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Team Id
        environment_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Environment Ids
        skill_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Skill Ids
        skill_configurations:
          anyOf:
            - additionalProperties:
                additionalProperties: true
                type: object
              type: object
            - type: 'null'
          title: Skill Configurations
        execution_environment:
          anyOf:
            - $ref: '#/components/schemas/ExecutionEnvironment'
            - type: 'null'
      type: object
      title: AgentUpdate
    AgentResponse:
      properties:
        id:
          type: string
          title: Id
        organization_id:
          type: string
          title: Organization Id
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        system_prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: System Prompt
        status:
          type: string
          title: Status
        capabilities:
          items: {}
          type: array
          title: Capabilities
        configuration:
          additionalProperties: true
          type: object
          title: Configuration
        model_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Model Id
        llm_config:
          additionalProperties: true
          type: object
          title: Llm Config
        runtime:
          anyOf:
            - type: string
            - type: 'null'
          title: Runtime
        runner_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Runner Name
        team_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Team Id
        created_at:
          type: string
          title: Created At
        updated_at:
          type: string
          title: Updated At
        last_active_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Active At
        state:
          additionalProperties: true
          type: object
          title: State
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
        projects:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Projects
          description: Projects this agent belongs to
        environments:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Environments
          description: Environments this agent is deployed to
        skill_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Skill Ids
          description: IDs of associated skills
        skills:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Skills
          description: Associated skills with details
        execution_environment:
          anyOf:
            - $ref: '#/components/schemas/ExecutionEnvironment'
            - type: 'null'
      type: object
      required:
        - id
        - organization_id
        - name
        - description
        - system_prompt
        - status
        - capabilities
        - configuration
        - model_id
        - llm_config
        - runtime
        - runner_name
        - team_id
        - created_at
        - updated_at
        - last_active_at
        - state
        - error_message
      title: AgentResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ExecutionEnvironment:
      properties:
        working_dir:
          anyOf:
            - type: string
            - type: 'null'
          title: Working Dir
          description: Working directory for execution (overrides default workspace)
        env_vars:
          additionalProperties:
            type: string
          type: object
          title: Env Vars
          description: Environment variables (key-value pairs)
        secrets:
          items:
            type: string
          type: array
          title: Secrets
          description: Secret names from Kubiya vault
        integration_ids:
          items:
            type: string
          type: array
          title: Integration Ids
          description: Integration UUIDs for delegated credentials
        mcp_servers:
          additionalProperties:
            $ref: '#/components/schemas/MCPServerConfig'
          type: object
          title: Mcp Servers
          description: >-
            MCP (Model Context Protocol) server configurations. Supports stdio,
            HTTP, and SSE transports.
      type: object
      title: ExecutionEnvironment
      description: Execution environment configuration for agents/teams
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    MCPServerConfig:
      properties:
        command:
          anyOf:
            - type: string
            - type: 'null'
          title: Command
          description: Command for stdio transport (mutually exclusive with url/type)
        args:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Args
          description: Arguments for stdio transport
        env:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Env
          description: Environment variables (used by both stdio and HTTP transports)
        transport_type:
          anyOf:
            - type: string
              enum:
                - http
                - sse
            - type: 'null'
          title: Transport Type
          description: Transport type for HTTP/SSE (mutually exclusive with command)
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
          description: URL for HTTP/SSE transport (mutually exclusive with command)
        headers:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Headers
          description: HTTP headers for HTTP/SSE transport
      type: object
      title: MCPServerConfig
      description: >-
        Unified MCP server configuration supporting multiple transport types.


        This schema uses discriminated union based on the presence of 'command'
        or 'type' field:

        - If 'command' is present: stdio transport

        - If 'type' is present: HTTP/SSE transport


        The configuration is validated to ensure only one transport type is
        specified.
      examples:
        - args:
            - '-m'
            - mcp_server_filesystem
          command: python
          env:
            ALLOWED_PATHS: '{{.env.PROJECT_ROOT}}'
        - headers:
            Authorization: Bearer {{.secret.token}}
          type: sse
          url: https://api.example.com/mcp
        - headers:
            Authorization: Bearer {{.secret.token}}
          transport_type: sse
          url: https://api.example.com/mcp
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Enter your Kubiya API token (format: Bearer <token>)'

````