curl --request POST \
--url https://effectiveai.app/api/v2/files/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"files": [
{
"path": "<string>",
"size": 1,
"mimeType": "<string>",
"metadata": {},
"type": "<string>",
"replaceTargetArtifactId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ownerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ownerType": "<string>"
}
],
"targetUri": "<string>",
"sessionId": "<string>",
"onConflict": "rename",
"scope": "<string>"
}
'import requests
url = "https://effectiveai.app/api/v2/files/uploads"
payload = {
"files": [
{
"path": "<string>",
"size": 1,
"mimeType": "<string>",
"metadata": {},
"type": "<string>",
"replaceTargetArtifactId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ownerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ownerType": "<string>"
}
],
"targetUri": "<string>",
"sessionId": "<string>",
"onConflict": "rename",
"scope": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
files: [
{
path: '<string>',
size: 1,
mimeType: '<string>',
metadata: {},
type: '<string>',
replaceTargetArtifactId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ownerId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ownerType: '<string>'
}
],
targetUri: '<string>',
sessionId: '<string>',
onConflict: 'rename',
scope: '<string>'
})
};
fetch('https://effectiveai.app/api/v2/files/uploads', 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://effectiveai.app/api/v2/files/uploads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'files' => [
[
'path' => '<string>',
'size' => 1,
'mimeType' => '<string>',
'metadata' => [
],
'type' => '<string>',
'replaceTargetArtifactId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ownerId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ownerType' => '<string>'
]
],
'targetUri' => '<string>',
'sessionId' => '<string>',
'onConflict' => 'rename',
'scope' => '<string>'
]),
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://effectiveai.app/api/v2/files/uploads"
payload := strings.NewReader("{\n \"files\": [\n {\n \"path\": \"<string>\",\n \"size\": 1,\n \"mimeType\": \"<string>\",\n \"metadata\": {},\n \"type\": \"<string>\",\n \"replaceTargetArtifactId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerType\": \"<string>\"\n }\n ],\n \"targetUri\": \"<string>\",\n \"sessionId\": \"<string>\",\n \"onConflict\": \"rename\",\n \"scope\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://effectiveai.app/api/v2/files/uploads")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"files\": [\n {\n \"path\": \"<string>\",\n \"size\": 1,\n \"mimeType\": \"<string>\",\n \"metadata\": {},\n \"type\": \"<string>\",\n \"replaceTargetArtifactId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerType\": \"<string>\"\n }\n ],\n \"targetUri\": \"<string>\",\n \"sessionId\": \"<string>\",\n \"onConflict\": \"rename\",\n \"scope\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://effectiveai.app/api/v2/files/uploads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"files\": [\n {\n \"path\": \"<string>\",\n \"size\": 1,\n \"mimeType\": \"<string>\",\n \"metadata\": {},\n \"type\": \"<string>\",\n \"replaceTargetArtifactId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerType\": \"<string>\"\n }\n ],\n \"targetUri\": \"<string>\",\n \"sessionId\": \"<string>\",\n \"onConflict\": \"rename\",\n \"scope\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"targetUri": "<string>",
"files": [
{
"path": "<string>",
"signedUrl": "<string>",
"expiresAt": "<string>",
"uploadToken": "<string>",
"originalPath": "<string>",
"headers": {},
"willReplace": true
}
],
"conflicts": [
{
"path": "<string>",
"type": "file",
"existingName": "<string>",
"existingSize": 123,
"existingModifiedAt": "<string>",
"existingItemCount": 123
}
]
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>"
}Prepare file uploads
Uses the shared Vault upload flow for up to 100 files. JSON body limit: 1 MiB. Provide targetUri or sessionId; @mc destinations also require scope. Vault checks destination access, creates missing folders, and applies onConflict (rename by default). PUT each file to its signed URL using the returned headers, then pass its uploadToken to completion. Initialization is not idempotent; do not retry blindly after a lost response.
curl --request POST \
--url https://effectiveai.app/api/v2/files/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"files": [
{
"path": "<string>",
"size": 1,
"mimeType": "<string>",
"metadata": {},
"type": "<string>",
"replaceTargetArtifactId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ownerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ownerType": "<string>"
}
],
"targetUri": "<string>",
"sessionId": "<string>",
"onConflict": "rename",
"scope": "<string>"
}
'import requests
url = "https://effectiveai.app/api/v2/files/uploads"
payload = {
"files": [
{
"path": "<string>",
"size": 1,
"mimeType": "<string>",
"metadata": {},
"type": "<string>",
"replaceTargetArtifactId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ownerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ownerType": "<string>"
}
],
"targetUri": "<string>",
"sessionId": "<string>",
"onConflict": "rename",
"scope": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
files: [
{
path: '<string>',
size: 1,
mimeType: '<string>',
metadata: {},
type: '<string>',
replaceTargetArtifactId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ownerId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ownerType: '<string>'
}
],
targetUri: '<string>',
sessionId: '<string>',
onConflict: 'rename',
scope: '<string>'
})
};
fetch('https://effectiveai.app/api/v2/files/uploads', 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://effectiveai.app/api/v2/files/uploads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'files' => [
[
'path' => '<string>',
'size' => 1,
'mimeType' => '<string>',
'metadata' => [
],
'type' => '<string>',
'replaceTargetArtifactId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ownerId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ownerType' => '<string>'
]
],
'targetUri' => '<string>',
'sessionId' => '<string>',
'onConflict' => 'rename',
'scope' => '<string>'
]),
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://effectiveai.app/api/v2/files/uploads"
payload := strings.NewReader("{\n \"files\": [\n {\n \"path\": \"<string>\",\n \"size\": 1,\n \"mimeType\": \"<string>\",\n \"metadata\": {},\n \"type\": \"<string>\",\n \"replaceTargetArtifactId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerType\": \"<string>\"\n }\n ],\n \"targetUri\": \"<string>\",\n \"sessionId\": \"<string>\",\n \"onConflict\": \"rename\",\n \"scope\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://effectiveai.app/api/v2/files/uploads")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"files\": [\n {\n \"path\": \"<string>\",\n \"size\": 1,\n \"mimeType\": \"<string>\",\n \"metadata\": {},\n \"type\": \"<string>\",\n \"replaceTargetArtifactId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerType\": \"<string>\"\n }\n ],\n \"targetUri\": \"<string>\",\n \"sessionId\": \"<string>\",\n \"onConflict\": \"rename\",\n \"scope\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://effectiveai.app/api/v2/files/uploads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"files\": [\n {\n \"path\": \"<string>\",\n \"size\": 1,\n \"mimeType\": \"<string>\",\n \"metadata\": {},\n \"type\": \"<string>\",\n \"replaceTargetArtifactId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerType\": \"<string>\"\n }\n ],\n \"targetUri\": \"<string>\",\n \"sessionId\": \"<string>\",\n \"onConflict\": \"rename\",\n \"scope\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"targetUri": "<string>",
"files": [
{
"path": "<string>",
"signedUrl": "<string>",
"expiresAt": "<string>",
"uploadToken": "<string>",
"originalPath": "<string>",
"headers": {},
"willReplace": true
}
],
"conflicts": [
{
"path": "<string>",
"type": "file",
"existingName": "<string>",
"existingSize": 123,
"existingModifiedAt": "<string>",
"existingItemCount": 123
}
]
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>"
}Authorizations
Effective API key. Send Authorization: Bearer sk-eai-...
Body
Files to upload (max 100 per request)
1 - 100 elementsShow child attributes
Show child attributes
Target folder URI; required unless sessionId is provided. artifact:// writes must use a vault root plus relative path (or a supported managed rater root), not an ordinary folder ID. @mc requires scope.
1Chat session ID. When provided, files are uploaded to the session folder (same location as chat composer base64 uploads). Mutually exclusive with targetUri.
How to handle name conflicts (default: rename)
fail, replace, rename Required only for @mc destinations. Overrides ambient Mission Control context.
^mc:[A-Za-z0-9][A-Za-z0-9-]{0,127}$Response
Signed PUT instructions and any name conflicts.