tidb DDL API

Endpoints for managing and inspecting DDL jobs, including ownership and history.

Operations 2

GET /ddl/history Get DDL job history #
POST /ddl/owner/resign Resign DDL owner #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/tidb-ddl-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

tidb-ddl-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: TiDB HTTP DDL API
  description: The TiDB HTTP API is a built-in administrative interface available on self-managed TiDB server instances, accessible on port 10080 by default. It exposes endpoints for retrieving server status, database and table schema information, region metadata, MVCC key details, DDL job history, hot region data, and server configuration. Operators and monitoring systems use this API to inspect the internal state of a running TiDB node, integrate with observability tooling, and troubleshoot distributed SQL execution. The API does not require authentication by default and is intended for use within trusted internal networks. The port can be configured in tidb.toml via the status.status-port setting.
  version: '1.0'
  contact:
    name: TiDB GitHub
    url: https://github.com/pingcap/tidb/blob/master/docs/tidb_http_api.md
  termsOfService: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: http://localhost:10080
  description: Local TiDB Node (default status port)
tags:
- name: DDL
  description: Endpoints for managing and inspecting DDL jobs, including ownership and history.
paths:
  /ddl/history:
    get:
      operationId: getDdlHistory
      summary: Get DDL job history
      description: Returns the history of DDL (Data Definition Language) jobs executed on the cluster, such as CREATE TABLE, ALTER TABLE, DROP INDEX, and similar schema change operations. Results are paginated using start_job_id and limit parameters. DDL history is useful for auditing schema changes and diagnosing failed schema modifications.
      tags:
      - DDL
      parameters:
      - name: start_job_id
        in: query
        description: The DDL job ID to start listing from, for pagination.
        required: false
        schema:
          type: integer
      - name: limit
        in: query
        description: Maximum number of DDL job history records to return.
        required: false
        schema:
          type: integer
      responses:
        '200':
          description: DDL job history retrieved successfully.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DdlJob'
  /ddl/owner/resign:
    post:
      operationId: resignDdlOwner
      summary: Resign DDL owner
      description: Forces the current TiDB server to resign its role as the DDL owner, triggering a new DDL owner election among all TiDB servers in the cluster. Only one TiDB server is the DDL owner at any time and is responsible for executing schema change jobs. Use this endpoint when the current DDL owner is experiencing issues.
      tags:
      - DDL
      responses:
        '200':
          description: DDL owner resignation initiated successfully.
components:
  schemas:
    DdlJob:
      type: object
      description: A DDL job record from TiDB's schema change history.
      properties:
        id:
          type: integer
          description: The unique numeric DDL job ID.
        type:
          type: string
          description: The DDL job type (e.g., create table, add index, drop column).
        schema_id:
          type: integer
          description: The ID of the database schema affected by this DDL job.
        table_id:
          type: integer
          description: The ID of the table affected by this DDL job.
        schema_name:
          type: string
          description: The database name affected by this DDL job.
        table_name:
          type: string
          description: The table name affected by this DDL job.
        state:
          type: string
          description: The current state of the DDL job (done, synced, cancelled, etc.).
        start_time:
          type: integer
          description: The Unix timestamp when the DDL job started.
        error:
          type: string
          description: Error message if the DDL job failed.
externalDocs:
  description: TiDB HTTP API Reference
  url: https://github.com/pingcap/tidb/blob/master/docs/tidb_http_api.md