curl --request PUT \
--url https://files.adclear.ai/v1/uploads/{uploadId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://files.adclear.ai/v1/uploads/{uploadId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.put(url, headers=headers)
print(response.text)const options = {method: 'PUT', headers: {Authorization: 'Bearer <token>'}};
fetch('https://files.adclear.ai/v1/uploads/{uploadId}', 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://files.adclear.ai/v1/uploads/{uploadId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://files.adclear.ai/v1/uploads/{uploadId}"
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://files.adclear.ai/v1/uploads/{uploadId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://files.adclear.ai/v1/uploads/{uploadId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"uploadId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "uploading",
"bytesReceived": 123,
"correlationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "Missing or malformed Content-Range header. Expected: bytes <start>-<end>/<total|*>",
"details": [
{
"type": "field_error",
"field": "fileName",
"message": "Required"
}
]
},
"correlationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Missing or invalid Bearer token"
},
"correlationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}{
"error": {
"code": "NOT_FOUND",
"message": "Upload not found"
},
"correlationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}{
"error": {
"code": "INVALID_REQUEST",
"message": "Upload is already completed"
},
"correlationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}{
"error": {
"code": "PAYLOAD_TOO_LARGE",
"message": "File size 104857600 exceeds limit of 31457280 bytes for pdf files",
"details": [
{
"type": "constraint_violation",
"constraint": "max_file_size",
"limit": 31457280,
"actual": 104857600
}
]
},
"correlationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}{
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests",
"details": [
{
"type": "retry_info",
"retryAfterSeconds": 30
}
]
},
"correlationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "Internal server error"
},
"correlationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}{
"error": {
"code": "SERVICE_ERROR",
"message": "Storage returned unexpected status 503"
},
"correlationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}Upload chunk
Streams a chunk of file data to the underlying storage. Include a Content-Range header (e.g. bytes 0-1048575/5242880) and send the raw bytes as the request body. When the total is known and this is the final chunk, the upload completes and the status becomes completed.
curl --request PUT \
--url https://files.adclear.ai/v1/uploads/{uploadId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://files.adclear.ai/v1/uploads/{uploadId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.put(url, headers=headers)
print(response.text)const options = {method: 'PUT', headers: {Authorization: 'Bearer <token>'}};
fetch('https://files.adclear.ai/v1/uploads/{uploadId}', 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://files.adclear.ai/v1/uploads/{uploadId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://files.adclear.ai/v1/uploads/{uploadId}"
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://files.adclear.ai/v1/uploads/{uploadId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://files.adclear.ai/v1/uploads/{uploadId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"uploadId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "uploading",
"bytesReceived": 123,
"correlationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "Missing or malformed Content-Range header. Expected: bytes <start>-<end>/<total|*>",
"details": [
{
"type": "field_error",
"field": "fileName",
"message": "Required"
}
]
},
"correlationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Missing or invalid Bearer token"
},
"correlationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}{
"error": {
"code": "NOT_FOUND",
"message": "Upload not found"
},
"correlationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}{
"error": {
"code": "INVALID_REQUEST",
"message": "Upload is already completed"
},
"correlationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}{
"error": {
"code": "PAYLOAD_TOO_LARGE",
"message": "File size 104857600 exceeds limit of 31457280 bytes for pdf files",
"details": [
{
"type": "constraint_violation",
"constraint": "max_file_size",
"limit": 31457280,
"actual": 104857600
}
]
},
"correlationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}{
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests",
"details": [
{
"type": "retry_info",
"retryAfterSeconds": 30
}
]
},
"correlationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "Internal server error"
},
"correlationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}{
"error": {
"code": "SERVICE_ERROR",
"message": "Storage returned unexpected status 503"
},
"correlationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}Authorizations
User token or API key passed as Bearer token
Headers
Workspace ID fallback. Required when authenticating with a Bearer token in environments where cookies cannot be shared (e.g. preview). Not needed for API key auth (workspace is embedded in the key metadata) or when the workspace cookie is present.
"43dc2a1c-3384-41b5-a6e9-3b2d607d0fae"
Required when authenticating with an API key. Identifies the end-user making the request. Ignored when authenticating with a Bearer token (the user ID is extracted from the token).
"user_abc123"
Optional. Email of the external user, used for audit logging. Only applicable when authenticating with an API key.
"user@example.com"
Path Parameters
Upload ID
Response
Chunk accepted or upload completed
Was this page helpful?