---
title: "Wait for an execution's status to change"
method: GET
path: "/agents/v2/executions/{executionId}/sync"
tags: ["Execution"]
---

# Wait for an execution's status to change

`GET /agents/v2/executions/{executionId}/sync`

## Request

- Base URL: `https://odyssey.asteroid.ai`
- URL: `https://odyssey.asteroid.ai/agents/v2/executions/{executionId}/sync`
- Auth: API key in header `X-Api-Key`

Wait up to timeoutSeconds for an execution's status to change.
Returns 200 with the result once the execution completes, fails or is cancelled.
Returns 202 as soon as its status differs from the one it had when the call began,
at once when it is paused, paused_by_agent or awaiting_confirmation, and otherwise
when timeoutSeconds passes. returnReason says which. On awaiting_confirmation, awaitingConfirmation names
the node the execution holds at. Call it again to keep waiting.

## Path parameters

- `executionId` string, uuid, required

## Query parameters

- `timeoutSeconds` integer

## Response `200`

The request has succeeded.

- AgentsAgentExecuteAgentSyncResponse
  - `awaitingConfirmation` AgentsAgentConfirmationHold: The node an execution awaiting confirmation holds at
    - `nodeId` string, uuid, required
    - `nodeName` string, required
  - `executionId` string, uuid, required
  - `executionResult` AgentsExecutionExecutionResult: Execution result containing outcome, reasoning, and result data
    - `createdAt` string, date-time, required
    - `executionId` string, uuid, required
    - `id` string, uuid, required
    - `outcome` string, required: Outcome of the execution (success or failure)
    - `reasoning` string, required
    - `result` unknown, required
  - `returnReason` 'ended' | 'needs_person' | 'status_change' | 'timed_out', required: Why a wait call returned. ended: the execution completed, failed or was cancelled. needs_person: it is paused, paused_by_agent or awaiting_confirmation and will not continue without a person. status_change: its status changed from the one it had when the call began. timed_out: the call stopped waiting before anything changed, normally because timeoutSeconds passed.
  - `status` 'queued' | 'starting' | 'running' | 'paused' | 'awaiting_confirmation' | 'completed' | 'cancelled' | 'failed' | 'paused_by_agent', required

## Other responses

- `202`: The request has been accepted for processing, but processing has not yet completed.
- `default`: An unexpected error response.

---

[API](https://skmtc.dev/asteroid/apis/agent-service.md) - [All operations](https://skmtc.dev/asteroid/apis/agent-service/llms.txt) - [OpenAPI document](https://skmtc.dev/asteroid/apis/agent-service/revisions/ccc134d1d510?raw)
