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

# Update Agent



## OpenAPI

````yaml patch /api/v1/agents/{agent_id}
openapi: 3.1.0
info:
  title: AskUI Workspaces API
  version: 0.2.15
servers: []
security: []
paths:
  /api/v1/agents/{agent_id}:
    patch:
      tags:
        - agents
      summary: Update Agent
      operationId: update_agent_api_v1_agents__agent_id__patch
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            title: Agent Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentUpdateCommand'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agent'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - Bearer: []
        - Basic: []
components:
  schemas:
    AgentUpdateCommand:
      properties:
        name:
          anyOf:
            - type: string
              pattern: ^[a-zA-Z0-9]([a-zA-Z0-9-_. ]{0,62}[a-zA-Z0-9])?$
              description: >-
                The name of the agent. The name must only contain the following
                characters: a-z, A-Z, 0-9, -, _, and space. The name must not be
                empty. The name must start and end with a letter or a number.
                The name must not be longer than 64 characters.
            - type: 'null'
          title: Name
        description:
          anyOf:
            - type: string
              maxLength: 1024
              default: ''
            - type: 'null'
          title: Description
        status:
          anyOf:
            - type: string
              enum:
                - ACTIVE
                - ARCHIVED
            - type: 'null'
          title: Status
        emailTrigger:
          anyOf:
            - $ref: '#/components/schemas/EmailAgentTriggerUpdate'
            - type: 'null'
        autoConfirm:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Autoconfirm
      type: object
      title: AgentUpdateCommand
    Agent:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
        createdAt:
          type: string
          format: date-time
          title: Createdat
        updatedAt:
          type: string
          format: date-time
          title: Updatedat
        name:
          type: string
          pattern: ^[a-zA-Z0-9]([a-zA-Z0-9-_. ]{0,62}[a-zA-Z0-9])?$
          title: Name
          description: >-
            The name of the agent. The name must only contain the following
            characters: a-z, A-Z, 0-9, -, _, and space. The name must not be
            empty. The name must start and end with a letter or a number. The
            name must not be longer than 64 characters.
        status:
          type: string
          enum:
            - ACTIVE
            - ARCHIVED
          title: Status
        autoConfirm:
          type: boolean
          title: Autoconfirm
          description: >-
            If true, the agent will automatically confirm the data extracted,
            i.e., no review is necessary.
        description:
          type: string
          maxLength: 1024
          title: Description
          default: ''
        emailTrigger:
          $ref: '#/components/schemas/EmailAgentTrigger'
        dataSchema:
          anyOf:
            - $ref: '#/components/schemas/JsonSchema'
            - type: 'null'
          description: |2-

                        The data schema describes the data to extract in form of a [JSON schema draft 2020-12](https://json-schema.org/draft/2020-12/release-notes). Use the ["description" keyword](https://json-schema.org/understanding-json-schema/reference/annotations) of each property to provide additional information about the field, e.g., the prompt for extraction from sources. 
                    
        dataDestinations:
          items:
            oneOf:
              - $ref: '#/components/schemas/DataDestinationAskUiWorkflow'
              - $ref: '#/components/schemas/DataDestinationWebhook'
            discriminator:
              propertyName: type
              mapping:
                ASKUI_WORKFLOW:
                  $ref: '#/components/schemas/DataDestinationAskUiWorkflow'
                WEBHOOK:
                  $ref: '#/components/schemas/DataDestinationWebhook'
          type: array
          title: Datadestinations
        workspaceId:
          type: string
          format: uuid4
          title: Workspaceid
        folderPath:
          anyOf:
            - type: string
            - type: 'null'
          title: Folderpath
      type: object
      required:
        - name
        - status
        - autoConfirm
        - emailTrigger
        - dataDestinations
        - workspaceId
      title: Agent
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    EmailAgentTriggerUpdate:
      properties:
        active:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Active
        allowedSenders:
          anyOf:
            - items:
                type: string
              type: array
              uniqueItems: true
            - type: 'null'
          title: Allowedsenders
        localPart:
          anyOf:
            - type: string
              pattern: ^[a-zA-Z0-9-_.+]+$
            - type: 'null'
          title: Localpart
      type: object
      title: EmailAgentTriggerUpdate
    EmailAgentTrigger:
      properties:
        active:
          type: boolean
          title: Active
          description: If false, no emails can be send to trigger agent.
          default: true
        allowedSenders:
          items:
            type: string
          type: array
          uniqueItems: true
          title: Allowedsenders
          description: >-
            The email addresses that are allowed to send emails to trigger the
            agent. If empty, no emails can be send to trigger agent.
        email:
          type: string
          pattern: ^[a-zA-Z0-9-_.+]+@.*$
          title: Email
          description: >-
            The email address of the agent to send emails to to trigger the
            agent. The email address must be unique for each agent. The domain
            of the email address is fixed. The local part of the email address
            must be between 1 and 64 characters long and can only contain the
            following characters: a-z, A-Z, 0-9, -, _, . and +.
      type: object
      required:
        - email
      title: EmailAgentTrigger
    JsonSchema:
      properties:
        title:
          type: string
          pattern: ^[a-zA-Z0-9_-]+$
          title: Title
          default: DataToExtract
        description:
          type: string
          title: Description
          default: ''
        type:
          type: string
          const: object
          title: Type
          default: object
        properties:
          additionalProperties:
            additionalProperties: true
            type: object
          type: object
          minProperties: 1
          title: Properties
        required:
          items:
            type: string
          type: array
          title: Required
      type: object
      required:
        - properties
      title: JsonSchema
    DataDestinationAskUiWorkflow:
      properties:
        type:
          type: string
          const: ASKUI_WORKFLOW
          title: Type
          default: ASKUI_WORKFLOW
        host:
          $ref: '#/components/schemas/AskUiRunnerHost'
        runnerTags:
          items:
            type: string
          type: array
          title: Runnertags
        workflows:
          items:
            type: string
          type: array
          minItems: 1
          title: Workflows
      type: object
      required:
        - host
        - runnerTags
        - workflows
      title: DataDestinationAskUiWorkflow
    DataDestinationWebhook:
      properties:
        type:
          type: string
          const: WEBHOOK
          title: Type
          default: WEBHOOK
        url:
          type: string
          maxLength: 2083
          minLength: 1
          format: uri
          title: Url
        headers:
          additionalProperties:
            type: string
          type: object
          title: Headers
      type: object
      required:
        - url
        - headers
      title: DataDestinationWebhook
    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
    AskUiRunnerHost:
      type: string
      enum:
        - SELF
        - ASKUI
      title: AskUiRunnerHost
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
    Basic:
      type: apiKey
      in: header
      name: Authorization

````