Upload a media file
Send the file as the raw request body with ?filename=. Images, PDF and short videos, 20 MB each. A picture over 200 KB is compressed when it arrives (2000 px at most, towards 150 KB, sharp on Retina, metadata removed); keep_original=true stores it exactly as sent, only when the owner asks. Reference it as /media/
POST/v1/sites/{site_id}/media
Requires sites:write. Costs no credits.
Send the file’s bytes as the request body, with the name in filename. Each file can be 20 MB, within the plan’s storage. Reference it as /media/<filename> in content. It is included from the next build, and visitors see nothing until you publish.
Authorizations
Authorizationbearerin headerrequiredPath parameters
site_idstringrequiredThe site's id, or its slug (the address before .atelier201.page).
Query parameters
filenamestringrequiredlength: 1–160 charsaltstringlength: ≤ 300 charskeep_originalbooleantrue keeps the file exactly as sent, at full quality and weight: only when the owner asks for it (a photographer's work). By default a picture over 200 KB is compressed when it arrives.
Response
Upload a media file
dataobjectrequiredrequest_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