curl --request POST \
--url https://app.flextell.ai/api/v1/uploads/presign \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Tenant: <x-tenant>' \
--data '
{
"filename": "<string>",
"size": 26214400,
"fileable_id": 2,
"description": "<string>",
"group_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://app.flextell.ai/api/v1/uploads/presign"
payload = {
"filename": "<string>",
"size": 26214400,
"fileable_id": 2,
"description": "<string>",
"group_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"X-Tenant": "<x-tenant>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Tenant': '<x-tenant>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
filename: '<string>',
size: 26214400,
fileable_id: 2,
description: '<string>',
group_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://app.flextell.ai/api/v1/uploads/presign', 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://app.flextell.ai/api/v1/uploads/presign",
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([
'filename' => '<string>',
'size' => 26214400,
'fileable_id' => 2,
'description' => '<string>',
'group_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Tenant: <x-tenant>"
],
]);
$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://app.flextell.ai/api/v1/uploads/presign"
payload := strings.NewReader("{\n \"filename\": \"<string>\",\n \"size\": 26214400,\n \"fileable_id\": 2,\n \"description\": \"<string>\",\n \"group_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Tenant", "<x-tenant>")
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://app.flextell.ai/api/v1/uploads/presign")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filename\": \"<string>\",\n \"size\": 26214400,\n \"fileable_id\": 2,\n \"description\": \"<string>\",\n \"group_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.flextell.ai/api/v1/uploads/presign")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Tenant"] = '<x-tenant>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filename\": \"<string>\",\n \"size\": 26214400,\n \"fileable_id\": 2,\n \"description\": \"<string>\",\n \"group_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"success": "<string>",
"data": {
"upload_url": "<string>",
"key": "<string>",
"group_id": "<unknown>",
"headers": "<string>",
"expires_at": "<string>"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"success": false,
"error_code": "CUSTOMER_ERASED",
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Generate a presigned upload URL
Returns a short-lived presigned PUT URL so the client can upload the file directly to S3, bypassing the backend. The client then calls confirm.
curl --request POST \
--url https://app.flextell.ai/api/v1/uploads/presign \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Tenant: <x-tenant>' \
--data '
{
"filename": "<string>",
"size": 26214400,
"fileable_id": 2,
"description": "<string>",
"group_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://app.flextell.ai/api/v1/uploads/presign"
payload = {
"filename": "<string>",
"size": 26214400,
"fileable_id": 2,
"description": "<string>",
"group_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"X-Tenant": "<x-tenant>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Tenant': '<x-tenant>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
filename: '<string>',
size: 26214400,
fileable_id: 2,
description: '<string>',
group_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://app.flextell.ai/api/v1/uploads/presign', 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://app.flextell.ai/api/v1/uploads/presign",
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([
'filename' => '<string>',
'size' => 26214400,
'fileable_id' => 2,
'description' => '<string>',
'group_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Tenant: <x-tenant>"
],
]);
$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://app.flextell.ai/api/v1/uploads/presign"
payload := strings.NewReader("{\n \"filename\": \"<string>\",\n \"size\": 26214400,\n \"fileable_id\": 2,\n \"description\": \"<string>\",\n \"group_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Tenant", "<x-tenant>")
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://app.flextell.ai/api/v1/uploads/presign")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filename\": \"<string>\",\n \"size\": 26214400,\n \"fileable_id\": 2,\n \"description\": \"<string>\",\n \"group_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.flextell.ai/api/v1/uploads/presign")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Tenant"] = '<x-tenant>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filename\": \"<string>\",\n \"size\": 26214400,\n \"fileable_id\": 2,\n \"description\": \"<string>\",\n \"group_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"success": "<string>",
"data": {
"upload_url": "<string>",
"key": "<string>",
"group_id": "<unknown>",
"headers": "<string>",
"expires_at": "<string>"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"success": false,
"error_code": "CUSTOMER_ERASED",
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Yetkilendirmeler
The access token received from the authorization server in the OAuth 2.0 flow.
Başlıklar
Tenant identifier. Send the Tenant ID in the X-Tenant header to scope API requests to a specific tenant.
Gövde
The original file name (used to derive the storage extension).
255The content type the client will upload with (must match the PUT request).
image/jpeg, image/png, image/webp, image/heic, image/heif, image/gif, application/pdf, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, audio/mpeg, audio/mp4, audio/aac, audio/ogg, audio/wav, audio/webm, video/mp4, video/quicktime, video/webm, video/3gpp, video/x-matroska, video/mpeg 255The declared file size in bytes.
1 <= x <= 52428800The file type.
form_image, audio, catalog, certificate, image, video, other, before_after The fileable type (customer, lead, user, tenant, chat_log, ai_report, treatment, or treatment_group).
customer, lead, user, tenant, chat_log, ai_report, treatment, treatment_group The fileable id.
x >= 1The file description.
1000Optional group id shared by files uploaded together. Omit it to presign a standalone file; reuse the same uuid across a batch to group those files.