Platitun · API · Listings · The listing image

The listing image

PUT /api/v1/listings/{number}/image

Key scope: listings · changes data, the Idempotency-Key header is required

The request body is the image BYTES themselves, not JSON: that is what the cabinet form does too. The file type is determined by content, not by name and not by header: the header cannot be trusted here.

Request fields

FieldTypeWhat it is
(тело) requiredbinaryThe image bytes. Ordinary image formats are allowed; the size limit is the same as in the cabinet.

Response fields

FieldTypeWhat it is
imagestringThe stored file name.

Refusal reasons

A rule refusal arrives as {"error":"rejected","refusal":{"kind":"…"}} with status 409. Refusals common to all endpoints are in the rules section.

CodeWhat happened and what to do
not_foundThe record does not exist or is not yours. The ownership condition is in the database query itself, so someone else’s record looks like a missing one.
image_too_bigThe image exceeds the allowed size. Shrink it and send again.
image_bad_typeThis is not an image of an allowed type. The type is determined by file content, not by name: renaming will not help.

Nearby in this section