API Documentation
Access Immopix features programmatically. Edit images, manage properties and integrate AI enhancements into your workflow.
Want to use Immopix in an AI assistant without writing code? That is what the Immopix connector is for.
Note
The API is included in every package. Each API call uses credits, the same way an edit in the web interface does.
Authentication
The Immopix API uses token-based authentication. You can generate and revoke your API token in your account settings.
Send your token in the Authorization header with every request:
Authorization: Token your_api_token
Safe retries
If your connection drops, send the same request again with the same Idempotency-Key. Immopix then does not create the object or the edit job twice.
The optional header applies to POST /properties, POST /photos/upload, POST /photos/edit and POST /jobs/{job_id}/discard.
Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000
- Use a new key for every operation you want to happen.
- The key may contain 1 to 128 visible ASCII characters without spaces. A UUID works well.
- A retry with the same data returns the stored response. The response header
Idempotency-Replayed: truemarks that response. - If you change the data, use a new key. Otherwise the API answers with
409 idempotency_conflict. - The API also stores business errors for that key. After you fix the cause, for example after buying credits, use a new key.
Error handling
On an error the API returns a JSON object with an error field:
{
"error": "no_credits",
"message": "No credits available. Please purchase a credit pack."
}
{
"error": "validation_error",
"message": {"presets": ["Invalid preset: 'sunset'. Valid presets: [...]"]}
}
Error codes
| Code | Status | Description |
|---|---|---|
not_authenticated | 401 | No token was sent |
authentication_failed | 401 | The token is invalid or revoked |
validation_error | 400 | The request is not valid, for example an unknown preset key, an image above 10 MB or in another format, no image source or more than one, presets and custom_prompt together, an unknown photo_id or property_id, or no preset fits the photo. message names the field |
no_credits | 402 | No credits available |
rate_limit_exceeded | 429 | Rate limit reached |
invalid_idempotency_key | 400 | Key is empty, too long or contains spaces |
idempotency_conflict | 409 | The same key was used with different data |
idempotency_in_progress | 409 | The first call is still running. Retry the request after the time in the Retry-After header |
edit_in_progress | 409 | An edit of this photo is already running. Send the request again when it is completed or failed |
reason_required | 400 | POST /jobs/{job_id}/discard: for a refund, this account must give a reason of at least 20 characters in reason |
refund_not_allowed | 403 | POST /jobs/{job_id}/discard: a refund is not possible for this account or this photo at the moment. Nothing was changed |
job_not_completed | 409 | POST /jobs/{job_id}/discard: the job is not completed |
not_active_result | 409 | POST /jobs/{job_id}/discard: the result is no longer the photo's current version |
already_discarded | 409 | POST /jobs/{job_id}/discard: the result was already discarded |
not_discardable | 409 | POST /jobs/{job_id}/discard: the job is not an edit (for example an upscale), or the photo is a gallery preview that is not unlocked |
not_configured | 400 | POST /webhooks/test without a webhook URL |
delivery_failed | 502 | POST /webhooks/test could not be delivered |
not_found | 404 | Resource not found |
Pagination
List endpoints support cursor-based pagination with the limit (default: 20, max: 100) and cursor parameters.
{
"data": [...],
"has_more": true,
"next_cursor": "abc123"
}
Rate limits
60 requests per minute per token. Above that: 429 status with a Retry-After header.
Image limits: max 10 MB per image and max 100 megapixels. Formats: JPEG, PNG, WebP, GIF and HEIC/HEIF (iPhone photos). Immopix stores every image as JPEG: HEIC is converted at upload, and the orientation stays correct. Immopix downloads a URL for at most 30 seconds.
Tutorial: edit an image
The usual workflow: upload the image, wait for the job, fetch the result.
Python
import base64
import time
import uuid
import requests
API_TOKEN = "your_api_token"
headers = {"Authorization": f"Token {API_TOKEN}"}
edit_headers = {**headers, "Idempotency-Key": str(uuid.uuid4())}
# 1. Upload the image
with open("photo.jpg", "rb") as f:
image_base64 = base64.b64encode(f.read()).decode()
response = requests.post(
"https://immopix.ai/api/v1/photos/edit",
headers=edit_headers,
json={
"image_base64": image_base64,
"presets": "auto" # or: ["sunshine", "optimize"]
}
)
job = response.json()
job_id = job["job_id"]
print(f"Job started: {job_id}")
# 2. Poll the job status
while True:
response = requests.get(
f"https://immopix.ai/api/v1/jobs/{job_id}",
headers=headers
)
job = response.json()
if job["status"] == "completed":
print(f"Done: {job['result_url']}")
break
elif job["status"] == "failed":
print(f"Error: {job['error_message']}")
break
time.sleep(2)
cURL
# 1. Upload the image
curl -X POST "https://immopix.ai/api/v1/photos/edit" \
-H "Authorization: Token your_api_token" \
-H "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \
-H "Content-Type: application/json" \
-d '{
"image_url": "https://example.com/photo.jpg",
"presets": "auto"
}'
# Response: {"job_id": "job_abc123", "status": "pending", ...}
# 2. Check the job status
curl "https://immopix.ai/api/v1/jobs/job_abc123" \
-H "Authorization: Token your_api_token"
Your own instructions (custom_prompt)
Instead of presets you can also pass your own instructions:
curl -X POST "https://immopix.ai/api/v1/photos/edit" \
-H "Authorization: Token your_api_token" \
-H "Content-Type: application/json" \
-d '{
"image_url": "https://example.com/photo.jpg",
"custom_prompt": "Make the lawn green, the sky blue, remove the bins"
}'
Tip: use webhooks instead of polling to get notified when a job finishes.
Properties
Properties are containers for the photos of one property.
Lists all properties.
Query Parameters
query | Filters by property name. Any part of the name matches and upper and lower case are the same. |
{
"data": [
{
"id": "prp_abc123",
"name": "Musterstraße 42",
"created_at": "2024-01-15T10:30:00Z",
"photo_count": 12
}
],
"has_more": false
}
Creates a new property.
Request Body
name * | Name of the property |
{
"id": "prp_abc123",
"name": "Musterstraße 42",
"created_at": "2024-01-15T10:30:00Z",
"photo_count": 0
}
Property details with a nested photo list.
{
"id": "prp_abc123",
"name": "Musterstraße 42",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-16T08:00:00Z",
"photos": [
{
"id": "pht_xyz789",
"title": "Wohnzimmer",
"image_type": "indoor",
"current_url": "https://...",
"thumbnail_url": "https://...",
"created_at": "2024-01-15T10:30:00Z"
}
]
}
Updates a property. Parameter: name
Deletes the property and all photos that belong to it. This cannot be undone.
Photos
Lists all photos of a property.
Query Parameters
image_type | Filters by image type. Values: indoor, outdoor, floorplan, other. Any other value returns 400 validation_error. |
{
"data": [
{
"id": "pht_xyz789",
"title": "Wohnzimmer",
"image_type": "indoor",
"current_url": "https://...",
"thumbnail_url": "https://...",
"created_at": "2024-01-15T10:30:00Z"
}
],
"has_more": false
}
Photo details with revision history and URLs.
{
"id": "pht_xyz789",
"property_id": "prp_abc123",
"title": "Wohnzimmer",
"filename": "api_upload.jpg",
"image_type": "indoor",
"floorplan_type": "",
"current_url": "https://...",
"thumbnail_url": "https://...",
"revisions": [
{
"id": "3f2c9a4e-8b1d-4c7a-9e55-0d6f1b2a7c31",
"version": 2,
"is_original": false,
"is_active": true,
"url": "https://...",
"width": 2048,
"height": 1536,
"presets": ["optimize_indoor", "declutter_indoor"],
"custom_prompt": false,
"created_at": "2024-01-15T10:31:10Z"
}
],
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:31:10Z"
}
Sends an image for AI enhancement.
Request Body
image_base64 | Base64-encoded image data |
image_url | URL of the image (publicly reachable) |
photo_id | Edit an existing photo again |
presets | Array of preset keys or "auto". GET /presets returns all keys. |
custom_prompt | Your own instructions (max. 1000 characters). Core rules are applied automatically. |
property_id | Link the photo to a property |
edit_mode | "outdoor", "indoor" or "floorplan". Without it, the mode follows from the presets, or with "auto" from the image recognition. |
lock_camera_angle | Keep the camera angle (boolean) |
room_type | Room type for furnishing. Values: living_room, bedroom, kitchen, bathroom, kids_room, dining_room, hallway, home_office (private study), office (commercial office), garage, basement, dressing_room. Detected automatically when you leave it out. |
furniture_style | Furniture style for staging. Values: modern, skandinavisch, klassisch, landhausstil, industriell. Detected automatically when you leave it out. |
furniture_instructions | Optional furnishing wishes, up to 2,000 characters. For indoor staging, with or without a furniture style. Specific wishes override style defaults and apply only to furnishings. |
intensity | "normal" (default) or "subtle" for a more restrained edit. |
resolution | "2K" (default) or "4K". 4K uses 2 credits. |
You must provide image_base64, image_url or photo_id.
Send either presets or custom_prompt, not both. Without either, "auto" applies. Floor plans have no automatic edit: send exactly one floorplan preset, or the API answers with 400 validation_error for an existing photo.
"auto": Immopix recognizes whether the photo was taken indoors or outdoors and improves what is in the image. Outdoors: sunshine, optimize, declutter. Indoors: optimize_indoor, declutter_indoor. On a building site the construction materials stay, and indoors only optimize_indoor applies. "auto" never adds furniture or decorations (staging, details). You choose these presets explicitly.
For a new image (image_base64 or image_url), and for a photo whose recognition after POST /photos/upload is still running, Immopix recognizes the image type after the request. Until then the job stays pending with empty presets, usually for a few seconds. If the image is a floor plan or its type cannot be recognized, the job ends as failed and the credit is refunded. With edit_mode or your own presets, there is no recognition step.
The current values for presets, room_type and furniture_style come from GET /presets. Note that furniture_style keys are German words.
Available presets
Use "auto" for automatic detection, or pick your own presets for each photo. GET /presets returns the complete, current list.
Response
{
"job_id": "job_abc123",
"photo_id": "pht_xyz789",
"status": "pending"
}
Uploads a photo without starting an edit. No credits are used. The photo is stored, categorised and ready to edit in the dashboard.
Request Body
image_base64 | Base64-encoded image data |
image_url | URL of the image (publicly reachable) |
property_id | Link the photo to a property (optional, default: "API Uploads") |
You must provide image_base64 or image_url (exactly one).
Response (201)
{
"photo_id": "pht_xyz789",
"property_id": "prp_abc123",
"property_url": "https://immopix.ai/app/property/prp_abc123/"
}
Deletes the photo and all its revisions.
Jobs
Check the job status. Status: pending | processing | completed | failed
{
"job_id": "job_abc123",
"photo_id": "pht_xyz789",
"status": "completed",
"presets": ["optimize_indoor", "declutter_indoor"],
"custom_prompt": false,
"qa": {
"status": "passed",
"risk_score": 1,
"reason": "Fenster, Türen und Wände sind unverändert.",
"checked_at": "2024-01-15T10:31:40Z"
},
"discarded_at": null,
"result_url": "https://...",
"width": 2048,
"height": 1536,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:31:40Z"
}
result_url, width, height only with status: "completed".
error_message only with status: "failed". The message is always in German, also when the account language is English.
presets are the presets the job applies, resolved by the rules above. custom_prompt: true means that the job follows your own instruction instead of presets, and presets is then empty. Every revision of GET /photos/{id} also carries presets and custom_prompt.
discarded_at is the time when the result was discarded. This applies to POST /jobs/{job_id}/discard and to the web interface, for example "Refund the credit only" or "Try again". While the result stands, the value is null. After a discard the status stays completed, and result_url still points to the discarded result. Do not show that result any more. GET /photos/{photo_id} gives the photo's current version.
result_url, width and height describe the result as published at completion. If Immopix straightened converging verticals automatically, this is already the straightened image. The URL stays the same for the lifetime of the version, on every poll and every webhook retry. Later manual changes in the editor do not change this file. GET /photos/{photo_id} gives the current view.
Quality check (qa)
Immopix checks every result automatically: are the windows, doors, walls and ceilings preserved? The check runs after the job is completed and usually takes less than a minute. The webhook carries the same qa object. A job that has no check result 30 minutes after completion shows not_checked.
pending | The check is not finished yet. The result comes with the job.qa_completed webhook. |
passed | The check found no fault. |
warning | The check probably found a fault (risk_score 8 or higher). The web interface shows a notice for this result. Show your users the same notice. |
minor_issue | The check found a difference with a lower risk (risk_score below 8). The web interface shows no notice. |
not_checked | There is no check result and usually none will come: for floor plans, upscales, failed jobs, and when the check ended without a result. When a check waited in the queue for a very long time, its result can in rare cases still come after not_checked. |
risk_score (1 to 10), reason (the explanation, in the account's language) and checked_at are only set with a check result. Otherwise they are null or empty.
Discards the result of a job and refunds its credits. This is the money-back guarantee of the web interface ("Refund the credit only") with the same rules. The photo then shows the version from before this result again.
Request body (optional)
reason | What is wrong with the result, at most 500 characters. After a great many refunds in the last 30 days, Immopix asks for at least 20 characters. Otherwise the API answers with 400 reason_required. |
The refund is what the job cost. A free revision refunds 0 credits and gives the free revision back.
You can only discard a completed job whose result is the photo's current version. A second call for the same job answers with 409 already_discarded and refunds nothing. The same answer comes when someone rejected the result in the web interface, for example with "Try again". After a discard the job shows discarded_at.
Accounts without a purchase and accounts with a great many refunds get no credits back (403 refund_not_allowed). They can still discard a free revision.
Response
{
"job_id": "job_abc123",
"photo_id": "pht_xyz789",
"credits_refunded": 1,
"credits_remaining": 24,
"current_url": "https://..."
}
credits_remaining is your balance after the refund. current_url is the version the photo shows now.
Presets
This endpoint returns every option an edit accepts. That keeps your integration current, without hard-coding the values.
Lists all presets, furniture styles and room types.
The key values are stable identifiers, while label and description are returned in German.
Response
{
"presets": [
{
"key": "optimize",
"edit_mode": "outdoor",
"label": "Belichtung optimieren",
"description": "Helligkeit, Farben & Kontrast verbessern"
},
{
"key": "staging",
"edit_mode": "indoor",
"label": "Virtuell möblieren",
"description": "Leere Räume mit passenden Möbeln einrichten"
},
{
"key": "floorplan_3d",
"edit_mode": "floorplan",
"label": "3D Grundriss",
"description": "2D-Grundriss in eine 3D-Ansicht umwandeln"
}
...
],
"furniture_styles": ["modern", "skandinavisch", ...],
"room_types": [
{"key": "living_room", "label": "Wohnzimmer"},
{"key": "bedroom", "label": "Schlafzimmer"}
...
]
}
You put the key values straight into POST /api/v1/photos/edit: presets from presets, room_type from room_types and furniture_style from furniture_styles.
edit_mode assigns each preset to one mode: outdoor, indoor or floorplan. Use only presets from the mode you send in the request.
Without presets, or with "auto", Immopix picks suitable presets for the image (rules).
Webhooks
You configure webhook URLs in your account settings. Events: job.completed, job.failed, job.qa_completed. Immopix sends them for every edit in the account, also for edits in the web interface.
{
"event": "job.completed",
"job": {
"id": "job_abc123",
"photo_id": "pht_xyz789",
"status": "completed",
"presets": ["sunshine", "optimize", "declutter"],
"custom_prompt": false,
"qa": {
"status": "pending",
"risk_score": null,
"reason": "",
"checked_at": null
},
"discarded_at": null,
"created_at": "2024-01-15T10:30:00Z",
"result_url": "https://...",
"width": 2048,
"height": 1536
}
}
job.completed comes right after the edit. The quality check runs after it, so it usually carries "qa": {"status": "pending"}. When the check ends, Immopix sends job.qa_completed with the same job object and the result in qa, also when the check gives no result (not_checked). When job.completed already carries not_checked, for example for floor plans, no further event follows. When the result was discarded before the check ended (discarded_at), Immopix sends no job.qa_completed.
Events can arrive out of order. For example, a retried job.completed can arrive after job.qa_completed. Match each event by its job ID and read the state of the check from qa.status. A pending does not replace a check result that you already have. When no job.qa_completed arrives, check the job once with GET /jobs/{job_id} about 30 minutes after completion.
The job object in the webhook has the same fields as GET /jobs/{job_id}, with three differences: the job ID is id in the webhook, not job_id. The webhook has no updated_at. The webhook leaves out error_message when the message is empty.
Retry policy: up to 4 attempts: at once, then after 1, 5 and 30 minutes. An attempt succeeds when your server answers within 10 seconds with a status below 400. Immopix does not follow redirects.
Immopix switches the webhook off only when no delivery succeeded for at least 24 hours and at least 4 attempts failed in that time. Only two kinds of URL switch it off at once: a URL whose host is a private or internal IP address written out (for example 127.0.0.1 or 10.0.0.5), and a URL that does not start with http or https. A host name that points to a private address counts as a normal failed attempt. Immopix then tries again, and the 24-hour rule applies. When Immopix switches the webhook off, the account owner gets an email. While the webhook is off, Immopix sends no events and does not send them later. Check the status with GET /jobs/{job_id} instead. When you switch the webhook on again in your account settings, the count starts again.
Signature verification
Every webhook carries an X-Immopix-Signature header (HMAC-SHA256).
import hmac
import hashlib
def verify_signature(payload: bytes, signature: str | None, secret: str) -> bool:
if not signature:
return False
expected = hmac.new(secret.encode(), payload, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected.encode(), signature.encode())
# In your webhook handler:
signature = request.headers.get("X-Immopix-Signature")
if not verify_signature(request.data, signature, WEBHOOK_SECRET):
return "Invalid signature", 401
const crypto = require('crypto');
function verifySignature(payload, signature, secret) {
if (typeof signature !== 'string') return false;
const expected = Buffer.from(crypto.createHmac('sha256', secret).update(payload).digest('hex'));
const received = Buffer.from(signature);
if (received.length !== expected.length) return false;
return crypto.timingSafeEqual(expected, received);
}
Credits
The API uses the same credit system as the web interface. You find the details on our pricing page. A no_credits error means your credits are used up.