godo.Insights.ListDashboards()

Generated on 25 Nov 2026 from godo version v1.246.0

Usage

client.Insights.ListDashboards(ctx context.Context, opt *godo.DashboardListOptions) (*godo.DashboardList, *godo.Response, error)

Description

ListDashboards lists the team’s dashboards. Without a Sort, results are newest first; see DashboardListOptions for how Sort and SortDirection interact. The API returns 400 for a PerPage above 200, an unknown Sort field, or an unknown SortDirection.

This method sends a GET request to /v2/insights/dashboards.

Parameters

opt *godo.DashboardListOptions

Fields of godo.DashboardListOptions

DashboardListOptions are pagination and sort parameters for listing dashboards. PerPage defaults to 20; the API rejects values above 200.

When Sort is empty, results are ordered by created_at descending and SortDirection is ignored. When Sort is set, SortDirection defaults to ascending.

Page int
PerPage int
Sort string

Sort is one of the InsightsDashboardSort* field constants. Any other
value is rejected by the API.

SortDirection string

SortDirection is InsightsDashboardSortAscending or
InsightsDashboardSortDescending. Only applied when Sort is set, in
which case it defaults to ascending. Any other value is rejected by
the API.

Returns

*godo.DashboardList
*godo.Response

The HTTP response, with pagination Links, Meta, and Rate limit information.

error

Non-nil when the request fails. API errors are returned as *godo.ErrorResponse.

Fields of godo.DashboardList

DashboardList is a page of dashboards.

Dashboards []godo.Dashboard

Omitted from JSON when empty. JSON key: dashboards

Pagination *godo.DashboardsPagination

Omitted from JSON when empty. JSON key: pagination

Request Sample

Show Request Sample
package main

import (
	"context"
	"fmt"
	"log"
	"os"

	"github.com/digitalocean/godo"
)

func main() {
	client := godo.NewFromToken(os.Getenv("DIGITALOCEAN_TOKEN"))
	ctx := context.TODO()

	result, _, err := client.Insights.ListDashboards(ctx, &godo.DashboardListOptions{
		Page: 1234567,
		PerPage: 1234567,
		Sort: "<your-sort>",
		SortDirection: "<your-sort-direction>",
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", result)
}

Response Example

Show Response Example
{
  "dashboards": [
    {
      "uuid": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
      "name": "Droplet CPU",
      "description": "CPU utilization across production Droplets.",
      "spec": "{\"kind\": \"Dashboard\", \"spec\": {\"panels\": {\"cpu\": {\"kind\": \"Panel\", \"spec\": {\"plugin\": {\"kind\": \"TimeSeriesChart\", \"spec\": {}}, \"display\": {\"name\": \"CPU utilization\"}, \"queries\": [{\"kind\": \"TimeSeriesQuery\", \"spec\": {\"plugin\": {\"kind\": \"MetricsTimeSeriesQuery\", \"spec\": {\"kind\": \"gauge\", \"filters\": [], \"groupBy\": [], \"metricName\": \"do.droplets.cpu_utilization\"}}}}]}}}, \"display\": {\"name\": \"Droplet CPU\", \"description\": \"CPU utilization across production Droplets.\"}, \"layouts\": [{\"kind\": \"Grid\", \"spec\": {\"items\": [{\"x\": 0, \"y\": 0, \"width\": 12, \"height\": 6, \"content\": {\"$ref\": \"#/spec/panels/cpu\"}}]}}], \"duration\": \"1h\", \"variables\": []}, \"apiVersion\": \"perses.dev/v1alpha1\"}",
      "created_at": "2026-10-29T10:21:44Z",
      "updated_at": "2026-10-29T10:21:44Z"
    },
    {
      "uuid": "3f2504e0-4f89-41d3-9a0c-0305e82c3301",
      "name": "Load balancer traffic",
      "spec": "{\"kind\": \"Dashboard\", \"spec\": {\"panels\": {\"requests\": {\"kind\": \"Panel\", \"spec\": {\"plugin\": {\"kind\": \"TimeSeriesChart\", \"spec\": {}}, \"display\": {\"name\": \"Requests per second\"}, \"queries\": [{\"kind\": \"TimeSeriesQuery\", \"spec\": {\"plugin\": {\"kind\": \"MetricsTimeSeriesQuery\", \"spec\": {\"kind\": \"gauge\", \"filters\": [], \"groupBy\": [], \"metricName\": \"do.load_balancers.requests_per_second\"}}}}]}}}, \"display\": {\"name\": \"Load balancer traffic\"}, \"layouts\": [{\"kind\": \"Grid\", \"spec\": {\"items\": [{\"x\": 0, \"y\": 0, \"width\": 12, \"height\": 6, \"content\": {\"$ref\": \"#/spec/panels/requests\"}}]}}], \"duration\": \"6h\", \"variables\": []}, \"apiVersion\": \"perses.dev/v1alpha1\"}",
      "created_at": "2026-10-27T16:09:31Z",
      "updated_at": "2026-10-28T09:12:05Z"
    }
  ],
  "pagination": {
    "page": 1,
    "pages": 1,
    "per_page": 20,
    "total": 2
  }
}

More Information

See GET /v2/insights/dashboards in the API reference for additional detail on responses, headers, parameters, and more.

See the Go package documentation for the source of this method.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.