Prepare a form-element attachment upload
Prepare a 2-step upload for a form-element image. purpose selects the kind:
header_image / wallpaper_image (theme images), rich_text_image, or a
field-element image (choice_image, product_image, booking_image).
Returns a one-time upload_id and an upload_url.
Send the file to upload_url with an HTTP PUT: the raw file bytes as the
request body and the Content-Type header set to the value you declared in
content_type (it must match). Use the upload_url exactly as returned.
Then consume the upload_id: theme images go into a theme update
(header.images[].upload_id / wallpaper.image.upload_id); rich_text_image
is finalized via POST /api/v1/attachment_commitments; field-element images go
into the form create / update fields payload (choices[].image.upload_id,
goods_items[].images[].upload_id, reservation_items[].images[].upload_id).
No PAT scope required.
Authorizations
Personal Access Token prefixed with fh_. Sent as Authorization: Bearer fh_xxx.
The scope required by each endpoint is listed in that endpoint's description.
Body
What this attachment is for. header_image / wallpaper_image are theme images consumed by a theme update; rich_text_image is finalized via POST /api/v1/attachment_commitments; choice_image / product_image / booking_image are field-element images referenced from the form create / update fields payload.
header_image, wallpaper_image, rich_text_image, choice_image, product_image, booking_image Original file name (with extension).
"cover.png"
MIME type. Must be one of image/jpeg, image/png, image/webp, image/gif. Pinned into the upload URL — the PUT must send this exact Content-Type.
"image/png"
File size in bytes. Must be ≤ 5 MB.
123456
Response
Upload credentials issued
Prepare-step response for the 2-step form-element attachment upload. Send the file to upload_url with an HTTP PUT: the raw file bytes as the request body and the Content-Type header set to the value you declared in content_type (it must match). Use upload_url exactly as returned. Then consume the upload_id per its purpose: theme images in a theme update; rich_text_image via POST /api/v1/attachment_commitments; field-element images (choice_image / product_image / booking_image) inside the form create / update fields payload.