Semaphor

Validate a single dashboard

Checks a dashboard's configuration against the live database schema to identify broken references before they cause runtime errors. The validator inspects:

  • Card fields: column references, metrics, group-by, sort, and pivot fields
  • Matrix cards: the definition in config.matrix, with the path of each part that doesn't match (for example config.matrix.spec.rows.0.id), and every row, column, measure, formula input and filter field it names, checked against its dataset or table. A Matrix card with no config.matrix, or with no dataSource, is reported too.
  • Filters: field references in every dashboard filter
  • Joins: source/target entity and key column validity
  • Connections: whether referenced connections still exist. A card that runs a query but names no connection on the card, its data source or its fields is reported, because its fields can't be checked.
  • Datasets & data models: whether referenced semantic datasets and data models still exist
  • Data scope: the dashboard's selected entities
  • Linked visuals: whether linked saved visuals still exist

When a field reference is invalid, the response includes the list of available columns and up to N closest-matching suggestions (controlled by maxSuggestionsPerField).

POST
/api/v1/dashboard/validate

Authorization

BearerAuth
AuthorizationBearer <token>

A project-scoped or dashboard-scoped access token. Generate one via the Token API using your project ID and project secret.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X post "https://semaphor.cloud/api/v1/dashboard/validate" \  -H "Content-Type: application/json" \  -d '{    "dashboardId": "string"  }'
{
  "dashboardId": "string",
  "dashboardTitle": "string",
  "isValid": true,
  "validatedAt": "2019-08-24T14:15:22Z",
  "summary": {
    "totalCards": 0,
    "validCards": 0,
    "invalidCards": 0,
    "totalFields": 0,
    "validFields": 0,
    "invalidFields": 0,
    "totalFilters": 0,
    "validFilters": 0,
    "invalidFilters": 0,
    "totalJoins": 0,
    "validJoins": 0,
    "invalidJoins": 0,
    "totalConnections": 0,
    "validConnections": 0,
    "invalidConnections": 0,
    "totalDatasets": 0,
    "validDatasets": 0,
    "invalidDatasets": 0,
    "totalDatamodels": 0,
    "validDatamodels": 0,
    "invalidDatamodels": 0,
    "aiContextValid": true
  },
  "cardResults": [
    {
      "cardId": "string",
      "cardTitle": "string",
      "sheetId": "string",
      "sheetTitle": "string",
      "frameId": "string",
      "isValid": true,
      "connectionId": "string",
      "connectionName": "string",
      "dataSourceType": "table",
      "dataSourceName": "string",
      "fieldResults": [
        {
          "fieldId": "string",
          "fieldName": "string",
          "fieldRole": "groupby",
          "entityId": "string",
          "entityName": "string",
          "qualifiedFieldName": "string",
          "isValid": true,
          "errorType": "string",
          "errorMessage": "string",
          "availableColumns": [
            "string"
          ],
          "suggestion": "string"
        }
      ],
      "joinResults": {
        "isValid": true,
        "baseEntityValid": true,
        "baseEntityName": "string",
        "baseEntityError": "string",
        "joins": [
          {
            "joinId": "string",
            "sourceEntity": "string",
            "targetEntity": "string",
            "sourceEntityValid": true,
            "targetEntityValid": true,
            "keyResults": [
              {
                "sourceField": "string",
                "targetField": "string",
                "sourceFieldValid": true,
                "targetFieldValid": true,
                "sourceErrorMessage": "string",
                "targetErrorMessage": "string",
                "sourceSuggestion": "string",
                "targetSuggestion": "string"
              }
            ]
          }
        ]
      },
      "errors": [
        "string"
      ]
    }
  ],
  "filterResults": [
    {
      "filterId": "string",
      "filterTitle": "string",
      "connectionId": "string",
      "isValid": true,
      "fieldResults": [
        {
          "fieldId": "string",
          "fieldName": "string",
          "fieldRole": "groupby",
          "entityId": "string",
          "entityName": "string",
          "qualifiedFieldName": "string",
          "isValid": true,
          "errorType": "string",
          "errorMessage": "string",
          "availableColumns": [
            "string"
          ],
          "suggestion": "string"
        }
      ],
      "errors": [
        "string"
      ]
    }
  ],
  "resourceResults": {
    "connections": [
      {
        "connectionId": "string",
        "connectionName": "string",
        "isValid": true,
        "errorMessage": "string",
        "usedByCards": [
          "string"
        ]
      }
    ],
    "datasets": [
      {
        "domainId": "string",
        "datasetName": "string",
        "isValid": true,
        "errorMessage": "string",
        "usedByCards": [
          "string"
        ]
      }
    ],
    "datamodels": [
      {
        "datamodelId": "string",
        "datamodelName": "string",
        "isValid": true,
        "errorMessage": "string",
        "usedByCards": [
          "string"
        ]
      }
    ]
  },
  "aiContextResult": {},
  "errors": [
    "string"
  ],
  "warnings": [
    "string"
  ]
}
{
  "error": "string",
  "code": "string",
  "errorCode": "string",
  "details": {},
  "success": true
}
{
  "error": "string",
  "code": "string",
  "errorCode": "string",
  "details": {},
  "success": true
}
{
  "error": "string",
  "code": "string",
  "errorCode": "string",
  "details": {},
  "success": true
}
{
  "error": "string",
  "code": "string",
  "errorCode": "string",
  "details": {},
  "success": true
}
{
  "error": "string",
  "code": "string",
  "errorCode": "string",
  "details": {},
  "success": true
}