Put a picture in an image field
Puts a picture in an image field of business details or an entry, with its alt text, in ONE history entry, and starts the build. The picture is a file of the site's media (media_path), a stock result you chose (stock_id), or a description searched in the free stock library (query, first result imported with its credit). Free: stock pictures cost no credits.
POST/v1/sites/{site_id}/images:place
Requires sites:write. Costs no credits. The path ends in /images:place. Changes the draft only. Visitors see nothing until you publish.
One call for “put a photo here”. target is the image field: business:/hero/image for the home page picture, or <collection>/<slug>:/image for an entry, such as services/sourdough:/image. The content model lists the image fields.
Give exactly one source:
query: a description, in English with concrete words. The free stock library is searched and the first result is imported with its credit.orientationnarrows the shape.stock_id: a result you chose with Search stock media.media_path: a file already in the site’s media, such as the owner’s own photo.
alt is saved in the alt field next to the image when the content has one (imageAlt, for example), and with the media file. The change is one history entry, and the build starts: the response carries build. A search that finds nothing is a 404, and nothing is written.
Authorizations
Authorizationbearerin headerrequiredPath parameters
site_idstringrequiredThe site's id, or its slug (the address before .atelier201.page).
Body
application/jsonrequiredtargetstringrequiredlength: 3–200 charsThe image field: business:/hero/image for business details, or
altstringrequiredlength: 1–300 charsWhat the picture shows, for people who cannot see it, in the site's language. Saved in the alt field next to the image when there is one.
querystringlength: ≤ 100 charsA description searched in the free stock library, in English with concrete words ("minimalist concrete house at dusk"): the first result is imported.
stock_idstringlength: ≤ 20 charsA result id from search_stock_media, when you chose the picture yourself.
media_pathstringlength: ≤ 200 charsA file already in the site's media (/media/storefront.jpg), e.g. the owner's own photo.
orientationenum<string>one of: landscape, portrait, squareWith query: the shape to search for. Landscape suits a hero.
Response
Put a picture in an image field
dataRecord<string, object>requiredrequest_idstringrequiredPossible codes: invalid_request, unknown_field, invalid_parameter, invalid_cursor
errorobjectrequiredrequest_idstringrequiredPossible codes: authentication_required, invalid_api_key, api_key_expired, api_key_revoked
errorobjectrequiredrequest_idstringrequiredPossible codes: insufficient_credits
errorobjectrequiredrequest_idstringrequiredPossible codes: insufficient_scope, feature_not_available, admin_required
errorobjectrequiredrequest_idstringrequiredPossible codes: resource_not_found
errorobjectrequiredrequest_idstringrequiredPossible codes: conflict, result_not_ready, idempotency_key_reused
errorobjectrequiredrequest_idstringrequiredPossible codes: result_expired
errorobjectrequiredrequest_idstringrequiredPossible codes: request_too_large
errorobjectrequiredrequest_idstringrequiredPossible codes: request_too_large_for_plan
errorobjectrequiredrequest_idstringrequiredPossible codes: rate_limited
errorobjectrequiredrequest_idstringrequiredPossible codes: internal_error
errorobjectrequiredrequest_idstringrequiredPossible codes: service_unavailable
errorobjectrequiredrequest_idstringrequired