Upload API Reference
This section explains how to upload an image for editing by sending a direct request to our API.
Uploading an image for editing via API
Image upload endpoint allows you to upload an image directly from your computer or server for editing, instead of providing an image URL.
To upload an image, attach an image file as body part of multipart/form-data
. The other body part of multipart/form-data
should be the same as JSON for a regular image editing request, except there is no input
image URL option there. See Image edit contract for more info.
Request
Request headers
In order to send a request, you should set a Content-Type
header to let our system know that you are providing a valid form data payload and an Authorization
header with a generated API key to identify yourself as a Claid user.
The form data payload should have two blocks of data (body parts), with a delimiter (boundary) separating each block.
The block with an image file should have a Content-Disposition
header equal to form-data
with two required keys: a name
key with a value equal to file
and a filename
key that will be assigned to an output result image (it is better not to include the extension in a filename
, as it can be overwritten by Output options).
The block with edit operations should have two headers: a Content-Disposition
header equal to form-data
with a name
key with a value equal to data
and a Content-Type
header to let our system know that you are providing a valid JSON payload.
Response body and headers
The response body and headers is equal to response body and headers of regular image edit request. See the Read a response and Response Headers to learn more.
Last updated