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

# Create Agent Execution



## OpenAPI

````yaml post /api/v1/agent-executions
openapi: 3.1.0
info:
  title: AskUI Workspaces API
  version: 0.2.15
servers: []
security: []
paths:
  /api/v1/agent-executions:
    post:
      tags:
        - agent-executions
      summary: Create Agent Execution
      operationId: create_agent_execution_api_v1_agent_executions_post
      parameters:
        - name: agent_id
          in: query
          required: true
          schema:
            type: string
            format: uuid4
            title: Agent Id
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/Body_create_agent_execution_api_v1_agent_executions_post
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentExecution'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - Bearer: []
        - Basic: []
components:
  schemas:
    Body_create_agent_execution_api_v1_agent_executions_post:
      properties:
        input_files:
          items:
            type: string
            format: binary
          type: array
          minItems: 1
          title: Input Files
          description: >-
            Files to extract data from. Supported file extensions: {'.eml',
            '.webp', '.jpg', '.gif', '.jpeg', '.txt', '.pdf', '.png'}. Maximum
            total size: 100 MiB. We process the .eml files as text files, i.e.,
            we don't process non-textual attachments and content properly. For
            that, extract them from the .eml files separating them into
            different files.
      type: object
      required:
        - input_files
      title: Body_create_agent_execution_api_v1_agent_executions_post
    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
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
    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
    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

````