[ Web Proxy ]
URL:
Viewing: https://docs.digitalocean.com/reference/pydo/reference/security/list_secrets/ [Back]  [Original]

pydo.security.list_secrets() | DigitalOcean Documentation

For AI agents: The documentation index is at https://docs.digitalocean.com/llms.txt. Markdown versions of pages use the same URL with index.html.md in place of the HTML page (for example, append index.html.md to the directory path instead of opening the HTML document).

pydo.security.list_secrets()

Generated on 3 Aug 2026 from pydo version v0.40.0

Copy page as Markdown View page as Markdown

Usage

client.security.list_secrets(per_page=20, page=1)
Returns JSONRaises HttpResponseError

Description

To list secrets across all configured regions, send a GET request to /v2/security/secrets.

Parameters

per_page integer optional

Number of items returned per page

Min: 1

Max: 200

Default: 20

page integer optional

Which 'page' of paginated results to return.

Min: 1

Default: 1

Pagination

This method returns paginated results. The response includes a links.pages object with URLs for navigating between pages. To retrieve the next page, parse the next URL and pass the page parameter:

from urllib.parse import urlparse, parse_qs

resp = client.security.list_secrets()
pages = resp.get("links", {}).get("pages", {})

while "next" in pages:
    parsed = urlparse(pages["next"])
    page = int(parse_qs(parsed.query)["page"][0])
    resp = client.security.list_secrets(page=page)
    pages = resp.get("links", {}).get("pages", {})

Response Example

Show Response Example
{
  "secrets": [
    {
      "secret": "my-database-password",
      "region": "nyc3",
      "version": 1,
      "created_at": "2025-12-04T00:00:00Z",
      "updated_at": "2025-12-04T00:00:00Z",
      "delete_requested_at": "2025-12-04T00:00:00Z"
    }
  ],
  "meta": {
    "page": 1,
    "pages": 5,
    "total": 42
  },
  "links": {
    "pages": {
      "first": "https://api.digitalocean.com/v2/security/secrets?page=1&per_page=20",
      "prev": "https://api.digitalocean.com/v2/security/secrets?page=1&per_page=20",
      "next": "https://api.digitalocean.com/v2/security/secrets?page=3&per_page=20",
      "last": "https://api.digitalocean.com/v2/security/secrets?page=5&per_page=20"
    }
  },
  "unavailable_regions": [
    "sfo3"
  ]
}

More Information

See /v2/security/secrets in the API reference for additional detail on responses, headers, parameters, and more.

In this article...


We can't find any results for your search.

Try using different keywords or simplifying your search terms.


Web Proxy Viewer  |  New URL  |  Original Page