Authorization
X-Storefront-Access-Token
Token-based authentication header in the form of <YOUR_LAYERS_TOKEN>
.
Content-Type
string
default:"multipart/form-data"
required
Accept
string
default:"application/json"
required
Body
Image file to upload. Supported formats: JPEG, JPG, PNG, WebP. Maximum file size: 15MB (15,360 KB).
Response
Status of the upload operation. Returns “success” on successful upload.
Unique UUID identifier for the uploaded image. Use this ID in the Image Search API to perform visual searches.
Usage
The Image Upload endpoint enables a two-step process for visual search:
- Upload the image using this endpoint to receive an
imageId
- Search with the image using the
imageId
in the Image Search API
This approach offers several advantages:
- Better performance: Avoids repeated base64 encoding/decoding
- Caching: Processed image embeddings are cached for faster subsequent searches
- Reduced payload size: Use lightweight UUID instead of large base64 strings
Error Responses
Validation errors returned when the request fails validation.
Common validation errors:
- File required: No image file provided
- Invalid file type: File format not supported (must be JPEG, JPG, PNG, or WebP)
- File too large: Image exceeds 15MB size limit
{
"status": "success",
"imageId": "550e8400-e29b-41d4-a716-446655440000"
}
{
"message": "The given data was invalid.",
"errors": {
"image": [
"The image field is required."
]
}
}
Responses are generated using AI and may contain mistakes.