# Category Assignment Resources

Manage Category Assignments

## Updating assignment of resources to a category

> Assigns resources (such as products) to a specified category in bulk. Creates new assignments if they do not exist and updates existing ones.\
> \
> The maximum batch size is 200. <br>

```json
{"openapi":"3.0.1","info":{"title":"Category","version":"0.0.1"},"tags":[{"name":"Category Assignment Resources","description":"Manage Category Assignments"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["category.category_manage"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"category.category_manage":"Manage a category","category.category_read_unpublished":"Read unpublished categories","category.category_publish":"Publish a category","category.category_unpublish":"Unpublish a category"}}}}},"schemas":{"BulkAssignmentUpsertRequest":{"type":"array","minItems":1,"maxItems":200,"items":{"type":"object","properties":{"ref":{"type":"object","properties":{"id":{"minLength":1,"type":"string","description":"Assignment reference unique identifier, for example product ID."}},"required":["id"]}},"required":["ref"]}},"BulkAssignmentResponse":{"type":"array","items":{"type":"object","properties":{"assignmentId":{"type":"string","description":"ID of generated document."},"productId":{"type":"string","description":"ID of the product."},"index":{"type":"integer","description":"Index of the item in the array."},"code":{"type":"integer","description":"HTTP status' code."},"status":{"type":"string","description":"HTTP status."},"message":{"type":"string","description":"Error message which is present only when creation of the assignment failed."}}}},"ErrorResponse":{"required":["code","details","message","status"],"type":"object","properties":{"resourceId":{"type":"string","nullable":true},"code":{"type":"integer","format":"int32"},"status":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}}}}},"paths":{"/category/{tenant}/categories/{categoryId}/assignments/references/bulk":{"put":{"tags":["Category Assignment Resources"],"summary":"Updating assignment of resources to a category","description":"Assigns resources (such as products) to a specified category in bulk. Creates new assignments if they do not exist and updates existing ones.\n\nThe maximum batch size is 200. \n","operationId":"PUT-category-tree-update-category-assignments","parameters":[{"name":"tenant","in":"path","description":"Your Emporix tenant name.\n\n**Note**: The tenant should always be written in lowercase.\n","required":true,"schema":{"type":"string"}},{"name":"categoryId","in":"path","description":"Category unique identifier generated when the category is created.\n","required":true,"deprecated":false,"allowEmptyValue":false,"allowReserved":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkAssignmentUpsertRequest"}}},"required":true},"responses":{"207":{"description":"Multi-status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkAssignmentResponse"}}}},"400":{"description":"Request was syntactically incorrect. Details will be provided in the response payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Permission denied due to insufficient rights. This may happen when request does not contain sufficient scopes for given query values.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Category with the specified categoryId does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Assigning resources to a category

> Assigns resources (such as products) to a specified category.\
> \
> The maximum batch size is 200.<br>

```json
{"openapi":"3.0.1","info":{"title":"Category","version":"0.0.1"},"tags":[{"name":"Category Assignment Resources","description":"Manage Category Assignments"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["category.category_manage"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"category.category_manage":"Manage a category","category.category_read_unpublished":"Read unpublished categories","category.category_publish":"Publish a category","category.category_unpublish":"Unpublish a category"}}}}},"schemas":{"BulkAssignmentRequest":{"type":"array","minItems":1,"maxItems":200,"items":{"type":"object","properties":{"ref":{"type":"object","properties":{"id":{"minLength":1,"type":"string","description":"Assignment reference unique identifier, for example product ID."},"type":{"minLength":1,"type":"string","enum":["PRODUCT"],"description":"Assignment reference type, for example 'product'."}},"required":["id","type"]}},"required":["ref"]}},"BulkAssignmentResponse":{"type":"array","items":{"type":"object","properties":{"assignmentId":{"type":"string","description":"ID of generated document."},"productId":{"type":"string","description":"ID of the product."},"index":{"type":"integer","description":"Index of the item in the array."},"code":{"type":"integer","description":"HTTP status' code."},"status":{"type":"string","description":"HTTP status."},"message":{"type":"string","description":"Error message which is present only when creation of the assignment failed."}}}},"ErrorResponse":{"required":["code","details","message","status"],"type":"object","properties":{"resourceId":{"type":"string","nullable":true},"code":{"type":"integer","format":"int32"},"status":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}}}}},"paths":{"/category/{tenant}/categories/{categoryId}/assignments/bulk":{"post":{"tags":["Category Assignment Resources"],"summary":"Assigning resources to a category","description":"Assigns resources (such as products) to a specified category.\n\nThe maximum batch size is 200.\n","operationId":"POST-category-tree-assign-category-resources","parameters":[{"name":"tenant","in":"path","description":"Your Emporix tenant name.\n\n**Note**: The tenant should always be written in lowercase.\n","required":true,"schema":{"type":"string"}},{"name":"categoryId","in":"path","description":"Category unique identifier generated when the category is created.\n","required":true,"deprecated":false,"allowEmptyValue":false,"allowReserved":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkAssignmentRequest"}}},"required":true},"responses":{"207":{"description":"Multi-status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkAssignmentResponse"}}}},"400":{"description":"Request was syntactically incorrect. Details will be provided in the response payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Permission denied due to insufficient rights. This may happen when request does not contain sufficient scopes for given query values.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Category with the specified categoryId does not exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Retrieving resources assigned to a category

> Retrieves resources (such as products) assigned to a specified category. The localizedName field contains the resource (product) name. This information is attached to the assignment asynchronously and is visible in the response when retrieved.\
> \*\*\*\
> \
> \### Additional scope info\
> \
> \* \`category.category\_read\_unpublished\` - Only required if the category has not been published.<br>

```json
{"openapi":"3.0.1","info":{"title":"Category","version":"0.0.1"},"tags":[{"name":"Category Assignment Resources","description":"Manage Category Assignments"}],"servers":[{"url":"https://api.emporix.io"}],"security":[],"paths":{"/category/{tenant}/categories/{categoryId}/assignments":{"get":{"tags":["Category Assignment Resources"],"summary":"Retrieving resources assigned to a category","description":"Retrieves resources (such as products) assigned to a specified category. The localizedName field contains the resource (product) name. This information is attached to the assignment asynchronously and is visible in the response when retrieved.\n***\n\n### Additional scope info\n\n* `category.category_read_unpublished` - Only required if the category has not been published.\n","operationId":"GET-category-tree-retrieve-category-assignments","parameters":[{"name":"tenant","in":"path","description":"Your Emporix tenant name.\n\n**Note**: The tenant should always be written in lowercase.\n","required":true,"schema":{"type":"string"}},{"name":"categoryId","in":"path","description":"Category unique identifier generated when the category is created.\n","required":true,"deprecated":false,"allowEmptyValue":false,"allowReserved":false,"schema":{"type":"string"}},{"name":"assignmentType","in":"query","description":"Resource type assigned to the category.\nPossible values:\n* `PRODUCT`\n","schema":{"type":"string","default":"PRODUCT","enum":["PRODUCT"]}},{"name":"ref.localizedName","in":"query","description":"Localized name of the item assigned to the category.\n","schema":{"type":"string"}},{"name":"ref.id","in":"query","description":"Identifier of the item assigned to the category.\n","schema":{"type":"string"}},{"name":"showUnpublished","in":"query","description":"If set to `true`, resources assigned to not published categories are retrieved as well.\nPossible values:\n* `true`\n* `false`\n\n**Note**: To get unpublished categories you need to have `category.category_read_unpublished` scope.\n","schema":{"type":"boolean","default":false}},{"name":"withSubcategories","in":"query","description":"If set to `true`, resources assigned to subcategories are retrieved as well.\nPossible values:\n* `true`\n* `false`\n","schema":{"type":"boolean","default":false}},{"name":"segmentsIds","in":"query","description":"List of segment IDs used to filter assignments — only category assignments will be returned, where the category is assigned to the provided list of segments.\n","schema":{"type":"string"}},{"name":"pageNumber","in":"query","description":"Page number to be retrieved. The number of the first page is 1.\n**Note**: If the `pageNumber` parameter is passed, size of the pages must be specified in the `pageSize` parameter.\n","schema":{"minimum":1,"type":"integer","format":"int32","default":1}},{"name":"pageSize","in":"query","description":"Number of export files to be retrieved per page.\n","schema":{"minimum":1,"type":"integer","format":"int32","default":60}},{"name":"sort","in":"query","description":"List of properties used to sort the results, separated by commas. This list is validated against available fields. Sorting by deprecated field is forbidden.\nPossible values:\n* `{fieldName}:ASC`\n* `{fieldName}:DESC`\n* `{fieldName}:ASC,{fieldName2}:DESC`\n* `{internationalizedFieldName.en}:ASC` - contains localized field name and extension. Valid only if Accepted-language header contains this extension and it is supported by configuration of the tenant. If all language are accepted (Accept-language='*') then extension must exist in tenant configuration. No other sorting are allowed for this specific internationalized field.\n* `{internationalizedFieldName}:ASC` - contains only localized field name. Extension will be deducted based on Accept-language header. If all language are accepted (Accept-language='*') then extension is taken from tenant configuration and is equal to default language. In other case the language with highest priority is taken. No other sorting are allowed for this specific localized field.\n","schema":{"type":"string"}},{"name":"Accept-Language","in":"header","description":"List of properties used to project and sort the results, separated by commas.\nPossible values:\n* `*` - each internationalized field is returned as a map containing all available (specified in tenant configuration) translations. This is also the default behaviour if the header is not set.\n* `en`, `en,de` - each internationalized field is returned as a map containing translation specified by a header value. If translation is not supported by tenant configuration then exception is thrown. First language is the one with highest priority.\n* `fr-CH, fr;q=0.9, en;q=0.8, de;q=0.7, *;q=0.5` - each internationalized field is returned as a map containing translation specified by a header value. If translation is not supported by tenant configuration then exception is thrown.\n","schema":{"type":"string","default":"*"}},{"name":"X-Total-Count","in":"header","description":"The header value indicates if the total count of entities should be returned.\nPossible values:\n* `true`\n* `false`\nDefault value: `false`\n","schema":{"type":"boolean","default":false}},{"schema":{"type":"boolean","default":false},"in":"query","name":"hideUnpublishedProducts","description":"If set to `true` only assignments with published products will be returned. The default value is `false`"}],"responses":{"200":{"description":"The request was successful. The category assignments are returned.","headers":{"X-Total-Count":{"description":"Total amount of references assigned to a category.","schema":{"type":"integer","format":"int32"}}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CategoryAssignment"}}}}},"400":{"description":"Request was syntactically incorrect. Details will be provided in the response payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Permission denied due to insufficient rights. This may happen when request does not contain sufficient scopes for given query values.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Category with the specified categoryId does not exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"CategoryAssignment":{"type":"object","properties":{"id":{"type":"string","description":"Assignment unique identifier generated when the assignment is created."},"categoryId":{"type":"string","description":"Assignment category identifier."},"ref":{"allOf":[{"$ref":"#/components/schemas/CategoryAssignmentRefQueryDocument"},{"description":"Localized category description in a form of a map of translations."}]}},"description":"Definition od category assignment"},"CategoryAssignmentRefQueryDocument":{"required":["id","localizedName","type"],"type":"object","properties":{"id":{"type":"string","description":"Assignment reference unique identifier, for example product ID."},"type":{"type":"string","enum":["PRODUCT"],"description":"Assignment reference type, for example 'product'."},"localizedName":{"type":"object","additionalProperties":{"type":"string"},"description":"Assignment reference localized name."}},"description":"Localized category description in a form of a map of translations."},"ErrorResponse":{"required":["code","details","message","status"],"type":"object","properties":{"resourceId":{"type":"string","nullable":true},"code":{"type":"integer","format":"int32"},"status":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}}}}}}
```

## Assigning a resource to a category

> Assigns a resource to a specified category.<br>

```json
{"openapi":"3.0.1","info":{"title":"Category","version":"0.0.1"},"tags":[{"name":"Category Assignment Resources","description":"Manage Category Assignments"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["category.category_manage"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"category.category_manage":"Manage a category","category.category_read_unpublished":"Read unpublished categories","category.category_publish":"Publish a category","category.category_unpublish":"Unpublish a category"}}}}},"schemas":{"AssignmentRequest":{"required":["ref"],"type":"object","properties":{"ref":{"$ref":"#/components/schemas/Reference","description":"Assignment reference."}}},"Reference":{"required":["id","type"],"type":"object","properties":{"id":{"minLength":1,"type":"string","description":"Assignment reference unique identifier, for example product ID."},"type":{"minLength":1,"type":"string","enum":["PRODUCT"],"description":"Assignment reference type, for example 'product'."}},"description":"Assignment reference."},"AssignmentIdResponse":{"type":"object","properties":{"id":{"type":"string","description":"ID of generated document."}}},"ErrorResponse":{"required":["code","details","message","status"],"type":"object","properties":{"resourceId":{"type":"string","nullable":true},"code":{"type":"integer","format":"int32"},"status":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}}}}},"paths":{"/category/{tenant}/categories/{categoryId}/assignments":{"post":{"tags":["Category Assignment Resources"],"summary":"Assigning a resource to a category","description":"Assigns a resource to a specified category.\n","operationId":"POST-category-tree-assign-resource","parameters":[{"name":"tenant","in":"path","description":"Your Emporix tenant name.\n\n**Note**: The tenant should always be written in lowercase.\n","required":true,"schema":{"type":"string"}},{"name":"categoryId","in":"path","description":"Category unique identifier generated when the category is created.\n","required":true,"deprecated":false,"allowEmptyValue":false,"allowReserved":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentRequest"}}},"required":true},"responses":{"201":{"description":"The resource has been successfully assigned to the category.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentIdResponse"}}}},"400":{"description":"Request was syntactically incorrect. Details will be provided in the response payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Permission denied due to insufficient rights. This may happen when request does not contain sufficient scopes for given query values.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Category with the specified categoryId does not exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Deleting all category assignments

> Deletes all assignments for a specified category.<br>

```json
{"openapi":"3.0.1","info":{"title":"Category","version":"0.0.1"},"tags":[{"name":"Category Assignment Resources","description":"Manage Category Assignments"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["category.category_manage"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"category.category_manage":"Manage a category","category.category_read_unpublished":"Read unpublished categories","category.category_publish":"Publish a category","category.category_unpublish":"Unpublish a category"}}}}},"schemas":{"ErrorResponse":{"required":["code","details","message","status"],"type":"object","properties":{"resourceId":{"type":"string","nullable":true},"code":{"type":"integer","format":"int32"},"status":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}}}}},"paths":{"/category/{tenant}/categories/{categoryId}/assignments":{"delete":{"tags":["Category Assignment Resources"],"summary":"Deleting all category assignments","description":"Deletes all assignments for a specified category.\n","operationId":"DELETE-category-tree-remove-all-category-assignments","parameters":[{"name":"tenant","in":"path","description":"Your Emporix tenant name.\n\n**Note**: The tenant should always be written in lowercase.\n","required":true,"schema":{"type":"string"}},{"name":"categoryId","in":"path","description":"Category unique identifier generated when the category is created.\n","required":true,"deprecated":false,"allowEmptyValue":false,"allowReserved":false,"schema":{"type":"string"}},{"name":"assignmentType","in":"query","description":"Resource type assigned to the category.\nPossible values:\n* `PRODUCT`\n","schema":{"type":"string","default":"PRODUCT","enum":["PRODUCT"]}}],"responses":{"204":{"description":"Assignments has been successfully deleted"},"403":{"description":"Permission denied due to insufficient rights. This may happen when request does not contain sufficient scopes for given query values.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Category with the specified categoryId does not exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Deleting a category assignment by id

> Deletes an assignment from a specified category.<br>

```json
{"openapi":"3.0.1","info":{"title":"Category","version":"0.0.1"},"tags":[{"name":"Category Assignment Resources","description":"Manage Category Assignments"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["category.category_manage"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"category.category_manage":"Manage a category","category.category_read_unpublished":"Read unpublished categories","category.category_publish":"Publish a category","category.category_unpublish":"Unpublish a category"}}}}},"schemas":{"ErrorResponse":{"required":["code","details","message","status"],"type":"object","properties":{"resourceId":{"type":"string","nullable":true},"code":{"type":"integer","format":"int32"},"status":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}}}}},"paths":{"/category/{tenant}/categories/{categoryId}/assignments/{assignmentId}":{"delete":{"tags":["Category Assignment Resources"],"summary":"Deleting a category assignment by id","description":"Deletes an assignment from a specified category.\n","operationId":"DELETE-category-tree-remove-category-assignment","parameters":[{"name":"tenant","in":"path","description":"Your Emporix tenant name.\n\n**Note**: The tenant should always be written in lowercase.\n","required":true,"schema":{"type":"string"}},{"name":"categoryId","in":"path","description":"Category unique identifier generated when the category is created.\n","required":true,"deprecated":false,"allowEmptyValue":false,"allowReserved":false,"schema":{"type":"string"}},{"name":"assignmentId","in":"path","description":"Assignment unique identifier\n","required":true,"deprecated":false,"allowEmptyValue":false,"allowReserved":false,"schema":{"type":"string"}}],"responses":{"204":{"description":"Assignment has been successfully deleted."},"400":{"description":"Request was syntactically incorrect. Details will be provided in the response payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Permission denied due to insufficient rights. This may happen when request does not contain sufficient scopes for given query values.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Category with the specified categoryId does not exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Upserting a resource to a category assignment

> Creates or updates an assignment of a resource to a specified category.\
> If any assignment with given categoryId and referenceId does not exist then a new assignment is created. <br>

```json
{"openapi":"3.0.1","info":{"title":"Category","version":"0.0.1"},"tags":[{"name":"Category Assignment Resources","description":"Manage Category Assignments"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["category.category_manage"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"category.category_manage":"Manage a category","category.category_read_unpublished":"Read unpublished categories","category.category_publish":"Publish a category","category.category_unpublish":"Unpublish a category"}}}}},"schemas":{"AssignmentIdResponse":{"type":"object","properties":{"id":{"type":"string","description":"ID of generated document."}}},"ErrorResponse":{"required":["code","details","message","status"],"type":"object","properties":{"resourceId":{"type":"string","nullable":true},"code":{"type":"integer","format":"int32"},"status":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}}}}},"paths":{"/category/{tenant}/categories/{categoryId}/assignments/references/{referenceId}":{"put":{"tags":["Category Assignment Resources"],"summary":"Upserting a resource to a category assignment","description":"Creates or updates an assignment of a resource to a specified category.\nIf any assignment with given categoryId and referenceId does not exist then a new assignment is created. \n","operationId":"PUT-category-tree-assign-resource","parameters":[{"name":"tenant","in":"path","description":"Your Emporix tenant name.\n\n**Note**: The tenant should always be written in lowercase.\n","required":true,"schema":{"type":"string"}},{"name":"categoryId","in":"path","description":"Category unique identifier generated when the category is created.\n","required":true,"deprecated":false,"allowEmptyValue":false,"allowReserved":false,"schema":{"type":"string"}},{"name":"referenceId","in":"path","description":"Assignment reference unique identifier, for example: productId.\n","required":true,"deprecated":false,"allowEmptyValue":false,"allowReserved":false,"schema":{"type":"string"}}],"responses":{"201":{"description":"The resource has been successfully assigned to the category.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentIdResponse"}}}},"204":{"description":"The resource assignment to the category has been updated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentIdResponse"}}}},"400":{"description":"Request was syntactically incorrect. Details will be provided in the response payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Permission denied due to insufficient rights. This may happen when request does not contain sufficient scopes for given query values.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Category with the specified categoryId does not exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Deleting a category assignment by reference id

> Deletes an assignment from a specified category.<br>

```json
{"openapi":"3.0.1","info":{"title":"Category","version":"0.0.1"},"tags":[{"name":"Category Assignment Resources","description":"Manage Category Assignments"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["category.category_manage"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"category.category_manage":"Manage a category","category.category_read_unpublished":"Read unpublished categories","category.category_publish":"Publish a category","category.category_unpublish":"Unpublish a category"}}}}},"schemas":{"ErrorResponse":{"required":["code","details","message","status"],"type":"object","properties":{"resourceId":{"type":"string","nullable":true},"code":{"type":"integer","format":"int32"},"status":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}}}}},"paths":{"/category/{tenant}/categories/{categoryId}/assignments/references/{referenceId}":{"delete":{"tags":["Category Assignment Resources"],"summary":"Deleting a category assignment by reference id","description":"Deletes an assignment from a specified category.\n","operationId":"DELETE-category-tree-remove-category-assignment-by-reference-id","parameters":[{"name":"tenant","in":"path","description":"Your Emporix tenant name.\n\n**Note**: The tenant should always be written in lowercase.\n","required":true,"schema":{"type":"string"}},{"name":"categoryId","in":"path","description":"Category unique identifier generated when the category is created.\n","required":true,"deprecated":false,"allowEmptyValue":false,"allowReserved":false,"schema":{"type":"string"}},{"name":"referenceId","in":"path","description":"Assignment reference unique identifier, for example: productId.\n","required":true,"deprecated":false,"allowEmptyValue":false,"allowReserved":false,"schema":{"type":"string"}}],"responses":{"204":{"description":"Assignment has been successfully deleted."},"400":{"description":"Request was syntactically incorrect. Details will be provided in the response payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Permission denied due to insufficient rights. This may happen when request does not contain sufficient scopes for given query values.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Category with the specified categoryId does not exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.emporix.io/api-references-1/readme/api-reference-6/category-assignment-resources.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
