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

# Update an agent

> Updates an existing agent in the requested workspace.



## OpenAPI

````yaml /openapi.yaml patch /v1/public/workspaces/{workspace_id}/agents/{id}
openapi: 3.0.1
info:
  title: Fetch Hive Public API
  version: v1
  description: Customer-facing Fetch Hive API endpoints for public API keys.
servers:
  - url: https://api.fetchhive.com
security: []
paths:
  /v1/public/workspaces/{workspace_id}/agents/{id}:
    parameters:
      - name: workspace_id
        in: path
        required: true
        description: Workspace UUID
        schema:
          type: string
          format: uuid
      - name: id
        in: path
        required: true
        description: Agent UUID
        schema:
          type: string
          format: uuid
    patch:
      tags:
        - Agents
      summary: Update an agent
      description: Updates an existing agent in the requested workspace.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                agent:
                  type: object
                  properties:
                    name:
                      type: string
                      example: Updated Agent
                    llm_model:
                      type: string
                      example: gpt-4.1-mini
                    model_type:
                      type: string
                      example: hosted
                    description:
                      type: string
                      example: A helpful assistant
                    instruction_prompt:
                      type: string
                      example: You are a helpful assistant
                    temperature:
                      type: number
                      example: 0.7
                    max_token:
                      type: integer
                      example: 1000
                    max_thinking_token:
                      type: integer
                      example: 1024
                    anthropic_prompt_cache_ttl:
                      type: string
                      enum:
                        - disabled
                        - 5m
                        - 1h
                    reasoning_effort:
                      type: string
                      enum:
                        - low
                        - medium
                        - high
                        - minimal
                        - xhigh
                        - max
                    tool_choice:
                      type: string
                      enum:
                        - none
                        - auto
                        - required
              required:
                - agent
        required: true
      responses:
        '200':
          description: agent updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Successfully updated an agent.
                  agent:
                    type: object
                required:
                  - message
                  - agent
        '401':
          description: unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_response'
        '404':
          description: workspace not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_response'
        '422':
          description: agent not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Agent not found.
                required:
                  - error
      security:
        - bearer_auth: []
components:
  schemas:
    error_response:
      type: object
      properties:
        error:
          type: string
          example: Invalid access.
      required:
        - error
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      description: 'Workspace API key sent as `Authorization: Bearer <api_key>`.'

````