---
title: Custom table internals and API
related:
  - https://docs.kentico.com/13/developing-websites/defining-website-content-structure/managing-custom-tables.md
  - https://docs.kentico.com/13/custom-development/database-table-api.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

## Database tables

Custom tables uses the following database tables:

| Database table       | Description                                                                                                                                                                                     |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| CMS\_Class           | Custom tables are stored as classes in the system database, this database table is used for storing information about classes.                                                                  |
| CMS\_ClassSite       | This table is used to assign classes (and therefore also custom tables) to particular sites in the system.                                                                                      |
| CMS\_Query           | Contains records representing SQL queries for operations with data in custom tables, along with other queries used by the system.                                                               |
| CMS\_AlternativeForm | Contains records representing alternative forms for particular custom tables, together with other alternative forms used by the system.                                                         |
| \_                   | Particular custom tables are stored as standard tables in the system database. You can distinguish them by giving them a descriptive prefix, while the customtable\_ prefix is used by default. |

![](https://docs.kentico.com/docsassets/13/custom-table-internals-and-api/2013-04-18_145915.png)

## API classes

All default Custom table classes are under the **CMS.CustomTables** namespace. See our [API Examples](https://docs.kentico.com/13api/content-management/custom-table-data.md) for code samples illustrating this functionality.

| Class                   | Description                                          |
| ----------------------- | ---------------------------------------------------- |
| **Custom Tables API**   |                                                      |
| CustomTableItem         | Represents one custom table object.                  |
| CustomTableItemProvider | Provides management functionality for custom tables. |
