Upload a hero image for a deal
POST
/api/canvas/{deal_id}/hero-image
const url = 'https://example.com/api/canvas/example/hero-image';const form = new FormData();form.append('file', 'example');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
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/hero-image \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: multipart/form-data' \ --form file=exampleUpload a hero image, auto-crop to 2.7:1 banner ratio, and persist.
Accepts JPEG, PNG, or WebP up to 10 MB. The image is cropped server-side to a consistent banner aspect ratio matching pipeline-generated heroes.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” deal_id
required
Deal Id
string
Request Body required
Section titled “Request Body required ” Media type multipart/form-data
Body_upload_hero_image_api_canvas__deal_id__hero_image_post
object
file
required
File
string
Responses
Section titled “ Responses ”Successful Response
Media type application/json
HeroImageResponse
Response after a successful hero image upload.
object
public_url
required
Public Url
string
width
required
Width
integer
height
required
Height
integer
aspect_ratio
required
Aspect Ratio
number
Example generated
{ "public_url": "example", "width": 1, "height": 1, "aspect_ratio": 1}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": {} } ]}