Update Category (v1)
Method + Path
PATCH /v1/workspace/:workspaceId/storefront/categories/:categoryId
Actual backend path: /v1/workspace/:workspaceId/storefront/categories/:categoryId
Description
Update an existing storefront category. All fields are optional - only provided fields will be updated.
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 | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | Workspace identifier |
categoryId | string | Yes | Category identifier |
Request Body
{
"name": "Updated Electronics",
"description": "Updated description",
"status": "archived"
}
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
parentId | string | No | Parent category ID (can be null) |
name | string | No | Category name (1-120 characters if provided) |
slug | string | No | URL-friendly slug (1-80 characters if provided) |
description | string | No | Category description (maximum 2000 characters, can be null) |
sortOrder | number | No | Sort order (integer if provided) |
status | string | No | Category status. Valid values: active, archived |
Note: At least one field must be provided for update.
Response (200)
{
"category": {
"id": "507f1f77bcf86cd799439011",
"name": "Updated Electronics",
"description": "Updated description",
"status": "archived",
"updatedAt": "2024-01-15T11:00:00Z"
}
}
Common Errors
- 400 Bad Request: Invalid request body or no fields provided
- 401 Unauthorized: Missing or invalid authentication token
- 403 Forbidden: Insufficient permissions (requires
store.manage) - 404 Not Found: Category or workspace not found
- 409 Conflict: Slug already exists
- 422 Unprocessable Entity: Validation errors
- 500 Internal Server Error: Server error