Skip to content

Re-crop an image element

POST
/api/canvas/{deal_id}/images/{element_id}/recrop
curl --request POST \
--url https://example.com/api/canvas/example/images/example/recrop \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "user_bbox": { "additionalProperty": 1 }, "bbox_mode": "freeform" }'

Re-crop an image element with a user-specified fractional bounding box.

Fetches the full-page render, performs a server-side Pillow crop, and saves a versioned PNG. Broadcasts IMAGE_RECROPPED to all viewers.

deal_id
required
Deal Id
string
element_id
required
Element Id
string
Media type application/json
RecropRequest

Request body for image re-crop.

object
user_bbox
required
User Bbox
object
key
additional properties
number
bbox_mode
Bbox Mode
string
default: freeform

Successful Response

Media type application/json
RecropResponse

Response for a successful re-crop.

object
versioned_url
required
Versioned Url
string
version
required
Version
integer
element_id
required
Element Id
string
diff_summary
Any of:
DiffSummaryResponse

Inline diff between original pipeline crop and user correction.

object
iou_with_original
required
Iou With Original
number
area_delta_pct
required
Area Delta Pct
number
hint
required
Hint
string
is_significant
required
Is Significant
boolean
Example generated
{
"versioned_url": "example",
"version": 1,
"element_id": "example",
"diff_summary": {
"iou_with_original": 1,
"area_delta_pct": 1,
"hint": "example",
"is_significant": true
}
}

Validation Error

Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Example generated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}