Upload context files during agent setup
curl --request POST \
--url https://api.beamstudio.ai/agent-setup/upload \
--header 'Content-Type: multipart/form-data' \
--header 'current-workspace-id: <current-workspace-id>' \
--header 'x-api-key: <api-key>' \
--form threadId=1a2036c0-d533-4636-8f51-2a811763ef5c \
--form 'files=<string>' \
--form files.items='@example-file'import requests
url = "https://api.beamstudio.ai/agent-setup/upload"
files = { "files.items": ("example-file", open("example-file", "rb")) }
payload = {
"threadId": "1a2036c0-d533-4636-8f51-2a811763ef5c",
"files": "<string>"
}
headers = {
"current-workspace-id": "<current-workspace-id>",
"x-api-key": "<api-key>"
}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('threadId', '1a2036c0-d533-4636-8f51-2a811763ef5c');
form.append('files', '<string>');
form.append('files.items', '{
"fileName": "example-file"
}');
const options = {
method: 'POST',
headers: {'current-workspace-id': '<current-workspace-id>', 'x-api-key': '<api-key>'}
};
options.body = form;
fetch('https://api.beamstudio.ai/agent-setup/upload', 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://api.beamstudio.ai/agent-setup/upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"threadId\"\r\n\r\n1a2036c0-d533-4636-8f51-2a811763ef5c\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"current-workspace-id: <current-workspace-id>",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.beamstudio.ai/agent-setup/upload"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"threadId\"\r\n\r\n1a2036c0-d533-4636-8f51-2a811763ef5c\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("current-workspace-id", "<current-workspace-id>")
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.post("https://api.beamstudio.ai/agent-setup/upload")
.header("current-workspace-id", "<current-workspace-id>")
.header("x-api-key", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"threadId\"\r\n\r\n1a2036c0-d533-4636-8f51-2a811763ef5c\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.beamstudio.ai/agent-setup/upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["current-workspace-id"] = '<current-workspace-id>'
request["x-api-key"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"threadId\"\r\n\r\n1a2036c0-d533-4636-8f51-2a811763ef5c\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body[
{
"name": "<string>",
"threadId": "<string>",
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"src": "<string>",
"fileKey": "<string>",
"url": "<string>",
"mimeType": "<string>",
"userId": "<string>",
"user": {
"name": "John Doe",
"email": "<string>",
"cognitoUserId": "<string>",
"role_name": "<string>",
"isInternalUser": true,
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"avatarSrc": "https://example.com/avatars/user123.png",
"socialProvider": "<string>",
"socialProviderId": "<string>",
"password": "<string>",
"paymentProviderCustomerId": "<string>",
"rememberToken": "<string>",
"emailVerified": true,
"referralCode": "<string>"
}
}
]Agent Setup
Upload context files during agent setup
Upload one or more files (up to 10) to provide context during agent setup. Supported file types include documents (txt, csv, pdf, xls, xlsx, docx, doc, ppt, pptx) and images (png, jpeg, jpg, tiff, heif, bmp).
POST
/
agent-setup
/
upload
Upload context files during agent setup
curl --request POST \
--url https://api.beamstudio.ai/agent-setup/upload \
--header 'Content-Type: multipart/form-data' \
--header 'current-workspace-id: <current-workspace-id>' \
--header 'x-api-key: <api-key>' \
--form threadId=1a2036c0-d533-4636-8f51-2a811763ef5c \
--form 'files=<string>' \
--form files.items='@example-file'import requests
url = "https://api.beamstudio.ai/agent-setup/upload"
files = { "files.items": ("example-file", open("example-file", "rb")) }
payload = {
"threadId": "1a2036c0-d533-4636-8f51-2a811763ef5c",
"files": "<string>"
}
headers = {
"current-workspace-id": "<current-workspace-id>",
"x-api-key": "<api-key>"
}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('threadId', '1a2036c0-d533-4636-8f51-2a811763ef5c');
form.append('files', '<string>');
form.append('files.items', '{
"fileName": "example-file"
}');
const options = {
method: 'POST',
headers: {'current-workspace-id': '<current-workspace-id>', 'x-api-key': '<api-key>'}
};
options.body = form;
fetch('https://api.beamstudio.ai/agent-setup/upload', 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://api.beamstudio.ai/agent-setup/upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"threadId\"\r\n\r\n1a2036c0-d533-4636-8f51-2a811763ef5c\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"current-workspace-id: <current-workspace-id>",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.beamstudio.ai/agent-setup/upload"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"threadId\"\r\n\r\n1a2036c0-d533-4636-8f51-2a811763ef5c\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("current-workspace-id", "<current-workspace-id>")
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.post("https://api.beamstudio.ai/agent-setup/upload")
.header("current-workspace-id", "<current-workspace-id>")
.header("x-api-key", "<api-key>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"threadId\"\r\n\r\n1a2036c0-d533-4636-8f51-2a811763ef5c\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.beamstudio.ai/agent-setup/upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["current-workspace-id"] = '<current-workspace-id>'
request["x-api-key"] = '<api-key>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"threadId\"\r\n\r\n1a2036c0-d533-4636-8f51-2a811763ef5c\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"files.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body[
{
"name": "<string>",
"threadId": "<string>",
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"src": "<string>",
"fileKey": "<string>",
"url": "<string>",
"mimeType": "<string>",
"userId": "<string>",
"user": {
"name": "John Doe",
"email": "<string>",
"cognitoUserId": "<string>",
"role_name": "<string>",
"isInternalUser": true,
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"avatarSrc": "https://example.com/avatars/user123.png",
"socialProvider": "<string>",
"socialProviderId": "<string>",
"password": "<string>",
"paymentProviderCustomerId": "<string>",
"rememberToken": "<string>",
"emailVerified": true,
"referralCode": "<string>"
}
}
]Authorizations
Headers
Body
multipart/form-data
Files to upload with thread ID
Response
201 - application/json
Name of the chat file.
UUID of the associated thread.
Upload status of the file.
Available options:
processing, uploaded, failed Source of the upload.
Available options:
file_upload, text_snippet, url_upload Source path of the file.
Storage key for the file.
URL of the file.
MIME type of the file.
UUID of the user.
Show child attributes
Show child attributes
⌘I