godo.Insights.ListDashboards()

Generated on 5 Nov 2026 from godo version v1.236.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.

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)
}

More Information

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.