Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/pingcap/tidb/llms.txt

Use this file to discover all available pages before exploring further.

All endpoints are served on the TiDB status port (default 10080). See HTTP API Overview for base URL and security notes.

GET /status

Returns the current server status including active connections, build version, and statistics initialization progress.
curl http://127.0.0.1:10080/status
{
    "connections": 0,
    "git_hash": "f572e33854e1c0f942f031e9656d0004f99995c6",
    "version": "5.7.25-TiDB-v2.1.0-rc.3-355-gf572e3385-dirty",
    "status": {
        "init_stats_percentage": 100
    }
}
connections
integer
Number of currently open client connections.
git_hash
string
Git commit hash of the running TiDB binary.
version
string
TiDB version string.
status.init_stats_percentage
integer
Percentage of statistics initialization completed at startup. 100 means fully initialized.

GET /metrics

Returns all Prometheus metrics for this TiDB instance in the standard Prometheus exposition format.
curl http://127.0.0.1:10080/metrics
# HELP tidb_server_connections The number of connections currently open.
# TYPE tidb_server_connections gauge
tidb_server_connections 0
# HELP tidb_server_query_total Counter of queries.
# TYPE tidb_server_query_total counter
tidb_server_query_total{result="OK",type="Select"} 1234
...
This endpoint is intended to be scraped by Prometheus. The output format follows the Prometheus text exposition format.

GET /regions/meta

Returns metadata for all regions known to this TiDB instance, including leader, peers, and epoch information.
curl http://127.0.0.1:10080/regions/meta
[
    {
        "leader": {
            "id": 5,
            "store_id": 1
        },
        "peers": [
            {
                "id": 5,
                "store_id": 1
            }
        ],
        "region_epoch": {
            "conf_ver": 1,
            "version": 2
        },
        "region_id": 4
    }
]
region_id
integer
Unique region identifier.
leader
object
The current leader peer for this region.
peers
array
All peers (replicas) for this region.
region_epoch
object
Epoch metadata used for routing consistency.

GET /regions/hot

Returns the currently hot (high-traffic) read and write regions, grouped by table and index.
curl http://127.0.0.1:10080/regions/hot
{
    "read": [],
    "write": [
        {
            "db_name": "sbtest1",
            "table_name": "sbtest13",
            "index_name": "",
            "flow_bytes": 220718,
            "max_hot_degree": 12,
            "region_count": 1
        }
    ]
}
read
array
Hot regions for read traffic.
write
array
Hot regions for write traffic.

GET /tables///regions

Returns region distribution information for a specific table, including record regions and index regions.
curl http://127.0.0.1:10080/tables/test/t1/regions
{
    "id": 286,
    "name": "t1",
    "indices": [],
    "record_regions": [
        {
            "leader": {
                "id": 4002,
                "store_id": 1
            },
            "peers": [
                {
                    "id": 4002,
                    "store_id": 1
                }
            ],
            "region_epoch": {
                "conf_ver": 1,
                "version": 83
            },
            "region_id": 4001
        }
    ]
}
id
integer
Table ID.
name
string
Table name.
indices
array
Index region information (same structure as record_regions).
record_regions
array
Regions holding the table’s row data.

GET /schema

Returns schema information for all databases.
curl http://127.0.0.1:10080/schema
[
    {
        "charset": "utf8mb4",
        "collate": "utf8mb4_bin",
        "db_name": {
            "L": "test",
            "O": "test"
        },
        "id": 266,
        "state": 5
    }
]
id
integer
Internal database ID.
db_name
object
Database name in original (O) and lowercase (L) forms.
charset
string
Default character set for the database.
collate
string
Default collation for the database.
state
integer
Schema state (5 = public/active).

GET /schema/

Returns table listing for the specified database. Add ?id_name_only=true to get a compact list of table IDs and names.
curl http://127.0.0.1:10080/schema/test

# Compact form
curl "http://127.0.0.1:10080/schema/test?id_name_only=true"
[
    {
        "id": 119,
        "name": {
            "O": "t1",
            "L": "t1"
        }
    },
    {
        "id": 125,
        "name": {
            "O": "t2",
            "L": "t2"
        }
    }
]

GET /schema//

Returns the full schema definition for a specific table.
curl http://127.0.0.1:10080/schema/test/t1
You can also look up a table by its internal ID:
curl "http://127.0.0.1:10080/schema?table_id=286"

# Multiple IDs
curl "http://127.0.0.1:10080/schema?table_ids=286,287,288"

GET /settings

Returns the current runtime settings for this TiDB instance as a JSON object.
curl http://127.0.0.1:10080/settings
The response is a JSON object containing all configurable runtime parameters. Use POST /settings to update them; see the Administration API for details.

Build docs developers (and LLMs) love