View all methods
scorecards.list
List scorecards. By default, only published scorecards are returned. Pass include_unpublished as true to also include draft scorecards.
Facts
| Method | GET https://api.getdx.com/scorecards.list |
| Required scope | scorecards:read |
Required arguments
| Name | Type | Description |
|---|---|---|
token |
Token |
Auth token passed as an HTTP header. |
Optional arguments
| Name | Type | Description |
|---|---|---|
cursor |
String |
Cursor used to request the next page. Can be found in prior request via response_metadata.next_cursor. |
limit |
Integer |
Limit the number of scorecards per page. Defaults to 50. |
include_unpublished |
Boolean |
When true, include draft scorecards in addition to published ones. Defaults to false (published only). |
Example request
This is a typical request:
curl -X GET https://api.getdx.com/scorecards.list?cursor=xuvkgfq9t0ty&limit=50 \
-H 'Accept: application/json' \
-H 'Authorization: Bearer xxxx-xxxxxxxxx-xxxx'
To include unpublished (draft) scorecards:
curl -X GET 'https://api.getdx.com/scorecards.list?include_unpublished=true' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer xxxx-xxxxxxxxx-xxxx'
Example response
This is a typical success response:
{
"ok": true,
"scorecards": [
{
"id": "qjfj1a6cmit4",
"name": "Reliability",
"description": "",
"type": "LEVEL",
"published": true,
"entity_filter_type": "entity_types",
"entity_filter_sql": null,
"entity_filter_type_ids": ["4aav7arl6mo6"],
"tags": [{ "value": "production", "color": "#38bdf8" }],
"editors": [],
"admins": [
{
"id": 123456,
"email": "beethoven@example.com",
"name": "Ludwig van Beethoven",
"avatar": "https://avatars.slack-edge.com/2024-07-05/1234567890.jpg",
"created_at": "2024-06-28T04:03:53.245Z"
}
],
"sql_errors": [],
"levels": [
{
"id": "vic57y3o55r4",
"name": "Bronze",
"rank": 1,
"color": "#fdba74"
},
{
"id": "nqbw5y1fogur",
"name": "Silver",
"rank": 2,
"color": "#9ca3af"
},
{
"id": "mfq00xe2z3vm",
"name": "Gold",
"rank": 3,
"color": "#fbbf24"
}
],
"empty_level_label": "None",
"empty_level_color": "#e5e7eb",
"checks": [
{
"id": "y3ynphtim81c",
"ordering": 0,
"name": "Has Owner",
"description": "Important for entities to have an owner",
"sql": "SELECT CASE\n WHEN count(*) > 0 THEN 'PASS'\n ELSE 'FAIL'\n END AS status\nFROM dx_catalog_entities e\n JOIN dx_catalog_entity_owners o ON e.id = o.entity_id\nWHERE e.identifier = $entity_identifier;",
"filter_sql": null,
"filter_message": null,
"output_enabled": false,
"output_type": null,
"output_custom_options": null,
"output_aggregation": null,
"external_url": null,
"published": true,
"level": { "id": "vic57y3o55r4", "name": "Bronze" }
},
{
"id": "5p63mg261ypp",
"ordering": 0,
"name": "Another check",
"description": "asdf",
"sql": "SELECT 'PASS' AS status, 123 AS output",
"filter_sql": "",
"filter_message": "",
"output_enabled": true,
"output_type": "custom",
"output_custom_options": { "unit": "widget", "decimals": "auto" },
"output_aggregation": "mean",
"external_url": "",
"published": true,
"level": { "id": "nqbw5y1fogur", "name": "Silver" }
},
{
"id": "pevrw9vec5rk",
"ordering": 0,
"name": "Has tier",
"description": "### Why this matters\n\n### How to pass this check\n\n### Resources",
"sql": "SELECT CASE\n WHEN count(*) > 0 THEN 'PASS'\n ELSE 'FAIL'\n END AS status\nFROM dx_catalog_entities e\n JOIN dx_catalog_entity_properties ep ON e.id = ep.entity_id\n JOIN dx_catalog_properties p ON p.id = ep.property_id\nWHERE e.identifier = $entity_identifier\n AND p.identifier = 'tier';",
"filter_sql": null,
"filter_message": null,
"output_enabled": false,
"output_type": null,
"output_custom_options": null,
"output_aggregation": null,
"external_url": null,
"published": true,
"level": { "id": "mfq00xe2z3vm", "name": "Gold" }
}
]
},
{
"id": "glgixbdsuiyx",
"name": "Security",
"description": "",
"type": "POINTS",
"published": true,
"entity_filter_type": "entity_types",
"entity_filter_sql": "",
"entity_filter_type_ids": ["4aav7arl6mo6"],
"tags": [{ "value": "production", "color": "#38bdf8" }],
"editors": [],
"admins": [
{
"id": 123456,
"email": "beethoven@example.com",
"name": "Ludwig van Beethoven",
"avatar": "https://avatars.slack-edge.com/2024-07-05/1234567890.jpg",
"created_at": "2024-06-28T04:03:53.245Z"
}
],
"sql_errors": [],
"check_groups": [
{
"id": "wa0njq9ywznb",
"name": "Checks",
"ordering": 0
}
],
"checks": [
{
"id": "mhplopawynb0",
"ordering": 0,
"name": "SAST runs in CI",
"description": "",
"sql": "select 'PASS' as status",
"filter_sql": "",
"filter_message": "",
"output_enabled": false,
"output_type": null,
"output_custom_options": null,
"output_aggregation": null,
"external_url": "",
"published": true,
"points": 5,
"check_group": {
"id": "wa0njq9ywznb",
"name": "Checks"
}
},
{
"id": "xa5d6qr6zees",
"ordering": 1,
"name": "No open incidents",
"description": "",
"sql": "select 'PASS' as status",
"filter_sql": "",
"filter_message": "",
"output_enabled": false,
"output_type": null,
"output_custom_options": null,
"output_aggregation": null,
"external_url": "",
"published": true,
"points": 10,
"check_group": {
"id": "wa0njq9ywznb",
"name": "Checks"
}
}
]
}
],
"response_metadata": {
"next_cursor": "xuvkgfq9t0ty"
}
}
Errors
This table lists the expected errors that this method could return. However, other errors can be returned in the case where the service is down or other unexpected factors affect processing. Callers should always check the value of the ok param in the response.
| Error | Description |
|---|---|
not_authed |
No authentication token provided. |
invalid_auth |
Some aspect of authentication cannot be validated. |
invalid_arguments |
One or more of the arguments provided is invalid. |