Upload Category Image (v1)
Method + Path
POST /v1/workspace/:workspaceId/storefront/categories/:categoryId/image
Actual backend path: /v1/workspace/:workspaceId/storefront/categories/:categoryId/image
Description
Upload an image for a storefront category.
Authentication
Required - JWT token in Authorization header
Required Permissions:
store.manage
Headers
| Header | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Bearer token: Bearer <token> |
Content-Type | string | Yes | multipart/form-data |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | Workspace identifier |
categoryId | string | Yes | Category identifier |
Request Body
Form data with a file field named file.
Form Fields
| Field | Type | Required | Description |
|---|---|---|---|
file | file | Yes | Image file to upload (JPEG, PNG, etc., max 5MB) |
Response (201)
{
"category": {
"id": "507f1f77bcf86cd799439011",
"imageUrl": "https://storage.example.com/categories/category-123.jpg",
"updatedAt": "2024-01-15T11:00:00Z"
}
}
Common Errors
- 400 Bad Request: Missing or invalid file
- 401 Unauthorized: Missing or invalid authentication token
- 403 Forbidden: Insufficient permissions (requires
store.manage) - 404 Not Found: Category or workspace not found
- 413 Payload Too Large: File size exceeds 5MB limit
- 415 Unsupported Media Type: Invalid file type
- 500 Internal Server Error: Server error