Update an asset category
Using this verb you can change some of the properties of any category.
Allowed properties:
| Property | Description |
|---|---|
| name | Category name |
| parent_id | New parent category id. Use emtpy string to make it root category |
| sort_children | Reorder subcategories |
Note: parent_id and sort_children are not allowed in the same request.
Moving Categories
Convert to root category (a.k.a first level categories)
You must issue a patch request to https://pim.plytix.com/api/v1/categories/file/categoryId (see examples) specifiying parent_id as empty string, i.e. {"parent_id": ""}
Move as subcategory of another category
You must issue a patch request to https://pim.plytix.com/api/v1/categories/file/categoryId (see examples) specifiying parent_id as new parent category id, i.e. {"parent_id": "new parent category here"}
Sorting Categories
Sorting Root Categories
When patching root categories (a.k.a first level categories) only reorder is allowed and must be done under the special endpoint https://pim.plytix.com/api/v1/categories/file/root, 200 status code is returned upon successful response and empty data array is returned.
Sorting Subcategories
A patch request must be issued to parent ID category including in its body a dictionary with ALL subcategories in desired order, you are not allowed to make partial orders or add new categories or this operations will return 422 error code.
{ "sort_children": ["<subcategory_id>", "<subcategory_id>"] }Authorization
bearerAuth Obtain a token via POST /auth/api/get-token (15 minute lifetime), then send it as Authorization: Bearer <token>.
In: header
Path Parameters
Response Body
application/json
curl -X PATCH 'https://example.com/api/v1/categories/file/string'{ "data": [ { "id": "5cfa10893da03100019ba911", "modified": "2019-06-07T07:21:45.967000+00:00", "n_children": 3, "name": "Marketing Logos", "order": "8", "parents_ids": [], "path": [ "Marketing Logos" ], "slug": "marketing-logos" } ]}