---
title: "Edit agent"
url: "https://developers.bynder.com/apis/agents/versions/f5aecf98-613e-4ae8-b26a-ec2cdf804b2c/operations/editAgent"
---

> Full API specification: https://developers.bynder.com/apis/agents/versions/f5aecf98-613e-4ae8-b26a-ec2cdf804b2c.md

# Edit agent

`PATCH` `/api/1/agent/agents/{id}`

Operation ID: `editAgent`

Partially updates an agent. Only the fields provided in the request body are changed; capabilities cannot be modified after creation. For the `prompt` and `agentProperties` configuration of each capability, see the description of `POST /api/1/agent/agents`.

## Path parameters

- `id` (string, uuid, required)

## Request body (required)

Content types: `application/json`

## Responses

- `200` - Updated agent
- `400` - The request body failed validation
- `401` - Missing or invalid bearer token
- `403` - Caller lacks the required permission for this operation
- `404` - Resource not found
- `429` - Caller exceeded its configured request rate
- `5XX` - Gateway or a downstream service failed to process the request

## OpenAPI definition

```yaml
openapi: 3.0.3
info:
  title: AI Agents
  version: "1.0"
servers:
  - url: https://{your-bynder-domain}/
paths:
  /api/1/agent/agents/{id}:
    patch:
      tags:
        - Agents
      summary: Edit agent
      operationId: editAgent
      description: Partially updates an agent. Only the fields provided in the request
        body are changed; capabilities cannot be modified after creation. For
        the `prompt` and `agentProperties` configuration of each capability, see
        the description of `POST /api/1/agent/agents`.
      parameters:
        - $ref: "#/components/parameters/AgentId"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AgentUpdateRequest"
      responses:
        "200":
          description: Updated agent
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Agent"
        "400":
          $ref: "#/components/responses/ValidationError"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "429":
          $ref: "#/components/responses/TooManyRequests"
        5XX:
          $ref: "#/components/responses/ServerError"
security:
  - bearerAuth: []
components:
  parameters:
    AgentId:
      name: id
      in: path
      required: true
      schema:
        type: string
        format: uuid
  schemas:
    AgentUpdateRequest:
      type: object
      description: Request body for a partial update. All fields are optional.
        Capabilities cannot be changed after the agent is created.
      properties:
        autoApply:
          type: boolean
        name:
          type: string
          maxLength: 50
        description:
          type: string
          maxLength: 130
        status:
          type: string
          enum:
            - ACTIVE
            - INACTIVE
            - DRAFT
        prompt:
          $ref: "#/components/schemas/PromptInput"
        agentProperties:
          type: object
          additionalProperties: true
    Agent:
      type: object
      description: An agent.
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
        description:
          type: string
        prompt:
          $ref: "#/components/schemas/Prompt"
        createdAt:
          type: string
          format: date-time
        modifiedAt:
          type: string
          format: date-time
        accountId:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - ACTIVE
            - INACTIVE
            - DRAFT
        autoApply:
          type: boolean
        autoApplyUserId:
          type: string
          format: uuid
          nullable: true
        agents:
          type: array
          description: The capabilities of the agent.
          items:
            type: string
            enum:
              - ENRICHMENT_AGENT
              - TRANSFORMATION_AGENT
              - BRAND_COMPLIANCE_AGENT
              - GOVERNANCE_AGENT
              - PATH_GENERATOR_AGENT
        agentProperties:
          type: object
          additionalProperties: true
        createdBy:
          type: string
          format: uuid
    PromptInput:
      type: object
      description: The prompt to set on an agent when you create or edit it. Unlike
        the read-only `Prompt` in responses, `id` and `version` are optional
        here.
      required:
        - text
      properties:
        id:
          type: string
          format: uuid
        version:
          type: integer
          format: int32
        text:
          type: string
          maxLength: 10000
    Prompt:
      type: object
      description: An agent prompt.
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        text:
          type: string
        version:
          type: integer
          format: int32
          readOnly: true
        isActive:
          type: boolean
          readOnly: true
        createdAt:
          type: string
          format: date-time
        modifiedAt:
          type: string
          format: date-time
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
  responses:
    ValidationError:
      description: The request body failed validation
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorResponse"
    Unauthorized:
      description: Missing or invalid bearer token
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorResponse"
    Forbidden:
      description: Caller lacks the required permission for this operation
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorResponse"
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorResponse"
    TooManyRequests:
      description: Caller exceeded its configured request rate
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorResponse"
    ServerError:
      description: Gateway or a downstream service failed to process the request
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ErrorResponse"
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
```
