import requests
url = "https://app.strandai.com/api/v1/uploads"
payload = {
"filename": "<string>",
"fileSize": 123,
"contentType": "<string>",
"contentSha256": "<string>",
"autoSegment": True,
"mpp": 50
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://app.strandai.com/api/v1/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filename": "<string>",
"fileSize": 123,
"contentType": "<string>",
"contentSha256": "<string>",
"autoSegment": true,
"mpp": 50
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filename: '<string>',
fileSize: 123,
contentType: '<string>',
contentSha256: '<string>',
autoSegment: true,
mpp: 50
})
};
fetch('https://app.strandai.com/api/v1/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://app.strandai.com/api/v1/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([
'filename' => '<string>',
'fileSize' => 123,
'contentType' => '<string>',
'contentSha256' => '<string>',
'autoSegment' => true,
'mpp' => 50
]),
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://app.strandai.com/api/v1/uploads"
payload := strings.NewReader("{\n \"filename\": \"<string>\",\n \"fileSize\": 123,\n \"contentType\": \"<string>\",\n \"contentSha256\": \"<string>\",\n \"autoSegment\": true,\n \"mpp\": 50\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://app.strandai.com/api/v1/uploads")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filename\": \"<string>\",\n \"fileSize\": 123,\n \"contentType\": \"<string>\",\n \"contentSha256\": \"<string>\",\n \"autoSegment\": true,\n \"mpp\": 50\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.strandai.com/api/v1/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 \"filename\": \"<string>\",\n \"fileSize\": 123,\n \"contentType\": \"<string>\",\n \"contentSha256\": \"<string>\",\n \"autoSegment\": true,\n \"mpp\": 50\n}"
response = http.request(request)
puts response.read_body{
"uploadId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"gcsPath": "<string>",
"existing": true,
"uploadUrl": "<string>"
}{
"error": "<string>",
"message": "<string>",
"required": 123,
"retryAfterSeconds": 123
}Initiate upload
Initiate a resumable upload by registering an H&E slide’s filename, size, and content type, and receive a signed GCS URL to PUT the slide bytes to.
import requests
url = "https://app.strandai.com/api/v1/uploads"
payload = {
"filename": "<string>",
"fileSize": 123,
"contentType": "<string>",
"contentSha256": "<string>",
"autoSegment": True,
"mpp": 50
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://app.strandai.com/api/v1/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filename": "<string>",
"fileSize": 123,
"contentType": "<string>",
"contentSha256": "<string>",
"autoSegment": true,
"mpp": 50
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filename: '<string>',
fileSize: 123,
contentType: '<string>',
contentSha256: '<string>',
autoSegment: true,
mpp: 50
})
};
fetch('https://app.strandai.com/api/v1/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://app.strandai.com/api/v1/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([
'filename' => '<string>',
'fileSize' => 123,
'contentType' => '<string>',
'contentSha256' => '<string>',
'autoSegment' => true,
'mpp' => 50
]),
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://app.strandai.com/api/v1/uploads"
payload := strings.NewReader("{\n \"filename\": \"<string>\",\n \"fileSize\": 123,\n \"contentType\": \"<string>\",\n \"contentSha256\": \"<string>\",\n \"autoSegment\": true,\n \"mpp\": 50\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://app.strandai.com/api/v1/uploads")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filename\": \"<string>\",\n \"fileSize\": 123,\n \"contentType\": \"<string>\",\n \"contentSha256\": \"<string>\",\n \"autoSegment\": true,\n \"mpp\": 50\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.strandai.com/api/v1/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 \"filename\": \"<string>\",\n \"fileSize\": 123,\n \"contentType\": \"<string>\",\n \"contentSha256\": \"<string>\",\n \"autoSegment\": true,\n \"mpp\": 50\n}"
response = http.request(request)
puts response.read_body{
"uploadId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"gcsPath": "<string>",
"existing": true,
"uploadUrl": "<string>"
}{
"error": "<string>",
"message": "<string>",
"required": 123,
"retryAfterSeconds": 123
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Optional client-computed SHA-256. On a match within the calling organization, the response returns the existing upload and skips byte transfer.
^[0-9a-f]{64}$Opt out of automatic cell segmentation for this upload. Defaults to the organization's autoSegmentDefault (true unless changed). When false, the slide is ingested and rendered but no segmentation job runs; marker runs still work but without cell-level readouts until segmented.
Optional user-reported microns per pixel, for callers that already know their slide's scale. Slides are isotropic: pass a number, or an { x, y } object whose axes are equal (anisotropic input is rejected). Persisted on the sample at creation and takes precedence over the slide's own calibrated value, so POST /predict works as soon as preprocessing finishes — no follow-up PATCH /samples/{id} needed. Ignored when contentSha256 deduplicates to an existing sample (that sample's scale stands).
0 < x <= 100Was this page helpful?