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

# Update Diagram

> Update an existing database diagram

The Update Diagram endpoint allows you to modify an existing database diagram's properties.

## Authorizations

**Authorization** `string` *required*

Bearer authentication header of the form `Bearer <api_key>`, where `<api_key>` is your auth token from ChartDB starts with `ch_`. Tokens are per diagram: generate one from the diagram's **Connect** panel. A token only works for the diagram it was created for.

## Path Parameters

**diagram\_id** `string` *required*

The unique identifier of the diagram.

![](https://mintcdn.com/buckledev/Nk8pE0k5UNFAdU1u/docs/images/api/chartdb-diagram-id.png?fit=max\&auto=format\&n=Nk8pE0k5UNFAdU1u\&q=85\&s=95d4e9d8b46b11c60ad34c50dffa75f4)

## Request Body

**diagram\_name** `string`

New name for the diagram.

**json\_metadata** `object`

Updated diagram settings in JSON format. (See
[Examples](https://docs.chartdb.io/docs/api/examples/postgresql.md) for more information)

```bash cURL theme={null}
curl -X POST https://api.chartdb.io/api/update_diagram/123456789 \
  -H "Authorization: Bearer ch_123456789" \
  -H "Content-Type: application/json" \
  -d '{
    "diagram_name": "Updated E-commerce Diagram",
    "json_metadata": {
      "fk_info": [],
      "pk_info": [],
      "columns": [],
      "indexes": [],
      "tables": [],
      "views": [],
      "database_name": "postgres",
      "version": ""
    }
  }'
```

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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.