> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chartdb.io/llms.txt
> Use this file to discover all available pages before exploring further.

# ChartDB API – Programmatically Manage & Auto‑Update Diagrams

> Use the ChartDB API to automate ER‑diagram creation and updates. Authenticated via API key, JSON‑formatted, ideal for CI/CD workflows and internal tools.

## Introduction

The ChartDB API enables programmatic access to manage and auto-update your database diagrams.
It supports authenticated requests using API keys, follows standard HTTP methods and response codes,
and accepts JSON-formatted request and response bodies. Use the API to sync your schema changes,
automate diagram generation, and integrate ChartDB into your CI/CD workflows or internal tools.

## Base URL

All API requests should be made to the following base URL:

```bash theme={null}
https://api.chartdb.io/api
```

## Authentication

To authenticate your requests, include an API key in the Authorization header:

```bash theme={null}
Authorization: Bearer ch_123456789
```

Your API key can be found in your ChartDB dashboard settings. Keep it secure and never share it publicly.

<Steps>
  <Step title="Create an API Key" icon="plus">
    <Frame style={{ width: "70%" }}>
      <img src="https://mintcdn.com/buckledev/Nk8pE0k5UNFAdU1u/docs/images/api/create-api-key.png?fit=max&auto=format&n=Nk8pE0k5UNFAdU1u&q=85&s=ff072a61be765bd048108322bb338e2c" width="1400" height="1206" data-path="docs/images/api/create-api-key.png" />
    </Frame>
  </Step>

  <Step title="Copy your API Key" icon="copy">
    <Frame style={{ width: "70%" }}>
      <img src="https://mintcdn.com/buckledev/Nk8pE0k5UNFAdU1u/docs/images/api/api-key.png?fit=max&auto=format&n=Nk8pE0k5UNFAdU1u&q=85&s=6da9409a8265d6d9dd7faf393d627248" width="1168" height="818" data-path="docs/images/api/api-key.png" />
    </Frame>
  </Step>
</Steps>

## Response Format

All responses are returned in JSON format. Successful responses will include `status` & `message` fields:

```json theme={null}
{
  "status": "success",
  "message": "Diagram updated successfully"
}
```

Error responses will include `status` & `message` fields:

```json theme={null}
{
  "status": "error",
  "message": "Invalid API key"
}
```

## Request Format

For POST and PUT requests, send data in JSON format with the appropriate `Content-Type` header:

```bash theme={null}
Content-Type: application/json
```

## API Versioning

The current version is `api`. We include versioning in the URL path:

```bash theme={null}
https://api.chartdb.ioo/api/update_diagram
```

Future versions will be announced with appropriate migration guides and deprecation notices.
