curl --request PUT \
--url https://api.moonbounce.ai/v1/uploads/{upload_id}/{token} \
--header 'Content-Type: application/octet-stream' \
--data '<string>'import requests
url = "https://api.moonbounce.ai/v1/uploads/{upload_id}/{token}"
payload = "<string>"
headers = {"Content-Type": "application/octet-stream"}
response = requests.put(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/octet-stream'},
body: '<string>'
};
fetch('https://api.moonbounce.ai/v1/uploads/{upload_id}/{token}', 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://api.moonbounce.ai/v1/uploads/{upload_id}/{token}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "<string>",
CURLOPT_HTTPHEADER => [
"Content-Type: application/octet-stream"
],
]);
$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://api.moonbounce.ai/v1/uploads/{upload_id}/{token}"
payload := strings.NewReader("<string>")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/octet-stream")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.moonbounce.ai/v1/uploads/{upload_id}/{token}")
.header("Content-Type", "application/octet-stream")
.body("<string>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moonbounce.ai/v1/uploads/{upload_id}/{token}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/octet-stream'
request.body = "<string>"
response = http.request(request)
puts response.read_body{
"environment": "production",
"upload_id": "upl_01900000-0000-7000-8000-000000000001",
"kind": "items",
"lines": 240,
"labeled": 200,
"bytes": 412870,
"sha256": "3f1a0c6b5e2d4f8a9b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a0b9c8d7e6f5a",
"expires_at": "2026-11-10T13:00:00Z"
}Send an upload's file
The url createUpload answered: send the file as the body, once (curl -sS -X PUT --data-binary @<file> <url>); the content type is ignored, and no key is needed, as the URL authorizes it. An items file is stored only if every line is valid JSON and a valid example (blank lines are skipped): otherwise 400 UPLOAD_INVALID, with the first issues in details.issues, each message naming its line (from 1) and item, and param the line’s field. A send has 15 minutes to arrive, and no bytes for 60 seconds cuts it off: 400 BODY_INVALID, its message saying whether the same URL takes the file again. A team has at most 10 sends under way at once: past that, 429 RATE_LIMITED with details.limit upload_concurrency and Retry-After. A structure file that doesn’t validate is 400 CONTENT_INVALID, with every issue. A file over its limit is 413 UPLOAD_TOO_LARGE. Nothing is kept from a refused file, and the URL takes another try until it expires. 404 UPLOAD_UNKNOWN for an unknown, expired or mistyped URL; 409 UPLOAD_RECEIVED once its file is stored, with the receipt in details.receipt, and UPLOAD_BUSY while another send of it is under way. A body shorter than its Content-Length is 400 BODY_INVALID. 403 ORG_CLOSED for a closed team. 200 with what was stored: for items, lines and labeled; for a structure, its structure_hash; for both, bytes and the file’s sha256.
curl --request PUT \
--url https://api.moonbounce.ai/v1/uploads/{upload_id}/{token} \
--header 'Content-Type: application/octet-stream' \
--data '<string>'import requests
url = "https://api.moonbounce.ai/v1/uploads/{upload_id}/{token}"
payload = "<string>"
headers = {"Content-Type": "application/octet-stream"}
response = requests.put(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/octet-stream'},
body: '<string>'
};
fetch('https://api.moonbounce.ai/v1/uploads/{upload_id}/{token}', 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://api.moonbounce.ai/v1/uploads/{upload_id}/{token}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "<string>",
CURLOPT_HTTPHEADER => [
"Content-Type: application/octet-stream"
],
]);
$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://api.moonbounce.ai/v1/uploads/{upload_id}/{token}"
payload := strings.NewReader("<string>")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/octet-stream")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.moonbounce.ai/v1/uploads/{upload_id}/{token}")
.header("Content-Type", "application/octet-stream")
.body("<string>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moonbounce.ai/v1/uploads/{upload_id}/{token}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/octet-stream'
request.body = "<string>"
response = http.request(request)
puts response.read_body{
"environment": "production",
"upload_id": "upl_01900000-0000-7000-8000-000000000001",
"kind": "items",
"lines": 240,
"labeled": 200,
"bytes": 412870,
"sha256": "3f1a0c6b5e2d4f8a9b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a0b9c8d7e6f5a",
"expires_at": "2026-11-10T13:00:00Z"
}Path Parameters
^upl_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$The URL's token.
^[A-Za-z0-9_-]{43}$Body
The body is of type file.
Response
The file was stored
- Option 1
- Option 2
What the upload stored.
The environment of the key that made the call: production or test. Evaluations, feedback, reviews and suggestions are separate per environment; decisions and their versions belong to the whole organization.
production, test ^upl_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$The file's size.
The SHA-256 of the file as received, in hex: compare it with your file's (shasum -a 256 <file>).
^[0-9a-f]{64}$How long calls can name the upload: about a day. Upload the file again after that.
items Examples stored, one per non-blank line, in file order (offset 0 first).
Lines with an expected_outcome claim, which a run carries as expected.