# Custom Schema Type

## Retrieving all custom schema types

> Retrieves all custom schema types.

```json
{"openapi":"3.0.1","info":{"title":"Schema Service","version":"0.0.1"},"tags":[{"name":"Custom Schema 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":{"CustomSchemaTypesResponse":{"type":"array","items":{"$ref":"#/components/schemas/CustomSchemaTypeResponse"}},"CustomSchemaTypeResponse":{"type":"object","properties":{"id":{"type":"string","description":"Unique id of the custom schema type."},"name":{"type":"object","description":"Localized custom type name in a form of a map of translations."},"schemas":{"type":"object","description":"Information about associated schemas. This field is only included if `expandSchemas` is set to `true`"},"metadata":{"type":"object","properties":{"createdAt":{"type":"string","description":"Date and time when the object was created, compliant with the ISO 8601 standard. For example: `2022-03-31T09:52:15.423Z`"},"modifiedAt":{"type":"string","description":"Date and time when the object was last modified, compliant with the ISO 8601 standard. For example: `2022-03-31T09:52:15.423Z`"},"version":{"type":"integer"}}}}},"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"}}}}},"parameters":{"trail_xTotalCount_header":{"name":"X-Total-Count","in":"header","required":false,"schema":{"type":"boolean","default":false},"description":"Flag indicating whether the total number of retrieved items should be returned.\n"},"trait_acceptLanguage_header":{"name":"Accept-Language","in":"header","required":false,"schema":{"type":"string"},"description":"List of language codes acceptable for the response. You can specify factors that indicate which language should be retrieved if the one with a higher factor was not found in the localized fields. If a value is specified, then it must be present in the tenant configuration.\n* If the header is set to a particular language or a list of languages, all localized fields are retrieved as strings.\n* If the header is set to `*`, all localized fields are retrieved as maps of translations, where the keys are language codes and values are the fields in their respective languages.\n* If the header is empty, localized fields are retrieved in the default language defined in the Configuration Service.\n"},"trait_paged_pageNumber":{"name":"pageNumber","in":"query","description":"Page number to be retrieved. The number of the first page is 1.\n","schema":{"default":1,"minimum":1,"type":"integer"}},"trait_paged_pageSize":{"name":"pageSize","in":"query","description":"Number of items to be retrieved per page.\n","schema":{"default":60,"minimum":1,"type":"integer"}},"trait_sort":{"name":"sort","in":"query","description":"List of properties used to sort the results, separated by colons. The order of properties indicates their priority in sorting.\n\nPossible values:\n* `{fieldName}`\n* `{fieldName}:asc`\n* `{fieldName}:desc`\n\n**Note:** If you want to sort the results by localized properties, the possible values are:\n  * `{fieldName}.{language}`\n  * `{fieldName}.{language}:asc`\n  * `{fieldName}.{language}:desc`\n\nIf the sorting direction is not specified, the fields are sorted in ascending order.","schema":{"type":"string"}},"trait_q_param":{"name":"q","in":"query","description":"A standard query parameter is used to search for specific values.\n\n* Searching for items by string-based properties:\n  * By a field value: `q=siteCode:main`, where `siteCode` is the field name, and `main` is its desired value.\n  * By a localized field value: `q=items.product.name.en:apple_lobo`, where `name` is the field name of product, `en` is the language code, and `apple_lobo` is the field value expressed in the specified language. **Note**: This query works only for localized fields, which are stored in a map format, where `key` is the language code and `value` is the translation to particular language.\n* Searching for items by a number-based property:\n  * With a specific value: `q=items.quantity.quantity:20`\n  * With a value greater than: `q=items.quantity.quantity:>20`\n  * With a value lower than: `q=items.quantity.quantity:<20`\n  * With a value greater than or equal to: `q=items.quantity.quantity:>=20`\n  * With a value lower than or equal to: `q=items.quantity.quantity:<=20`\n  * With a value within a range of values: `q=items.quantity.quantity:(>=10 AND <=20)`\\\n   where `items.quantity.quantity` is the name of the number-based field, and `20` is its querying value.\n* Searching for items by a date-based property: All number-based property queries are also valid for dates. In that case, the date should be placed within double quotes: `q=metadataCreatedAt:(>=\"2021-05-18T07:27:27.455Z\" AND <\"2021-05-20T07:27:27.455Z\")`\n* Searching for items by a boolean-based property: `q=description.multiLanguage:true`, where `description.multiLanguage` is the boolean field name, and `true` is its desired value.\n* Searching for items with a nonexistent or empty property: `q=description.en:null`, where `description.en` is the field that has its value set to `null`.\n* Searching for items with an existing property: `q=mixins.mixinName:exists`, where the specific mixin named `mixinName` exists in the database.\n* Searching for items by multiple specific values: `q=id:(5c3325baa9812100098ff48f,5c3325d1a9812100098ff494)`, where `id` is the field name, and strings within the bracket are the desired values.\n* Searching for items by multiple fields: `q=id:5c3325baa9812100098ff48f siteCode:main` where `id` and `siteCode` are field names. All objects that contain the specified values are returned. Multiple fields (separated by space) can be specified. Multiple values for each field can also be specified in the format presented earlier.\n* Searching for items with string-based properties conforming to a regex: `q=siteCode:~ain` or `q=code:(~U PL)` - in case of searching for strings with space, where `siteCode` is the name of the field, and `ain` or `U PL` is its querying regex.\n* Searching for items with a localized string-based property conforming to a regex: `items.product.name.en:~(Yoghurt im)` - where `name` is the product field name, `en` is the desired language, and `Joghurt im` is the search term.\n","schema":{"type":"string"}},"trait_fields":{"name":"fields","in":"query","description":"Fields to be included in the response.\n","schema":{"type":"string"}},"trait_expand_schemas":{"name":"expandSchemas","in":"query","description":"Determines whether the response will include information about associated schemas.\n","schema":{"default":false,"type":"boolean"}}}},"paths":{"/schema/{tenant}/custom-entities":{"get":{"summary":"Retrieving all custom schema types","description":"Retrieves all custom schema types.","tags":["Custom Schema Type"],"responses":{"200":{"description":"","headers":{"X-Total-Count":{"description":"Total amount of custom types for given criteria.","schema":{"type":"integer","format":"int32"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomSchemaTypesResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized_401"},"403":{"$ref":"#/components/responses/Forbidden_403"}},"operationId":"GET-schema-retrieve-custom-schema-types","parameters":[{"$ref":"#/components/parameters/trail_xTotalCount_header"},{"$ref":"#/components/parameters/trait_acceptLanguage_header"},{"$ref":"#/components/parameters/trait_paged_pageNumber"},{"$ref":"#/components/parameters/trait_paged_pageSize"},{"$ref":"#/components/parameters/trait_sort"},{"$ref":"#/components/parameters/trait_q_param"},{"$ref":"#/components/parameters/trait_fields"},{"$ref":"#/components/parameters/trait_expand_schemas"}]}}}}
```

## Creating a custom schema type

> Creates a custom type entity that can be later used for creating custom instances.\
> \
> \*\*Note\*\*: When a custom entity type is created, a set of custom scopes is created, which allow managing custom instances of that type.<br>

```json
{"openapi":"3.0.1","info":{"title":"Schema Service","version":"0.0.1"},"tags":[{"name":"Custom Schema 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":{"CustomSchemaTypeCreation":{"type":"object","properties":{"id":{"type":"string","description":"Unique code for the custom type. Can only contain uppercase letters and underscores."},"name":{"type":"object","description":"Localized custom type name in a form of a map of translations."}},"required":["id","name"]},"IdResponse":{"type":"object","properties":{"id":{"type":"string","description":"ID of the generated document."}},"description":"Id of the created schema."},"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"}}}}}}}}},"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"}}}}}}}}}},"Conflict_409":{"description":"Conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"parameters":{"trait_contentLanguage_header":{"in":"header","name":"Content-Language","description":"The Content-Language request HTTP header defines language(s) of the payload.","schema":{"type":"string"}}}},"paths":{"/schema/{tenant}/custom-entities":{"post":{"tags":["Custom Schema Type"],"summary":"Creating a custom schema type","description":"Creates a custom type entity that can be later used for creating custom instances.\n\n**Note**: When a custom entity type is created, a set of custom scopes is created, which allow managing custom instances of that type.\n","operationId":"POST-schema-create-custom-schema-type","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomSchemaTypeCreation"}}}},"responses":{"201":{"description":"The request was successful. Custom schema type has been created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdResponse"}}}},"400":{"$ref":"#/components/responses/Bad_request_400_cl"},"401":{"$ref":"#/components/responses/Unauthorized_401"},"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"}}}},"409":{"$ref":"#/components/responses/Conflict_409"}},"parameters":[{"$ref":"#/components/parameters/trait_contentLanguage_header"}]}}}}
```

## Retrieving a custom schema type

> Retrieves a single custom schema type by id.

```json
{"openapi":"3.0.1","info":{"title":"Schema Service","version":"0.0.1"},"tags":[{"name":"Custom Schema 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":{"CustomSchemaTypeResponse":{"type":"object","properties":{"id":{"type":"string","description":"Unique id of the custom schema type."},"name":{"type":"object","description":"Localized custom type name in a form of a map of translations."},"schemas":{"type":"object","description":"Information about associated schemas. This field is only included if `expandSchemas` is set to `true`"},"metadata":{"type":"object","properties":{"createdAt":{"type":"string","description":"Date and time when the object was created, compliant with the ISO 8601 standard. For example: `2022-03-31T09:52:15.423Z`"},"modifiedAt":{"type":"string","description":"Date and time when the object was last modified, compliant with the ISO 8601 standard. For example: `2022-03-31T09:52:15.423Z`"},"version":{"type":"integer"}}}}},"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"}}}},"Not_Found_404":{"description":"Given resource cannot be found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"parameters":{"trait_acceptLanguage_header":{"name":"Accept-Language","in":"header","required":false,"schema":{"type":"string"},"description":"List of language codes acceptable for the response. You can specify factors that indicate which language should be retrieved if the one with a higher factor was not found in the localized fields. If a value is specified, then it must be present in the tenant configuration.\n* If the header is set to a particular language or a list of languages, all localized fields are retrieved as strings.\n* If the header is set to `*`, all localized fields are retrieved as maps of translations, where the keys are language codes and values are the fields in their respective languages.\n* If the header is empty, localized fields are retrieved in the default language defined in the Configuration Service.\n"},"trait_expand_schemas":{"name":"expandSchemas","in":"query","description":"Determines whether the response will include information about associated schemas.\n","schema":{"default":false,"type":"boolean"}}}},"paths":{"/schema/{tenant}/custom-entities/{id}":{"get":{"summary":"Retrieving a custom schema type","description":"Retrieves a single custom schema type by id.","tags":["Custom Schema Type"],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomSchemaTypeResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized_401"},"403":{"$ref":"#/components/responses/Forbidden_403"},"404":{"$ref":"#/components/responses/Not_Found_404"}},"operationId":"GET-schema-retrieve-custom-schema-type","parameters":[{"$ref":"#/components/parameters/trait_acceptLanguage_header"},{"$ref":"#/components/parameters/trait_expand_schemas"}]}}}}
```

## Upserting a custom schema type

> Performs the \`UPSERT\` operation. If a custom schema type with specified ID exists in the system, then it is updated. If it doesn't exist, a new type is created.\
> \
> \*\*Note\*\*: When a custom entity type is created, a set of custom scopes is created, which allow managing custom instances of that type.

```json
{"openapi":"3.0.1","info":{"title":"Schema Service","version":"0.0.1"},"tags":[{"name":"Custom Schema 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":{"CustomSchemaTypeUpdate":{"type":"object","properties":{"name":{"type":"object","description":"Localized custom type name in a form of a map of translations."},"metadata":{"type":"object","properties":{"version":{"type":"integer","description":"Version of the custom schema type. If provided, it will be validated against the current entity version."}}}},"required":["name"]},"IdResponse":{"type":"object","properties":{"id":{"type":"string","description":"ID of the generated document."}},"description":"Id of the created schema."},"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"}}}}}}}}},"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"}}}}},"parameters":{"trait_contentLanguage_header":{"in":"header","name":"Content-Language","description":"The Content-Language request HTTP header defines language(s) of the payload.","schema":{"type":"string"}}}},"paths":{"/schema/{tenant}/custom-entities/{id}":{"put":{"summary":"Upserting a custom schema type","description":"Performs the `UPSERT` operation. If a custom schema type with specified ID exists in the system, then it is updated. If it doesn't exist, a new type is created.\n\n**Note**: When a custom entity type is created, a set of custom scopes is created, which allow managing custom instances of that type.","tags":["Custom Schema Type"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomSchemaTypeUpdate"}}},"description":""},"responses":{"201":{"description":"Custom schema type was successfully created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdResponse"}}}},"204":{"description":"Custom schema type was successfully updated."},"400":{"$ref":"#/components/responses/Bad_request_400_cl"},"401":{"$ref":"#/components/responses/Unauthorized_401"},"403":{"$ref":"#/components/responses/Forbidden_403"},"409":{"description":"Version validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"operationId":"PUT-schema-upsert-custom-schema-type","parameters":[{"$ref":"#/components/parameters/trait_contentLanguage_header"}]}}}}
```

## Deleting a custom schema type

> Deletes a single custom type. This operation will fail if there are schemas or custom instances assigned to this custom type.\
> \
> \*\*Note\*\*: Removing a custom entity type does not remove the custom scopes that were created when the type was added. Those scopes remain in the system until you remove them manually, if needed.

```json
{"openapi":"3.0.1","info":{"title":"Schema Service","version":"0.0.1"},"tags":[{"name":"Custom Schema 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":{"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}/custom-entities/{id}":{"delete":{"summary":"Deleting a custom schema type","description":"Deletes a single custom type. This operation will fail if there are schemas or custom instances assigned to this custom type.\n\n**Note**: Removing a custom entity type does not remove the custom scopes that were created when the type was added. Those scopes remain in the system until you remove them manually, if needed.","tags":["Custom Schema Type"],"responses":{"204":{"description":"Custom schema type was succefully removed"},"400":{"description":"Bad request. This may happen when there are schemas or custom instances associated with this custom type.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"$ref":"#/components/responses/Unauthorized_401"},"403":{"$ref":"#/components/responses/Forbidden_403"}},"operationId":"DELETE-schema-remove-custom-schema-type"}}}}
```


---

# 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/api-guides/utilities/schema/api-reference/custom-schema-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.
