Uploading images
Upload images of a property to a portfolio, one image per call. An upload takes three steps:
- Create the upload with
POST /v1/uploads. The answer holds a signed POST. - Send the file with that signed POST, within 30 minutes.
- Follow the upload with
GET /v1/uploads/{upload_id}until it isdoneorfailed.
Every field, limit and error code is in the Image uploads reference. Send your API key in the X-API-Key header of every call to the API.
Before you upload
- Never guess the date.
date_takenis the date the photo was taken, asYYYY-MM-DD. If you do not know it, do not send today's date or any other made-up date, and do not upload the image. A date in the future is refused. - Send the real image type when you know it.
image_typeis one ofaerial,drawing,drone,handheld,interior,other,satellite,streetvieworunspecified. Withunspecifiedthe platform decides the type itself, which takes longer. A type you send is never checked or changed. - Room type is for interior images only.
room_typeis used only for an image of typeinterior. With any other image type it is accepted and has no effect. - Addresses only. Every upload is for a property with an address that exists in the portfolio; it is never created. Estates, groups and communal areas without an address are not supported; a reference to one returns
address_not_found. - One image per call. The API is for ongoing uploads, not for loading a large backlog.
- JPEG or PNG, more than 0 bytes and at most 83886080 bytes (80 MB). This is the size of the file you send with the signed POST, not of the create request.
Step 1: create the upload
Send the portfolio, the address, the date, the image type and the file's name, type and size. Give the address either as your own client_reference, or as the postal fields country_code, postal_code, street_name and street_number with an optional street_number_addition, never both. Leave out street_number_addition only when the address has none: without it, addresses with and without an addition all match, and more than one match returns address_ambiguous.
Every create needs an Idempotency-Key header: a value you choose, unique for each image, for example a UUID.
curl -X POST https://api.spotr.ai/v1/uploads \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Idempotency-Key: 6f1c2a9e-3b7d-4c55-9a10-2e8f4b7d1c3a" \
-d @create-upload.json
The body, in create-upload.json:
{
"portfolio_id": "135",
"address": {
"client_reference": "A-000123"
},
"date_taken": "2026-11-03",
"image_type": "interior",
"room_type": "kitchen",
"file": {
"name": "kitchen-01.jpg",
"content_type": "image/jpeg",
"size_bytes": 2483112
}
}
The same image with the postal fields of the address:
{
"portfolio_id": "135",
"address": {
"country_code": "NL",
"postal_code": "1234AB",
"street_name": "Examplestreet",
"street_number": "10",
"street_number_addition": "A"
},
"date_taken": "2026-11-03",
"image_type": "interior",
"room_type": "kitchen",
"file": {
"name": "kitchen-01.jpg",
"content_type": "image/jpeg",
"size_bytes": 2483112
}
}
The answer is 201 Created. Its Location header is the address of the status of the upload, and its body holds the signed POST:
{
"upload_id": "upl_0123456789abcdef0123456789abcdef",
"status": "awaiting_file",
"upload": {
"method": "POST",
"url": "https://storage.example.com/",
"fields": {
"Content-Type": "image/jpeg",
"key": "uploads/upl_0123456789abcdef0123456789abcdef",
"policy": "eyJleGFtcGxlIjogInBvbGljeSJ9",
"x-amz-algorithm": "AWS4-HMAC-SHA256",
"x-amz-credential": "EXAMPLE/20261129/eu-central-1/s3/aws4_request",
"x-amz-date": "20261129T140000Z",
"x-amz-signature": "0123456789abcdef"
}
},
"expires_at": "2026-11-29T14:30:00Z"
}
The address in upload.url and the names and values in upload.fields are placeholders here. Use exactly what your answer holds.
Step 2: send the file
Send the file as a multipart/form-data POST to upload.url: not to the API, and without your API key. Send every entry of upload.fields as a form field, unchanged, and the file as the last field, named file. The file must be of the content_type and exactly the size_bytes you announced, or the POST is refused. A successful POST is answered with 204 No Content.
curl -X POST "UPLOAD_URL" \
--form-string "Content-Type=image/jpeg" \
--form-string "key=FIELD_VALUE" \
--form-string "policy=FIELD_VALUE" \
--form-string "x-amz-algorithm=FIELD_VALUE" \
--form-string "x-amz-credential=FIELD_VALUE" \
--form-string "x-amz-date=FIELD_VALUE" \
--form-string "x-amz-signature=FIELD_VALUE" \
-F "file=@kitchen-01.jpg;type=image/jpeg"
Send the file before expires_at: the signed POST is valid for 30 minutes. After that the upload fails with upload_expired, and a new upload has to be created, with a new Idempotency-Key. Create a new upload too when too little time is left to send the file.
Step 3: following an upload
After the file is sent, follow the upload until it is done or failed. Read the address of its status from the Location header of the create answer; it ends with the upload_id.
curl https://api.spotr.ai/v1/uploads/upl_0123456789abcdef0123456789abcdef \
-H "X-API-Key: YOUR_API_KEY"
Any API key of your organization may read the status of an upload, not only the key that created it.
The statuses
| Status | What it means |
|---|---|
awaiting_file | The upload waits for its file. Send the file with the signed POST before expires_at. |
processing | The file arrived and is being checked and processed. |
done | Final. The image is stored for the address in the portfolio. |
failed | Final. The image was not added. error.type says why and error.detail says what to do. |
done and failed never change again.
How to poll
- Poll every 5 seconds, not faster.
- Stop polling when the status is
doneorfailed. Both are final. - An image usually takes a few minutes. When many images are waiting it can take up to 60 minutes; then the upload fails with
processing_timeout. - After a 429, wait for the number of seconds in
Retry-After(1 second when the header is not sent) and continue. Do not switch to another key.
By default an API key may read 50 statuses per second, with a burst of 100; Spotr can set another limit for one key. This limit is counted apart from the limits on creating uploads, so following uploads never uses up the budget for creating them.
{
"type": "rate_limited",
"title": "A short name of the problem.",
"status": 429,
"detail": "What to do about it.",
"limit": "reads_per_second"
}
What done tells you
done means the image is stored for the address in the portfolio. The answer holds no image id and no link.
A complete example
One image, from create to done, in one sequence.
1. Create the upload. The body is the one in step 1.
curl -i -X POST https://api.spotr.ai/v1/uploads \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Idempotency-Key: 6f1c2a9e-3b7d-4c55-9a10-2e8f4b7d1c3a" \
-d @create-upload.json
The answer is 201 Created, with Location: https://api.spotr.ai/v1/uploads/upl_0123456789abcdef0123456789abcdef and the signed POST in its body. A status read at this point, before the file is sent, shows the upload waiting for its file:
{
"upload_id": "upl_0123456789abcdef0123456789abcdef",
"status": "awaiting_file",
"created_at": "2026-11-29T14:00:00Z",
"updated_at": "2026-11-29T14:00:00Z",
"expires_at": "2026-11-29T14:30:00Z"
}
2. Send the file to upload.url, with every entry of upload.fields and the file last, as in step 2. The answer is 204 No Content.
3. Poll the address in Location every 5 seconds until the status is done or failed:
STATUS_URL="https://api.spotr.ai/v1/uploads/upl_0123456789abcdef0123456789abcdef"
while true; do
CODE=$(curl -s -o status.json -D headers.txt -w '%{http_code}' "$STATUS_URL" \
-H "X-API-Key: YOUR_API_KEY")
if [ "$CODE" = "429" ]; then
WAIT=$(grep -i '^retry-after:' headers.txt | tr -dc '0-9')
sleep "${WAIT:-1}"
continue
fi
if [ "$CODE" != "200" ]; then
echo "Stopped on HTTP $CODE:"; cat status.json
break
fi
STATUS=$(jq -r .status status.json)
echo "$STATUS"
case "$STATUS" in done|failed) break ;; esac
sleep 5
done
After a 429 the loop waits for the number of seconds in Retry-After, or 1 second when the header is not sent, and continues. Any other error ends the loop: its body says what to do.
While the image is being processed:
{
"upload_id": "upl_0123456789abcdef0123456789abcdef",
"status": "processing",
"created_at": "2026-11-29T14:00:00Z",
"updated_at": "2026-11-29T14:02:10Z"
}
Final, the image is stored. Stop polling:
{
"upload_id": "upl_0123456789abcdef0123456789abcdef",
"status": "done",
"created_at": "2026-11-29T14:00:00Z",
"updated_at": "2026-11-29T14:06:45Z"
}
When an upload fails
A failed upload is final too. Stop polling, and act on error.type:
{
"upload_id": "upl_0123456789abcdef0123456789abcdef",
"status": "failed",
"created_at": "2026-11-29T14:00:00Z",
"updated_at": "2026-11-29T14:02:30Z",
"error": {
"type": "invalid_image",
"detail": "The file could not be read as an image. It may be damaged or cut off."
}
}
| Code | What it means | What to do | Send the same file again? |
|---|---|---|---|
malware_detected | The file failed the malware scan. | Do not send this file again. Check the source of the file. | No |
unsupported_file_type | The file is not a JPEG or PNG, is not of the content type announced at create, or could not be scanned. | Send a JPEG or PNG file and announce its real content type in a new upload. | Only if it is a JPEG or PNG, announced with its real content type |
invalid_image | The file starts as a JPEG or PNG image but cannot be decoded. | Check that the file opens as an image, then send it again in a new upload. | Only once it opens as an image |
image_too_large | The width times the height of the image is above the limit in pixels. | Make the image smaller in pixels and send it in a new upload. | No, a smaller one |
address_not_found | The address left the portfolio after the upload was created. | Check the address in the portfolio, then create a new upload. | Yes, once the address is right |
portfolio_not_allowed | The portfolio was taken off the API key, or is no longer usable, after the upload was created. | Check which portfolios the API key may use, then create a new upload. | Yes, once the key may use the portfolio |
api_access_not_enabled | The organization was switched off for uploads after the upload was created. | Contact Spotr to enable API access, then create a new upload. | Yes, once API access is enabled |
internal_error | A fault on our side stopped the upload. | Create a new upload and send the file again later. | Yes, later |
upload_expired | The file did not arrive before the signed POST of the upload expired. | Create a new upload and send the file within 30 minutes, before its expires_at. | Yes, in a new upload |
processing_timeout | The file arrived, but the image was not processed in time. | Create a new upload with the same file later. Contact Spotr support if it keeps happening. | Yes, later |
processing_failed | The image passed every check but could not be processed in time, after one or more failed tries. | Create a new upload with the same file. Contact Spotr support if it fails again. | Yes |
An unknown upload_id, an upload of another organization, and an upload removed 30 days after it became done or failed all answer 404 upload_not_found.
Sending a request again: the idempotency key
If you sent a create and got no response, send the same request again with the same Idempotency-Key.
- Within 30 minutes, the same key with the same body returns the same upload: the same
upload_idand the same link. No second upload is created. - The same key with a different body is refused with 409
idempotency_conflict. Use a new key for a different image. - The same key while the first request with it is still running is refused with 409
idempotency_conflicttoo. It is the same image, so keep the key. - After 30 minutes the key is forgotten, and a request with it creates a new upload.
Sending the same image twice does no harm: the platform stores an image once.
Limits
Per API key:
| Limit | Default |
|---|---|
| Creates per second | 5, with a burst of 10 |
| Creates per day (UTC) | 1,000 |
| Uploads in progress (waiting for their file, or being processed) | 200 |
Over a limit the answer is 429 rate_limited, with a Retry-After header in seconds and the name of the limit in limit: per_second, per_day or in_progress. Wait for that number of seconds (1 second when the header is not sent), then send the same request again. The limits are per key: do not switch to another key. A request sent again with the same Idempotency-Key after a successful create gets its first answer and is not counted.
{
"type": "rate_limited",
"title": "A short name of the problem.",
"status": 429,
"detail": "What to do about it.",
"limit": "per_second"
}
Errors
Every error is in the Problem Details form (RFC 9457), with a stable type to branch on and a detail that says what to do. For example, when no address in the portfolio matches:
{
"type": "address_not_found",
"title": "Address not found",
"status": 422,
"detail": "What to do about it."
}
| Status | type | What it means |
|---|---|---|
| 400 | invalid_request | The request does not match the description. errors lists every part at fault. |
| 401 | invalid_api_key | The API key is missing or not valid. |
| 403 | api_access_not_enabled | Your organization is not set up for uploads. |
| 403 | portfolio_not_allowed | The key may not use this portfolio. |
| 409 | idempotency_conflict | The Idempotency-Key was used with a different request, or that request is still running. |
| 422 | address_not_found | No address in the portfolio matches. |
| 422 | address_ambiguous | More than one address in the portfolio matches. |
| 429 | rate_limited | A limit is reached; limit names it. |
| 500 | internal_error | A fault on our side. Sending the same request again at once will not help; try again later, and contact Spotr support if it keeps failing. |
| 503 | service_unavailable | A fault on our side that a retry can fix. Send the request again after the number of seconds in Retry-After. |
A request body above 10 MB is refused with 413 and a plain text body, not in the error format.