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

# Execute a Computer Task and wait for its result

> Creates one ordinary, immediate Computer Task for the account in the path. The selected account must be a provisioned Computer Agent accessible to the authenticated requester, including any member account restrictions. Do not send type or accountId in the body. Communication Tasks, schedules, and registered helper execution are not supported by this operation.
After creation, waits up to waitSeconds (0-60, default 60) for completion and replication of the assistant reply into Vida room messages. A five-second grace period after the stored Task update allows replication to settle. Returns the latest assistant text in the Task execution window; tool, reasoning, system, and user entries are not returned as answers. Replicated messages do not contain a definitive final-answer marker, so readiness uses Task completion and that grace period. No direct computer-session lookup, result cache, or additional persistent execution state is used.
HTTP 200 means a reply is ready or the Task errored/was canceled; inspect state, resultStatus, and error. HTTP 202 means execution or reply replication is still pending. Save taskId and check resultRef.href rather than creating another Task. A finished Task can still have pending output. waitSeconds=0 performs one inspection with a maximum 10-second read budget, without polling. Normal request setup and Task creation time are additional to the result-wait budget. A timeout or client disconnect never cancels the Task. Use the existing Task API to inspect or cancel it.
This POST is not idempotent. Retrying it can create another Task, even with the same externalTaskId. Reconcile existing Tasks before retrying an uncertain create. Missing or expired replicated messages remain pending; this endpoint does not fabricate an answer or recover deleted history.




## OpenAPI

````yaml post /api/v2/computer/accounts/{targetAccountId}/tasks/execute
openapi: 3.0.0
info:
  version: 2.0.0
  title: Vida API
  description: Vida API Documentation
servers:
  - url: https://api.vida.dev
    description: Vida Production
    variables:
      baseUrl:
        default: api.vida.dev
        description: Production API Root
security: []
tags:
  - name: Agents
  - name: Apps
    description: Install Vida apps and use their enabled integration functions.
  - name: Integrations
    description: Configure Vader integrations.
  - name: Inbound Email
    description: Control which senders may create inbound email work for an Agent.
  - name: Features
    description: Inspect capabilities available within an account hierarchy.
  - name: Conversation Logs
    description: Query conversation activity and calculate account-level metrics.
  - name: Computer Agents
    description: Set up, configure, inspect, and manage Vida Computer Agents.
  - name: Computer Agent Sessions
    description: View and reset Computer Agent sessions.
  - name: Accounts
  - name: Agent Templates
    description: Create, manage, and apply reusable Agent configurations.
paths:
  /api/v2/computer/accounts/{targetAccountId}/tasks/execute:
    post:
      tags:
        - Computer Agents
      summary: Execute a Computer Task and wait for its result
      description: >
        Creates one ordinary, immediate Computer Task for the account in the
        path. The selected account must be a provisioned Computer Agent
        accessible to the authenticated requester, including any member account
        restrictions. Do not send type or accountId in the body. Communication
        Tasks, schedules, and registered helper execution are not supported by
        this operation.

        After creation, waits up to waitSeconds (0-60, default 60) for
        completion and replication of the assistant reply into Vida room
        messages. A five-second grace period after the stored Task update allows
        replication to settle. Returns the latest assistant text in the Task
        execution window; tool, reasoning, system, and user entries are not
        returned as answers. Replicated messages do not contain a definitive
        final-answer marker, so readiness uses Task completion and that grace
        period. No direct computer-session lookup, result cache, or additional
        persistent execution state is used.

        HTTP 200 means a reply is ready or the Task errored/was canceled;
        inspect state, resultStatus, and error. HTTP 202 means execution or
        reply replication is still pending. Save taskId and check resultRef.href
        rather than creating another Task. A finished Task can still have
        pending output. waitSeconds=0 performs one inspection with a maximum
        10-second read budget, without polling. Normal request setup and Task
        creation time are additional to the result-wait budget. A timeout or
        client disconnect never cancels the Task. Use the existing Task API to
        inspect or cancel it.

        This POST is not idempotent. Retrying it can create another Task, even
        with the same externalTaskId. Reconcile existing Tasks before retrying
        an uncertain create. Missing or expired replicated messages remain
        pending; this endpoint does not fabricate an answer or recover deleted
        history.
      operationId: tasksPostExecute
      parameters:
        - name: targetAccountId
          in: path
          required: true
          description: Selected Computer Agent account.
          schema:
            type: integer
            minimum: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ComputerTaskExecute'
            example:
              taskContext: Open example.com and report the page title.
              waitSeconds: 60
      responses:
        '200':
          description: Reply ready, or Task errored or canceled
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                allOf:
                  - $ref: '#/components/schemas/ComputerTaskResult'
        '202':
          description: Task accepted; execution or reply replication remains pending
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                allOf:
                  - $ref: '#/components/schemas/ComputerTaskResult'
        '400':
          description: >-
            Invalid Computer Task input, unsupported body field, or waitSeconds
            outside 0-60
        '401':
          description: Authentication required or target account inaccessible
        '403':
          description: Selected account is outside the requester permissions
        '404':
          description: Selected account not found
        '409':
          description: Selected Computer Agent is not provisioned or unavailable
      security:
        - apiKeyAuth: []
components:
  schemas:
    ComputerTaskExecute:
      type: object
      additionalProperties: false
      required:
        - taskContext
      properties:
        taskContext:
          type: string
          description: Instructions for the Agent performing this Task.
          example: Confirm whether the customer wants a renewal quote.
          minLength: 1
        waitSeconds:
          type: integer
          minimum: 0
          maximum: 60
          default: 60
        title:
          type: string
          description: Optional Task title.
        externalTaskId:
          type: string
          description: Caller correlation ID, not an idempotency key.
        meta:
          type: object
          additionalProperties: true
          description: Ordinary Task reporting metadata, not added to the Agent prompt.
    ComputerTaskResult:
      type: object
      required:
        - success
        - taskId
        - state
        - resultStatus
        - output
        - error
        - resultRef
      properties:
        success:
          type: boolean
          description: Whether the API request succeeded, not whether the Task succeeded.
        taskId:
          type: string
          description: Existing Task ID.
        state:
          type: string
          enum:
            - pending
            - processing
            - running
            - finished
            - errored
            - canceled
        resultStatus:
          type: string
          enum:
            - pending
            - ready
            - unavailable
          description: >-
            Response-only readiness. Finished Tasks remain pending while their
            reply has not replicated. Unavailable indicates an errored or
            canceled Task.
        output:
          type: object
          nullable: true
          required:
            - text
            - truncated
          properties:
            text:
              type: string
              maxLength: 20000
              description: >-
                Latest replicated assistant reply in the completed Task
                execution window, after a five-second replication grace period.
            truncated:
              type: boolean
              description: True when the returned text exceeded 20,000 characters.
        error:
          type: object
          nullable: true
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - task_failed
                - task_canceled
            message:
              type: string
        resultRef:
          type: object
          required:
            - href
          properties:
            href:
              type: string
              description: >-
                Relative GET result URL. Authenticate with the normal token
                query parameter.
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: query
      name: token
      description: Vida API Token

````