> ## 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 Execution



## OpenAPI

````yaml patch /api/v1/agent-executions/{agent_execution_id}
openapi: 3.1.0
info:
  title: AskUI Workspaces API
  version: 0.2.15
servers: []
security: []
paths:
  /api/v1/agent-executions/{agent_execution_id}:
    patch:
      tags:
        - agent-executions
      summary: Update Agent Execution
      operationId: >-
        update_agent_execution_api_v1_agent_executions__agent_execution_id__patch
      parameters:
        - name: agent_execution_id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            title: Agent Execution Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentExecutionUpdateCommand'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentExecution'
        '400':
          description: Could not deliver data to destination
        '404':
          description: Agent execution not found
        '409':
          description: Agent schema not set
        '422':
          description: Schema validation error
      security:
        - Bearer: []
        - Basic: []
components:
  schemas:
    AgentExecutionUpdateCommand:
      properties:
        state:
          oneOf:
            - $ref: '#/components/schemas/AgentExecutionPendingReview'
            - $ref: '#/components/schemas/AgentExecutionCancel'
            - $ref: '#/components/schemas/AgentExecutionConfirm'
            - $ref: >-
                #/components/schemas/workspaces__use_cases__agent_executions__update_agent_execution__AgentExecutionStateDeliveredToDestination
          title: State
          discriminator:
            propertyName: status
            mapping:
              CANCELED:
                $ref: '#/components/schemas/AgentExecutionCancel'
              CONFIRMED:
                $ref: '#/components/schemas/AgentExecutionConfirm'
              DELIVERED_TO_DESTINATION: >-
                #/components/schemas/AgentExecutionStateDeliveredToDestination-Input
              PENDING_REVIEW:
                $ref: '#/components/schemas/AgentExecutionPendingReview'
      type: object
      required:
        - state
      title: AgentExecutionUpdateCommand
    AgentExecution:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
        createdAt:
          type: string
          format: date-time
          title: Createdat
        updatedAt:
          type: string
          format: date-time
          title: Updatedat
        agentId:
          type: string
          format: uuid4
          title: Agentid
        workspaceId:
          type: string
          format: uuid4
          title: Workspaceid
        state:
          oneOf:
            - $ref: '#/components/schemas/AgentExecutionStatePendingInputs'
            - $ref: '#/components/schemas/AgentExecutionStatePendingDataExtraction'
            - $ref: '#/components/schemas/AgentExecutionStatePendingReview'
            - $ref: '#/components/schemas/AgentExecutionStateCanceled'
            - $ref: '#/components/schemas/AgentExecutionStateConfirmed'
            - $ref: >-
                #/components/schemas/workspaces__domain__entities__AgentExecutionStateDeliveredToDestination
          title: State
          discriminator:
            propertyName: status
            mapping:
              CANCELED:
                $ref: '#/components/schemas/AgentExecutionStateCanceled'
              CONFIRMED:
                $ref: '#/components/schemas/AgentExecutionStateConfirmed'
              DELIVERED_TO_DESTINATION: >-
                #/components/schemas/AgentExecutionStateDeliveredToDestination-Output
              PENDING_DATA_EXTRACTION:
                $ref: '#/components/schemas/AgentExecutionStatePendingDataExtraction'
              PENDING_INPUTS:
                $ref: '#/components/schemas/AgentExecutionStatePendingInputs'
              PENDING_REVIEW:
                $ref: '#/components/schemas/AgentExecutionStatePendingReview'
      type: object
      required:
        - agentId
        - workspaceId
        - state
      title: AgentExecution
    AgentExecutionPendingReview:
      properties:
        status:
          type: string
          const: PENDING_REVIEW
          title: Status
          default: PENDING_REVIEW
        dataExtracted:
          additionalProperties: true
          type: object
          minProperties: 1
          title: Dataextracted
      type: object
      required:
        - dataExtracted
      title: AgentExecutionPendingReview
    AgentExecutionCancel:
      properties:
        status:
          type: string
          const: CANCELED
          title: Status
          default: CANCELED
      type: object
      title: AgentExecutionCancel
    AgentExecutionConfirm:
      properties:
        status:
          type: string
          const: CONFIRMED
          title: Status
          default: CONFIRMED
        dataConfirmed:
          additionalProperties: true
          type: object
          minProperties: 1
          title: Dataconfirmed
      type: object
      required:
        - dataConfirmed
      title: AgentExecutionConfirm
    workspaces__use_cases__agent_executions__update_agent_execution__AgentExecutionStateDeliveredToDestination:
      properties:
        status:
          type: string
          const: DELIVERED_TO_DESTINATION
          title: Status
          default: DELIVERED_TO_DESTINATION
        deliveries:
          items:
            oneOf:
              - $ref: '#/components/schemas/DataDestinationDeliveryAskUiWorkflow'
              - $ref: '#/components/schemas/DataDestinationDeliveryWebhook'
            discriminator:
              propertyName: type
              mapping:
                ASKUI_WORKFLOW:
                  $ref: '#/components/schemas/DataDestinationDeliveryAskUiWorkflow'
                WEBHOOK:
                  $ref: '#/components/schemas/DataDestinationDeliveryWebhook'
          type: array
          title: Deliveries
      type: object
      title: AgentExecutionStateDeliveredToDestination
    AgentExecutionStatePendingInputs:
      properties:
        status:
          type: string
          const: PENDING_INPUTS
          title: Status
          description: >-
            The agent is waiting for inputs, e.g., files to be uploaded. An
            agent may stay in this state in failure cases, e.g., if file upload
            fails.
          default: PENDING_INPUTS
      type: object
      title: AgentExecutionStatePendingInputs
    AgentExecutionStatePendingDataExtraction:
      properties:
        status:
          type: string
          const: PENDING_DATA_EXTRACTION
          title: Status
          description: >-
            The agent has all inputs at hand and is about to or already
            extracting data from inputs. An agent may stay in this state in
            failure cases, e.g., if data extraction fails.
          default: PENDING_DATA_EXTRACTION
      type: object
      title: AgentExecutionStatePendingDataExtraction
    AgentExecutionStatePendingReview:
      properties:
        status:
          type: string
          const: PENDING_REVIEW
          title: Status
          description: >-
            The agent is waiting for the user to review the extracted data. An
            agent may stay if the user never confirms the data or cancels the
            execution.
          default: PENDING_REVIEW
        dataExtracted:
          additionalProperties: true
          type: object
          minProperties: 1
          title: Dataextracted
      type: object
      required:
        - dataExtracted
      title: AgentExecutionStatePendingReview
    AgentExecutionStateCanceled:
      properties:
        status:
          type: string
          const: CANCELED
          title: Status
          description: The agent execution was canceled by the user.
          default: CANCELED
        dataExtracted:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Dataextracted
      type: object
      title: AgentExecutionStateCanceled
    AgentExecutionStateConfirmed:
      properties:
        status:
          type: string
          const: CONFIRMED
          title: Status
          description: The user confirmed the extracted data.
          default: CONFIRMED
        dataExtracted:
          additionalProperties: true
          type: object
          minProperties: 1
          title: Dataextracted
        dataConfirmed:
          additionalProperties: true
          type: object
          minProperties: 1
          title: Dataconfirmed
      type: object
      required:
        - dataExtracted
        - dataConfirmed
      title: AgentExecutionStateConfirmed
    workspaces__domain__entities__AgentExecutionStateDeliveredToDestination:
      properties:
        status:
          type: string
          const: DELIVERED_TO_DESTINATION
          title: Status
          description: >-
            The extracted data was successfully delivered to the destination(s),
            e.g., an AskUI workflow invoked with the data.
          default: DELIVERED_TO_DESTINATION
        dataExtracted:
          additionalProperties: true
          type: object
          title: Dataextracted
        dataConfirmed:
          additionalProperties: true
          type: object
          title: Dataconfirmed
        deliveries:
          items:
            oneOf:
              - $ref: '#/components/schemas/DataDestinationDeliveryAskUiWorkflow'
              - $ref: '#/components/schemas/DataDestinationDeliveryWebhook'
            discriminator:
              propertyName: type
              mapping:
                ASKUI_WORKFLOW:
                  $ref: '#/components/schemas/DataDestinationDeliveryAskUiWorkflow'
                WEBHOOK:
                  $ref: '#/components/schemas/DataDestinationDeliveryWebhook'
          type: array
          title: Deliveries
      type: object
      required:
        - dataExtracted
        - dataConfirmed
      title: AgentExecutionStateDeliveredToDestination
    DataDestinationDeliveryAskUiWorkflow:
      properties:
        type:
          type: string
          const: ASKUI_WORKFLOW
          title: Type
          default: ASKUI_WORKFLOW
        scheduleId:
          type: string
          title: Scheduleid
      type: object
      required:
        - scheduleId
      title: DataDestinationDeliveryAskUiWorkflow
    DataDestinationDeliveryWebhook:
      properties:
        type:
          type: string
          const: WEBHOOK
          title: Type
          default: WEBHOOK
        response:
          $ref: '#/components/schemas/WebhookResponse'
      type: object
      required:
        - response
      title: DataDestinationDeliveryWebhook
    WebhookResponse:
      properties:
        statusCode:
          type: integer
          title: Statuscode
        headers:
          additionalProperties:
            type: string
          type: object
          title: Headers
        body:
          type: string
          title: Body
      type: object
      required:
        - statusCode
        - headers
        - body
      title: WebhookResponse
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
    Basic:
      type: apiKey
      in: header
      name: Authorization

````