PermuteDocs
Go to Permute

Dashboards · dashboardsSourceGet

Get dashboard source

Returns the complete dashboard TSX source plus the dashboard draft revision and data run required for a safe replacement.

GET/v1/dashboards/{dashboardId}/source
betaapiKeyworkspace

When to use

Read an existing dashboard source before editing its TSX.

For agents

Keep the returned revision and dataRunId unchanged in the corresponding update. Refetch after a conflict.

Example

typescript
import { PermuteClient } from '@permute/sdk';

const orgClient = new PermuteClient({
  apiKey: process.env.PERMUTE_API_KEY!,
});

const client = orgClient.withWorkspace(process.env.PERMUTE_WORKSPACE_ID!);

const result = await client.dashboards.getSource('oper_revenue123');

Response

json
{
  "data": {
    "dashboardId": "oper_revenue123",
    "source": "export default function Dashboard({ data }) { return <div>{data.revenue}</div>; }",
    "revision": {
      "revisionId": "rvsn_dashboard1",
      "sequence": 1
    },
    "dataRunId": "oprn_revenue123"
  }
}