Wait for an execution to finish
curl --request GET \
--url https://odyssey.asteroid.ai/agents/v2/executions/{executionId}/sync \
--header 'X-Api-Key: <api-key>'import requests
url = "https://odyssey.asteroid.ai/agents/v2/executions/{executionId}/sync"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://odyssey.asteroid.ai/agents/v2/executions/{executionId}/sync', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://odyssey.asteroid.ai/agents/v2/executions/{executionId}/sync",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://odyssey.asteroid.ai/agents/v2/executions/{executionId}/sync"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://odyssey.asteroid.ai/agents/v2/executions/{executionId}/sync")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://odyssey.asteroid.ai/agents/v2/executions/{executionId}/sync")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"executionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "queued",
"executionResult": {
"createdAt": "2023-11-07T05:31:56Z",
"executionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outcome": "<string>",
"reasoning": "<string>",
"result": "<unknown>"
}
}{
"executionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "queued",
"executionResult": {
"createdAt": "2023-11-07T05:31:56Z",
"executionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outcome": "<string>",
"reasoning": "<string>",
"result": "<unknown>"
}
}{
"code": 123,
"message": "<string>",
"detail": "<string>",
"errors": [
{
"detail": "<string>",
"parameter": "<string>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}Execution
Wait for an execution to finish
Wait for an execution that is already running to finish, up to timeoutSeconds. Returns 200 with the result once the execution completes, fails or is cancelled. Returns 202 when it has not finished in time, or when it is paused or awaiting confirmation. Call it again to keep waiting.
GET
/
agents
/
v2
/
executions
/
{executionId}
/
sync
Wait for an execution to finish
curl --request GET \
--url https://odyssey.asteroid.ai/agents/v2/executions/{executionId}/sync \
--header 'X-Api-Key: <api-key>'import requests
url = "https://odyssey.asteroid.ai/agents/v2/executions/{executionId}/sync"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://odyssey.asteroid.ai/agents/v2/executions/{executionId}/sync', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://odyssey.asteroid.ai/agents/v2/executions/{executionId}/sync",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://odyssey.asteroid.ai/agents/v2/executions/{executionId}/sync"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://odyssey.asteroid.ai/agents/v2/executions/{executionId}/sync")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://odyssey.asteroid.ai/agents/v2/executions/{executionId}/sync")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"executionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "queued",
"executionResult": {
"createdAt": "2023-11-07T05:31:56Z",
"executionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outcome": "<string>",
"reasoning": "<string>",
"result": "<unknown>"
}
}{
"executionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "queued",
"executionResult": {
"createdAt": "2023-11-07T05:31:56Z",
"executionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outcome": "<string>",
"reasoning": "<string>",
"result": "<unknown>"
}
}{
"code": 123,
"message": "<string>",
"detail": "<string>",
"errors": [
{
"detail": "<string>",
"parameter": "<string>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}Authorizations
Path Parameters
Query Parameters
Seconds to wait for the execution to finish before returning 202. Defaults to 25.
Required range:
1 <= x <= 25Response
The request has succeeded.
The execution's status when the call returned: terminal on 200, the current status on 202
Available options:
queued, starting, running, paused, awaiting_confirmation, completed, cancelled, failed, paused_by_agent Outcome, reasoning and result data. Present on 200 when the execution recorded a result.
Show child attributes
Show child attributes

