> ## 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.

# Embeded Diagrams

> API endpoints for managing database diagrams

<img src="https://mintcdn.com/buckledev/Nk8pE0k5UNFAdU1u/docs/images/api/embeded-diagram-example.png?fit=max&auto=format&n=Nk8pE0k5UNFAdU1u&q=85&s=ccbde9876f130ce1e15027d4b0c99c52" width="3104" height="1836" data-path="docs/images/api/embeded-diagram-example.png" />

## Private Access with API Keys

You can access private diagrams without authentication by using an API key in the diagram's URL. This is particularly useful for:

* Embedding private diagrams in documentation
* Sharing diagrams with specific users without requiring them to log in
* Integrating diagrams in internal tools

### Getting the Embedded Link

1. Go to your API Keys settings in ChartDB
2. Find the API key associated with your diagram
3. Click the three dots menu (⋮) and select "Copy Embedded Link"

<Frame style={{ width: "70%" }}>
  <img src="https://mintcdn.com/buckledev/Nk8pE0k5UNFAdU1u/docs/images/api/get_embeded_link_with_api_key.png?fit=max&auto=format&n=Nk8pE0k5UNFAdU1u&q=85&s=1f08036123d06d2a6220d20ee8777ce0" className="rounded-lg border border-zinc-200 dark:border-zinc-700" width="1436" height="1216" data-path="docs/images/api/get_embeded_link_with_api_key.png" />
</Frame>

### Usage

Simply append your API key as a query parameter to the diagram URL:

```
https://app.chartdb.io/diagram/{diagram_id}?api_key={your_api_key}
```

Example:

```
https://app.chartdb.io/diagram/9df7f9d1e30c442c94bd04?api_key=ch_529b512d_4bcd79e15f8ef1b1019f5317
```

### Benefits

* **No Authentication Required**: Users can view private diagrams directly through the URL
* **Granular Access Control**: Each API key can be scoped to specific diagrams
* **Secure Sharing**: Share diagrams privately without exposing them publicly
* **Easy Integration**: Perfect for embedding in documentation, wikis, or internal tools

### Security Considerations

* Keep your API keys secure and rotate them periodically
* Each API key should only have access to the diagrams it needs
* Monitor API key usage through your ChartDB dashboard
