Capture inventory from a photo
Smart Add is the same pipeline that powers the Dib app: send a photo, get back structured inventory items in seconds. Great for onboarding a user's home fast or letting them snap a picture instead of typing.
1. Send a photo
Pass a public image_url (or an inline image_base64 data URL). You'll get back candidates, each with a confidence score, so your UI can show a quick confirm step before anything is saved.
curl -X POST https://dib.io/api/v1/inventory/smart-add \
-H "Authorization: Bearer $DIB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{ "image_url": "https://example.com/dishwasher.jpg" }'The response gives you everything you need to render a review screen:
{
"data": {
"candidates": [
{
"item": {
"name": "Dishwasher",
"brand": "Bosch",
"model": "SHPM65Z55N",
"category": "Appliances",
"serial_number": null,
"estimated_value": "899.00",
"image_url": "https://..."
},
"confidence": 86,
"field_confidences": [ { "field": "brand", "confidence": 92 } ],
"suggested_destination": "kitchen",
"processing_notes": []
}
],
"saved": [],
"confidence": 86
},
"meta": { "request_id": "req_abc123" }
}2. Save what you keep
Set save: true to persist high-confidence candidates straight to inventory. Tune the bar with confidence_threshold(0β100, defaults to 75). Saved items come back in the saved array and, like any write, show up in the change feed.
curl -X POST https://dib.io/api/v1/inventory/smart-add \
-H "Authorization: Bearer $DIB_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"image_url": "https://example.com/dishwasher.jpg",
"save": true,
"confidence_threshold": 75
}'Good to know
- Needs the
inventory:writescope, and it counts against your team's AI quota (it's a vision call). - Always send an
Idempotency-Keyso a retry doesn't double-add an item. - Inline images must be under 5 MB; for anything larger, host it and pass
image_url.