Skip to content

Record the original and the crop behind a cropped image​

POST
/image-crops

Every image upload and edit goes through one crop dialog, which uploads the untouched original next to the cropped output and then records here where the crop sits on the original, keyed by the output's URL, so editing the image later reopens the dialog on the original with the crop restored. Both URLs must be images on the FundlyHub CDN: the original an upload into one of the StorageBucket folders, the output that or a processed avatar, organization logo or banner. The caller must own the output: its path begins with their id (an upload or their own avatar), or they may manage that user or organization. Saving again for the same output replaces the record, but only its own author can do that. Requires a bearer session.

Authorizations​

BearerAuth

In the browser, authentication rides on the httpOnly session cookies set by /cognito/signin or the Google / Apple sign-in at /cognito/oauth/{provider}. For scripts and for Swagger UI testing, paste an API key (fh_live_…, created with POST /api-keys); a Cognito JWT is accepted too. Sign-in does not return a token in its body.

Type
HTTP (bearer)

Request Body​

application/json
JSON
{
"output_url": "https://fundlyhub.org/uploads/community-photos/3f6c1b9e-7d2a-4c8e-9b1f-2a4d6e8f0c13/1717171717-crop.jpg",
"original_url": "https://fundlyhub.org/uploads/community-photos/3f6c1b9e-7d2a-4c8e-9b1f-2a4d6e8f0c13/1717171716-original.jpg",
"crop": "string",
"secondary_crop": {
"area": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"zoom": 0,
"rotation": 0
}
}

Responses​

Recorded

application/json
JSON
{
"data": {
"output_url": "string",
"original_url": "string",
"crop": "string",
"secondary_crop": {
"area": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
},
"zoom": 0,
"rotation": 0
},
"created_at": "string"
}
}

Playground​

Server
Authorization
Body

Samples​

Powered by VitePress OpenAPI

Built with VitePress