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

# Update an agent

> Updates an existing agent with the provided data. Supports partial updates.



## OpenAPI

````yaml PATCH /v1/agents/{agentId}
openapi: 3.0.0
info:
  title: Devic.ai Public API
  description: >-
    Devic.ai is an AI platform that allows you to create, manage, and use AI
    agents for various tasks.
  version: 1.0.0
  contact:
    name: Devic.ai Support
    url: https://devic.ai
  x-logo:
    url: https://devic.ai/logo.png
    altText: Devic.ai Logo
  x-summary: Public API for interacting with Devic.ai platform
servers:
  - url: https://api.devic.ai
    description: Production server
  - url: https://staging-api.devic.ai
    description: Staging server
security:
  - bearerAuth: []
tags:
  - name: Projects
    description: Group agents, assistants, documents and costs into projects
  - name: Documents
    description: >-
      Knowledge base documents: create, version, attach and index markdown
      content for RAG
  - name: Document Folders
    description: Organise knowledge base documents into folders and attach them in bulk
  - name: Files
    description: Upload files and obtain shareable download URLs to attach to messages
  - name: Agents
    description: Endpoints related to AI agents and their operations
  - name: Assistants
    description: Endpoints for interacting with assistants and their specializations
  - name: Tool Servers
    description: Endpoints for managing tool servers and their tool definitions
  - name: Health
    description: API health check endpoints
  - name: Documentation
    description: Endpoints for retrieving markdown documentation
paths:
  /v1/agents/{agentId}:
    patch:
      tags:
        - Agents
      summary: Update an agent
      description: >-
        Updates an existing agent with the provided data. Supports partial
        updates.
      operationId: updateAgent
      parameters:
        - name: agentId
          in: path
          required: true
          description: The unique identifier of the agent to update
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAgentRequest'
      responses:
        '200':
          description: Agent updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentResponse'
        '400':
          description: Invalid request data
        '401':
          description: Unauthorized - Invalid or missing token
        '404':
          description: Agent not found
        '500':
          description: Internal Server Error
      security:
        - bearerAuth: []
components:
  schemas:
    UpdateAgentRequest:
      type: object
      properties:
        name:
          type: string
          description: Agent name
        description:
          type: string
          description: Agent description
        imgUrl:
          type: string
          description: Image URL for the agent
        assistantSpecialization:
          $ref: '#/components/schemas/AssistantSpecializationConfig'
        disabled:
          type: boolean
          description: Whether the agent is disabled
        archived:
          type: boolean
          description: Whether the agent is archived
        provider:
          type: string
          description: LLM provider override
        llm:
          type: string
          description: LLM model name override
        maxExecutionInputTokens:
          type: integer
          description: Maximum input tokens per execution
        maxExecutionToolCalls:
          type: integer
          description: Maximum tool calls per execution
        agentNotificationConfig:
          type: object
          properties:
            enabled:
              type: boolean
            enableEmailNotification:
              type: boolean
            notifiedEmails:
              type: array
              items:
                type: string
            approvalEmails:
              type: array
              items:
                type: string
        evaluationConfig:
          type: object
          properties:
            enabled:
              type: boolean
            customCriteria:
              type: array
              items:
                type: object
            disableDefaultEvaluation:
              type: boolean
    AgentResponse:
      type: object
      properties:
        _id:
          type: string
          description: Agent ID
        name:
          type: string
          description: Agent name
        description:
          type: string
          description: Agent description
        imgUrl:
          type: string
          description: Image URL
        disabled:
          type: boolean
          description: Whether the agent is disabled
        archived:
          type: boolean
          description: Whether the agent is archived
        provider:
          type: string
          description: LLM provider
        llm:
          type: string
          description: LLM model name
        assistantSpecialization:
          $ref: '#/components/schemas/AssistantSpecializationConfig'
        creationTimestampMs:
          type: integer
          description: Creation timestamp in milliseconds
        lastEditTimestampMs:
          type: integer
          description: Last edit timestamp in milliseconds
        maxExecutionInputTokens:
          type: integer
          description: Maximum input tokens per execution
        maxExecutionToolCalls:
          type: integer
          description: Maximum tool calls per execution
        agentNotificationConfig:
          type: object
          additionalProperties: true
        evaluationConfig:
          type: object
          additionalProperties: true
    AssistantSpecializationConfig:
      type: object
      description: Configuration for the assistant specialization
      properties:
        identifier:
          type: string
          description: Unique identifier for the specialization
        name:
          type: string
          description: Display name
        description:
          type: string
          description: Description
        presets:
          type: string
          description: System prompt / instructions
        availableToolsGroupsUids:
          type: array
          items:
            type: string
          description: Tool group UIDs the agent can use
        enabledTools:
          type: array
          items:
            type: string
          description: Explicit subset of enabled tool names
        model:
          type: string
          description: Default LLM model
        provider:
          type: string
          description: Default LLM provider
        imgUrl:
          type: string
          description: Image URL for the assistant
        codeSnippetIds:
          type: array
          items:
            type: string
          description: Code snippet IDs available to the agent
        availableSkillIds:
          type: array
          items:
            type: string
          description: Skill IDs the agent can mount
        subagentsIds:
          type: array
          items:
            type: string
          description: Subagent IDs the agent can invoke
        maxChatMessages:
          type: integer
          description: Maximum number of chat messages to include in context
        maxToolResponseInputTokens:
          type: integer
          description: Maximum input tokens for tool responses
        contextManagement:
          type: object
          properties:
            fullContextTurnDepth:
              type: integer
              description: >-
                Number of most-recent turns sent to the model in full; older
                turns are replaced by their summary. 0 or omitted disables
                compression.
            alwaysIncludeUserMessages:
              type: boolean
              description: >-
                When true, user messages are always sent in full regardless of
                depth.
          description: >-
            Context depth control: summarize older turns to reduce the token
            footprint sent to the model.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Use JWT token for authentication

````