Images must be uploaded to the server before they can be associated with a product. This endpoint accepts a single file viaDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/MateoNavarroMN/Balsamoa-Backend/llms.txt
Use this file to discover all available pages before exploring further.
multipart/form-data, saves it to disk, and returns a public URL path. That URL is then passed inside the imagenes array when calling the create or update product endpoints.
Request
| Property | Value |
|---|---|
| Method | POST |
| Path | /api/v1/admin/imagenes/subir |
| Content-Type | multipart/form-data |
Body
The image file to upload. Must be sent as a form field named exactly
imagen.Constraints
- Maximum file size: 5 MB. Requests exceeding this limit are rejected with a
400error. - Accepted MIME types:
image/jpeg,image/png,image/webp,image/gif. Any other MIME type is rejected with a400error. - Storage location: Files are saved to the server’s local filesystem under
/src/public/recursos/imagenes/productos/. - Filename sanitization: Spaces in the original filename are replaced with underscores (
_), and a Unix millisecond timestamp is prepended (e.g.,1700000000000_remera_blanca.webp).
Example
Response
201 CreatedHuman-readable confirmation message.
The public URL path for this image. Store this value and include it in the
imagenes array when creating or updating a product.The sanitized filename as saved on disk, including the timestamp prefix.
Error Cases
| Status | Cause | Response body |
|---|---|---|
400 | File exceeds 5 MB (LIMIT_FILE_SIZE) | {"mensaje": "El archivo supera el límite de 5 MB"} |
400 | MIME type not in the allowed list (TIPO_INVALIDO) | {"mensaje": "Solo se aceptan imágenes (jpg, png, webp, gif)"} |
400 | No file field received in the request | {"mensaje": "No se recibió ningún archivo"} |
Typical Workflow
Upload the image
Send a
POST request to /api/v1/admin/imagenes/subir with the image file attached as the imagen form field. The server saves the file and returns a url such as /recursos/imagenes/productos/1700000000000_remera.webp.