Re-crop an image element
POST
/api/canvas/{deal_id}/images/{element_id}/recrop
const url = 'https://example.com/api/canvas/example/images/example/recrop';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"user_bbox":{"additionalProperty":1},"bbox_mode":"freeform"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” deal_id
required
Deal Id
string
element_id
required
Element Id
string
Request Body required
Section titled “Request Body required ” 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
Responses
Section titled “ Responses ”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
null
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>
ValidationErrorobject
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": {} } ]}