---
search:
  tags:
    - Categories
    - POST
seo:
  description: >-
    Update a category (POST body is partial). Requires a Write key. Empty…
    Reference for the POST /categories/{categoryId} endpoint in the scango.ch
    API.
sidebar:
  label: Update category
  badge: POST
title: Update category
type: openapi-operation
---
Update a category (POST body is partial). Requires a Write key. Empty `allowStore` or `hideStore` arrays remove the field.

`POST /categories/{categoryId}`

**Request body** (`application/json`, required)

- `name` (string)
- `externalId` (string) — Optional external identifier
- `index` (number)
- `showOnScreen` (boolean)
- `imageUrl` (string)
- `marginMinPercent` (number)
- `marginMaxPercent` (number)
- `hideStore` (string[]) — Empty array removes the field.
- `allowStore` (string[]) — Empty array removes the field.
- `deleted` (boolean) — Set true to soft-delete.

Request body example:

```json
{
  "index": 2
}
```

**Responses**

- `200` — Updated
- `400` — Invalid parameters or body.
- `403` — Missing, unknown or inactive API key, or a Read key on a write operation.
- `404` — No item with this id.

Response example, 200:

```json
{
  "success": true
}
```

Response example, 400:

```json
{
  "statusCode": 400,
  "message": "Validation failed for Field: name, Error: Required",
  "timestamp": "2024-04-20T12:00:00.000Z",
  "path": "/api/v1/suppliers"
}
```

Response example, 403:

```json
{
  "statusCode": 403,
  "message": "Unknown Error",
  "timestamp": "2024-04-20T12:00:00.000Z",
  "path": "/api/v1/products"
}
```
