Delete Multiple Workflow Agent Files
curl --request DELETE \
--url https://odyssey.asteroid.ai/agents/v2/agents/{agentId}/workflows/{workflowId}/agent-files \
--header 'Content-Type: application/json' \
--header 'X-Asteroid-Agents-Api-Key: <api-key>' \
--data '
{
"fileIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'import requests
url = "https://odyssey.asteroid.ai/agents/v2/agents/{agentId}/workflows/{workflowId}/agent-files"
payload = { "fileIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"] }
headers = {
"X-Asteroid-Agents-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'X-Asteroid-Agents-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({fileIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']})
};
fetch('https://odyssey.asteroid.ai/agents/v2/agents/{agentId}/workflows/{workflowId}/agent-files', 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/agents/{agentId}/workflows/{workflowId}/agent-files",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'fileIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Asteroid-Agents-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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://odyssey.asteroid.ai/agents/v2/agents/{agentId}/workflows/{workflowId}/agent-files"
payload := strings.NewReader("{\n \"fileIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("X-Asteroid-Agents-Api-Key", "<api-key>")
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.delete("https://odyssey.asteroid.ai/agents/v2/agents/{agentId}/workflows/{workflowId}/agent-files")
.header("X-Asteroid-Agents-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"fileIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://odyssey.asteroid.ai/agents/v2/agents/{agentId}/workflows/{workflowId}/agent-files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["X-Asteroid-Agents-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fileIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"files": [
{
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"downloadUrl": "<string>",
"fileName": "<string>",
"filePath": "<string>",
"fileSize": 123,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"isFrozen": true,
"updatedAt": "2023-11-07T05:31:56Z",
"version": 123,
"checksum": "<string>",
"lastModifiedByExecutionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"mimeType": "<string>"
}
],
"workflowId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}"Workflow not found."Files
Delete Multiple Workflow Agent Files
Delete several agent files from a workflow version in one batch. This creates a single new workflow version with all the files removed and returns its id as workflowId; publish or execute that version for the removals to take effect.
DELETE
/
agents
/
{agentId}
/
workflows
/
{workflowId}
/
agent-files
Delete Multiple Workflow Agent Files
curl --request DELETE \
--url https://odyssey.asteroid.ai/agents/v2/agents/{agentId}/workflows/{workflowId}/agent-files \
--header 'Content-Type: application/json' \
--header 'X-Asteroid-Agents-Api-Key: <api-key>' \
--data '
{
"fileIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'import requests
url = "https://odyssey.asteroid.ai/agents/v2/agents/{agentId}/workflows/{workflowId}/agent-files"
payload = { "fileIds": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"] }
headers = {
"X-Asteroid-Agents-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'X-Asteroid-Agents-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({fileIds: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']})
};
fetch('https://odyssey.asteroid.ai/agents/v2/agents/{agentId}/workflows/{workflowId}/agent-files', 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/agents/{agentId}/workflows/{workflowId}/agent-files",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'fileIds' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Asteroid-Agents-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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://odyssey.asteroid.ai/agents/v2/agents/{agentId}/workflows/{workflowId}/agent-files"
payload := strings.NewReader("{\n \"fileIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("X-Asteroid-Agents-Api-Key", "<api-key>")
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.delete("https://odyssey.asteroid.ai/agents/v2/agents/{agentId}/workflows/{workflowId}/agent-files")
.header("X-Asteroid-Agents-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"fileIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://odyssey.asteroid.ai/agents/v2/agents/{agentId}/workflows/{workflowId}/agent-files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["X-Asteroid-Agents-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fileIds\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"files": [
{
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"downloadUrl": "<string>",
"fileName": "<string>",
"filePath": "<string>",
"fileSize": 123,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"isFrozen": true,
"updatedAt": "2023-11-07T05:31:56Z",
"version": 123,
"checksum": "<string>",
"lastModifiedByExecutionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"mimeType": "<string>"
}
],
"workflowId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}"Workflow not found."Authorizations
Body
application/json
Request to delete multiple agent files from a workflow version in one batch
Response
The request has succeeded.
⌘I

