---
title: "Update Agent Execution"
method: PATCH
path: "/api/v1/agent-executions/{agent_execution_id}"
tags: ["agent-executions"]
---

# Update Agent Execution

`PATCH /api/v1/agent-executions/{agent_execution_id}`

## Path parameters

- `agent_execution_id` string, uuid4, required

## Request body

- AgentExecutionUpdateCommand
  - `state` union, required
    - AgentExecutionPendingReview
      - `status` 'PENDING_REVIEW'
      - `dataExtracted` object, required
    - AgentExecutionCancel
      - `status` 'CANCELED'
    - AgentExecutionConfirm
      - `status` 'CONFIRMED'
      - `dataConfirmed` object, required
    - WorkspacesUseCasesAgentExecutionsUpdateAgentExecutionAgentExecutionStateDeliveredToDestination
      - `status` 'DELIVERED_TO_DESTINATION'
      - `deliveries` union[]
        - union
          - DataDestinationDeliveryAskUiWorkflow
            - `type` 'ASKUI_WORKFLOW'
            - `scheduleId` string, required
          - DataDestinationDeliveryWebhook
            - `type` 'WEBHOOK'
            - `response` WebhookResponse, required
              - …

## Response `200`

Successful Response

- AgentExecution
  - `id` string, uuid4
  - `createdAt` string, date-time
  - `updatedAt` string, date-time
  - `agentId` string, uuid4, required
  - `workspaceId` string, uuid4, required
  - `state` union, required
    - AgentExecutionStatePendingInputs
      - `status` 'PENDING_INPUTS' — 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.
    - AgentExecutionStatePendingDataExtraction
      - `status` 'PENDING_DATA_EXTRACTION' — 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.
    - AgentExecutionStatePendingReview
      - `status` 'PENDING_REVIEW' — 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.
      - `dataExtracted` object, required
    - AgentExecutionStateCanceled
      - `status` 'CANCELED' — The agent execution was canceled by the user.
      - `dataExtracted` object, nullable
    - AgentExecutionStateConfirmed
      - `status` 'CONFIRMED' — The user confirmed the extracted data.
      - `dataExtracted` object, required
      - `dataConfirmed` object, required
    - WorkspacesDomainEntitiesAgentExecutionStateDeliveredToDestination
      - `status` 'DELIVERED_TO_DESTINATION' — The extracted data was successfully delivered to the destination(s), e.g., an AskUI workflow invoked with the data.
      - `dataExtracted` object, required
      - `dataConfirmed` object, required
      - `deliveries` union[]
        - union
          - DataDestinationDeliveryAskUiWorkflow
            - `type` 'ASKUI_WORKFLOW'
            - `scheduleId` string, required
          - DataDestinationDeliveryWebhook
            - `type` 'WEBHOOK'
            - `response` WebhookResponse, required
              - …

## Other responses

- `400` — Could not deliver data to destination
- `404` — Agent execution not found
- `409` — Agent schema not set
- `422` — Schema validation error

---

[API](https://skmtc.net/askui/apis/askui-workspaces-api.md) · [All operations](https://skmtc.net/askui/apis/askui-workspaces-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/askui/askui-workspaces-api/versions/b796c74292ac/schema)
