Initiate multipart upload
curl --request POST \
--url https://ai.data.cloud/api/v2/team/file/init-multipart-upload \
--header 'Content-Type: application/json' \
--header 'x-pd-api-key: <api-key>' \
--data '
{
"user_id": "tmm-cm8gt41kuxxxx1l1d1n2wz8v",
"file_name": "sales_data.csv",
"file_size": 1024
}
'import requests
url = "https://ai.data.cloud/api/v2/team/file/init-multipart-upload"
payload = {
"user_id": "tmm-cm8gt41kuxxxx1l1d1n2wz8v",
"file_name": "sales_data.csv",
"file_size": 1024
}
headers = {
"x-pd-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-pd-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_id: 'tmm-cm8gt41kuxxxx1l1d1n2wz8v',
file_name: 'sales_data.csv',
file_size: 1024
})
};
fetch('https://ai.data.cloud/api/v2/team/file/init-multipart-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://ai.data.cloud/api/v2/team/file/init-multipart-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 => json_encode([
'user_id' => 'tmm-cm8gt41kuxxxx1l1d1n2wz8v',
'file_name' => 'sales_data.csv',
'file_size' => 1024
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-pd-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://ai.data.cloud/api/v2/team/file/init-multipart-upload"
payload := strings.NewReader("{\n \"user_id\": \"tmm-cm8gt41kuxxxx1l1d1n2wz8v\",\n \"file_name\": \"sales_data.csv\",\n \"file_size\": 1024\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-pd-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.post("https://ai.data.cloud/api/v2/team/file/init-multipart-upload")
.header("x-pd-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"tmm-cm8gt41kuxxxx1l1d1n2wz8v\",\n \"file_name\": \"sales_data.csv\",\n \"file_size\": 1024\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ai.data.cloud/api/v2/team/file/init-multipart-upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-pd-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": \"tmm-cm8gt41kuxxxx1l1d1n2wz8v\",\n \"file_name\": \"sales_data.csv\",\n \"file_size\": 1024\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"data": {
"upload_id": "5k3EJxAYgtHW1fkbF54ppKEiTWSBeFBQ_01DnFEDSSHChV7w1jpw7SM_KWLkHYXm6Wzaw_NOpMG_OFsi9D5R8Csx9xxxx_m.YuWNjbTMWYIwVKG5rw0VXJZzgWbwSfe",
"file_object_key": "temp/user/tmm-cm8gt41kuxxxx1l1d1n2wz8v/26f6272c-a847-4589-b352-a85471bb5121.csv",
"part_items": [
{
"number": 1,
"size": 1024,
"upload_url": "https://s3.amazonaws.com/powerdrilltest/temp/user/tmm-cm8gt41kuxxxx1l1d1n2wz8v/26f6272c-a847-4589-b352-a85471bb5121.csv?uploadId=5k3EJxAYgtHW1fkbF54ppKEiTWxxxxxx_01DnFEDSSHChV7w1jpw7SM_KWLkHYXm6Wzaw_NOpMG_OFsi9D5R8Csx9DUHbQ_m.YuWNjbTMWYIwVKG5rw0VXJZzgWbwSfe&partNumber=1&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20250402T085840Z&X-Amz-SignedHeaders=host&X-Amz-Expires=86399&X-Amz-Credential=AKIARLSQLXURHEIDN4OZ%2F20250402%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=b7be59679910fabd6603af6b7eb003094498ec7d6ceb47af93253540e734dba3"
}
]
}
}Files
Initiate multipart upload
Initiates a multipart upload task for local files in multipart mode. Only files in the following formats are supported: .csv, .tsv, .md, .mdx, .json, .txt, .pdf, .pptx, .docx, .xls, or .xlsx.
Important notes
When you call this endpoint, Cloud Object Storage, for example, AWS S3, generates and returns a unique upload ID to identify the multipart upload task. This ID is required when you call the Complete multipart upload endpoint.
POST
/
v2
/
team
/
file
/
init-multipart-upload
Initiate multipart upload
curl --request POST \
--url https://ai.data.cloud/api/v2/team/file/init-multipart-upload \
--header 'Content-Type: application/json' \
--header 'x-pd-api-key: <api-key>' \
--data '
{
"user_id": "tmm-cm8gt41kuxxxx1l1d1n2wz8v",
"file_name": "sales_data.csv",
"file_size": 1024
}
'import requests
url = "https://ai.data.cloud/api/v2/team/file/init-multipart-upload"
payload = {
"user_id": "tmm-cm8gt41kuxxxx1l1d1n2wz8v",
"file_name": "sales_data.csv",
"file_size": 1024
}
headers = {
"x-pd-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-pd-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_id: 'tmm-cm8gt41kuxxxx1l1d1n2wz8v',
file_name: 'sales_data.csv',
file_size: 1024
})
};
fetch('https://ai.data.cloud/api/v2/team/file/init-multipart-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://ai.data.cloud/api/v2/team/file/init-multipart-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 => json_encode([
'user_id' => 'tmm-cm8gt41kuxxxx1l1d1n2wz8v',
'file_name' => 'sales_data.csv',
'file_size' => 1024
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-pd-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://ai.data.cloud/api/v2/team/file/init-multipart-upload"
payload := strings.NewReader("{\n \"user_id\": \"tmm-cm8gt41kuxxxx1l1d1n2wz8v\",\n \"file_name\": \"sales_data.csv\",\n \"file_size\": 1024\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-pd-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.post("https://ai.data.cloud/api/v2/team/file/init-multipart-upload")
.header("x-pd-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"tmm-cm8gt41kuxxxx1l1d1n2wz8v\",\n \"file_name\": \"sales_data.csv\",\n \"file_size\": 1024\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ai.data.cloud/api/v2/team/file/init-multipart-upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-pd-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": \"tmm-cm8gt41kuxxxx1l1d1n2wz8v\",\n \"file_name\": \"sales_data.csv\",\n \"file_size\": 1024\n}"
response = http.request(request)
puts response.read_body{
"code": 0,
"data": {
"upload_id": "5k3EJxAYgtHW1fkbF54ppKEiTWSBeFBQ_01DnFEDSSHChV7w1jpw7SM_KWLkHYXm6Wzaw_NOpMG_OFsi9D5R8Csx9xxxx_m.YuWNjbTMWYIwVKG5rw0VXJZzgWbwSfe",
"file_object_key": "temp/user/tmm-cm8gt41kuxxxx1l1d1n2wz8v/26f6272c-a847-4589-b352-a85471bb5121.csv",
"part_items": [
{
"number": 1,
"size": 1024,
"upload_url": "https://s3.amazonaws.com/powerdrilltest/temp/user/tmm-cm8gt41kuxxxx1l1d1n2wz8v/26f6272c-a847-4589-b352-a85471bb5121.csv?uploadId=5k3EJxAYgtHW1fkbF54ppKEiTWxxxxxx_01DnFEDSSHChV7w1jpw7SM_KWLkHYXm6Wzaw_NOpMG_OFsi9D5R8Csx9DUHbQ_m.YuWNjbTMWYIwVKG5rw0VXJZzgWbwSfe&partNumber=1&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20250402T085840Z&X-Amz-SignedHeaders=host&X-Amz-Expires=86399&X-Amz-Credential=AKIARLSQLXURHEIDN4OZ%2F20250402%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=b7be59679910fabd6603af6b7eb003094498ec7d6ceb47af93253540e734dba3"
}
]
}
}Headers
Body
application/json
Your user ID, which uniquely identifies you within your team. To obtain your ID:
- If you're the team admin, refer to Check user information.
- If you're a system or virtual user, ask your team admin to check your user ID by referring to Check user information.
Response
200 - application/json
Status code. 0 indicates that the operation is successful. Otherwise, the operation fails. For error troubleshooting, refer to Error Codes.