Skip to main content
PATCH
/
api
/
v1
/
executions
/
{execution_id}
Update Execution
curl --request PATCH \
  --url https://control-plane.kubiya.ai/api/v1/executions/{execution_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "status": "<string>",
  "started_at": "<string>",
  "completed_at": "<string>",
  "response": "<string>",
  "error_message": "<string>",
  "usage": {},
  "execution_metadata": {}
}
'
import requests

url = "https://control-plane.kubiya.ai/api/v1/executions/{execution_id}"

payload = {
"status": "<string>",
"started_at": "<string>",
"completed_at": "<string>",
"response": "<string>",
"error_message": "<string>",
"usage": {},
"execution_metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
status: '<string>',
started_at: '<string>',
completed_at: '<string>',
response: '<string>',
error_message: '<string>',
usage: {},
execution_metadata: {}
})
};

fetch('https://control-plane.kubiya.ai/api/v1/executions/{execution_id}', 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://control-plane.kubiya.ai/api/v1/executions/{execution_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'status' => '<string>',
'started_at' => '<string>',
'completed_at' => '<string>',
'response' => '<string>',
'error_message' => '<string>',
'usage' => [

],
'execution_metadata' => [

]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://control-plane.kubiya.ai/api/v1/executions/{execution_id}"

payload := strings.NewReader("{\n \"status\": \"<string>\",\n \"started_at\": \"<string>\",\n \"completed_at\": \"<string>\",\n \"response\": \"<string>\",\n \"error_message\": \"<string>\",\n \"usage\": {},\n \"execution_metadata\": {}\n}")

req, _ := http.NewRequest("PATCH", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.patch("https://control-plane.kubiya.ai/api/v1/executions/{execution_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"<string>\",\n \"started_at\": \"<string>\",\n \"completed_at\": \"<string>\",\n \"response\": \"<string>\",\n \"error_message\": \"<string>\",\n \"usage\": {},\n \"execution_metadata\": {}\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://control-plane.kubiya.ai/api/v1/executions/{execution_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"status\": \"<string>\",\n \"started_at\": \"<string>\",\n \"completed_at\": \"<string>\",\n \"response\": \"<string>\",\n \"error_message\": \"<string>\",\n \"usage\": {},\n \"execution_metadata\": {}\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "organization_id": "<string>",
  "execution_type": "<string>",
  "entity_id": "<string>",
  "entity_name": "<string>",
  "prompt": "<string>",
  "system_prompt": "<string>",
  "status": "<string>",
  "response": "<string>",
  "error_message": "<string>",
  "usage": {},
  "execution_metadata": {},
  "runner_name": "<string>",
  "user_id": "<string>",
  "user_name": "<string>",
  "user_email": "<string>",
  "user_avatar": "<string>",
  "created_at": "<string>",
  "started_at": "<string>",
  "completed_at": "<string>",
  "updated_at": "<string>",
  "participants": [
    {
      "id": "<string>",
      "user_id": "<string>",
      "user_name": "<string>",
      "user_email": "<string>",
      "user_avatar": "<string>",
      "role": "<string>",
      "joined_at": "<string>",
      "last_active_at": "<string>"
    }
  ],
  "last_message_at": "<string>",
  "last_message_preview": "<string>"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Authorizations

Authorization
string
header
required

Enter your Kubiya API token (format: Bearer )

Path Parameters

execution_id
string
required

Body

application/json

Update execution fields - used by workers to update execution status

status
string | null
started_at
string | null
completed_at
string | null
response
string | null
error_message
string | null
usage
Usage · object | null
execution_metadata
Execution Metadata · object | null

Response

Successful Response

id
string
required
organization_id
string
required
execution_type
string
required
entity_id
string
required
entity_name
string | null
required
prompt
string
required
system_prompt
string | null
required
status
string
required
response
string | null
required
error_message
string | null
required
usage
Usage · object
required
execution_metadata
Execution Metadata · object
required
runner_name
string | null
required
user_id
string | null
required
user_name
string | null
required
user_email
string | null
required
user_avatar
string | null
required
created_at
string
required
started_at
string | null
required
completed_at
string | null
required
updated_at
string
required
participants
ParticipantResponse · object[]
last_message_at
string | null
last_message_preview
string | null