> For the complete documentation index, see [llms.txt](https://apidocs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.akinon.com/commerce-openapis/admin/schema-types.md).

# Schema Types

Administrative endpoints for **schema types** — the registry that maps a model (a Django content type) to a JSON-schema definition describing the structured attribute data allowed for that model's instances. There is exactly one schema type per content type. Schema types back the dynamic/EAV attribute data used by products, attributes, subscriptions, order requests, menu items, bundle chapters, and other models.

### Core Capabilities

**1. Listing & Filtering**

* Retrieve a paginated list of schema types.
* Filter by `app_label` or `model`.
* Order results with the `sort` parameter.

**2. Create & Update**

* Create a schema type for a content type.
* Retrieve a single schema type — addressed by **model name**, not by numeric identifier (see **Addressing a Record**).
* Fully or partially update the `schema` of an existing record.

**Delete is not supported** — there is no `DELETE` route (`405 Method Not Allowed`).

### Schema Type Fields

| Field           | Type               | Description                                                                                                                                          |
| --------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `pk`            | integer            | The unique identifier of the record. Read-only.                                                                                                      |
| `content_type`  | integer            | The identifier of the Django content type (model) this schema describes. Required on create; unique across all schema types. Not writable on update. |
| `schema`        | object             | The JSON-schema document describing the model's structured attribute data. Required on create and on update.                                         |
| `model`         | string             | Read-only. The model name of the content type (for example `product`).                                                                               |
| `created_date`  | string (date-time) | Read-only. When the record was created.                                                                                                              |
| `modified_date` | string (date-time) | Read-only. When the record was last modified.                                                                                                        |

### Addressing a Record

Detail operations key on the **model name** of the content type, not the numeric identifier: `/schema_types/{content_type__model}/` — for example `/schema_types/product/`. The additional `/schema_types/{content_type__model}/detailed/` route returns the same representation as retrieve.

### Filtering & Ordering

| Parameter   | Match                                                                 |
| ----------- | --------------------------------------------------------------------- |
| `app_label` | Exact match on the content type's app label (for example `products`). |
| `model`     | Exact match on the content type's model name (for example `product`). |

Use the `sort` parameter to order the results; any field is orderable. Prefix a field with a hyphen for descending order.

### Dynamic Settings & Environment Variables

No dynamic settings (`dj_dynamic_settings`) are read by these endpoints, and no environment variables are read directly.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://apidocs.akinon.com/commerce-openapis/admin/schema-types.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
