# Type

## Updating types of a schema

> Updates assigned types to the schema. It's allowed to change the assigned types to the newest schema as well as to the previous versions of the schema. This operation does not generate a new version of the schema.

```json
{"openapi":"3.0.1","info":{"title":"Schema Service","version":"0.0.1"},"tags":[{"name":"Type"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["schema.schema_manage"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"schema.schema_manage":"Required for managing schemas.","schema.schema_read":"Required for reading schemas.","schema.custominstance_read":"Read custom instances of any custom schema type.","schema.custominstance_manage":"Manage custom instances of any custom schema type.","custom.{lowerCaseType}_manage":"Manage custom instances of a given type. For example, for type `DOCUMENT` → `custom.document_manage`.","custom.{lowerCaseType}_manage_own":"Allows to manage only your own custom instances of a given type. For example, for type `DOCUMENT` → `custom.document_manage_own`.","custom.{lowerCaseType}_read":"Read custom instances of a given type. For example, for type `DOCUMENT` → `custom.document_read`.","custom.{lowerCaseType}_read_own":"Allows to read only your own custom instances of a given type. For example, for type `DOCUMENT` → `custom.document_read_own`."}}}}},"schemas":{"SchemaTypes":{"type":"array","description":"List of types to which assign the schema.","items":{"$ref":"#/components/schemas/SchemaType"}},"SchemaType":{"type":"string","description":"Type which the schema should be assigned to. Can be one of the predefined values or any custom schema type id.","enum":["CART","CART_ITEM","CATEGORY","COMPANY","COUPON","CUSTOMER","CUSTOMER_ADDRESS","ORDER","ORDER_ENTRY","PRODUCT","QUOTE","RETURN","PRICE_LIST","SITE","CUSTOM_ENTITY","VENDOR"]},"ErrorResponse":{"required":["code","message","status"],"type":"object","properties":{"id":{"type":"string","nullable":true},"code":{"type":"integer","format":"int32"},"status":{"type":"string"},"message":{"type":"string"},"errorCode":{"type":"string","nullable":true},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"type":{"type":"string"},"message":{"type":"string"},"moreInfo":{"type":"string"}}}}}}},"responses":{"Bad_request_400_cl":{"description":"Unsupported content language provided.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer"},"status":{"type":"string"},"message":{"type":"string"},"errorCode":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"type":{"type":"string"},"message":{"type":"string"},"moreInfo":{"type":"string"}}}}}}}}},"Unathorized_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired. It usually means that tenant from the token does not match tenant from path.","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"Forbidden_403":{"description":"Permission denied due to insufficient rights. This may happen when the request does not contain sufficient scopes for the given query values.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Not_Found_404":{"description":"Given resource cannot be found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/schema/{tenant}/schemas/{id}/types":{"put":{"summary":"Updating types of a schema","description":"Updates assigned types to the schema. It's allowed to change the assigned types to the newest schema as well as to the previous versions of the schema. This operation does not generate a new version of the schema.","tags":["Type"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaTypes"}}},"description":""},"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/Bad_request_400_cl"},"401":{"$ref":"#/components/responses/Unathorized_401"},"403":{"$ref":"#/components/responses/Forbidden_403"},"404":{"$ref":"#/components/responses/Not_Found_404"}},"operationId":"PUT-schema-update-schema-types"}}}}
```

## Retrieving types

> Retrieves types which have at least one schema assigned.

```json
{"openapi":"3.0.1","info":{"title":"Schema Service","version":"0.0.1"},"tags":[{"name":"Type"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":[]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.emporix.io/oauth/token","scopes":{"schema.schema_manage":"Required for managing schemas.","schema.schema_read":"Required for reading schemas.","schema.custominstance_read":"Read custom instances of any custom schema type.","schema.custominstance_manage":"Manage custom instances of any custom schema type.","custom.{lowerCaseType}_manage":"Manage custom instances of a given type. For example, for type `DOCUMENT` → `custom.document_manage`.","custom.{lowerCaseType}_manage_own":"Allows to manage only your own custom instances of a given type. For example, for type `DOCUMENT` → `custom.document_manage_own`.","custom.{lowerCaseType}_read":"Read custom instances of a given type. For example, for type `DOCUMENT` → `custom.document_read`.","custom.{lowerCaseType}_read_own":"Allows to read only your own custom instances of a given type. For example, for type `DOCUMENT` → `custom.document_read_own`."}}}}},"schemas":{"TypesResponse":{"type":"array","items":{"type":"string"}},"ErrorResponse":{"required":["code","message","status"],"type":"object","properties":{"id":{"type":"string","nullable":true},"code":{"type":"integer","format":"int32"},"status":{"type":"string"},"message":{"type":"string"},"errorCode":{"type":"string","nullable":true},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"type":{"type":"string"},"message":{"type":"string"},"moreInfo":{"type":"string"}}}}}}},"responses":{"Unauthorized_401":{"description":"Given request is unauthorized - the authorization token is invalid or has expired. It usually means that the tenant from the token does not match tenant from path.","content":{"application/json":{"schema":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}}}}},"Forbidden_403":{"description":"Permission denied due to insufficient rights. This may happen when the request does not contain sufficient scopes for the given query values.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/schema/{tenant}/types":{"get":{"summary":"Retrieving types","description":"Retrieves types which have at least one schema assigned.","tags":["Type"],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TypesResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized_401"},"403":{"$ref":"#/components/responses/Forbidden_403"}},"operationId":"GET-schema-retrieve-schema-types"}}}}
```


---

# 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-31/type.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.
