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

pydo.spaces_key.list() | 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.spaces_key.list()

Generated on 3 Aug 2026 from pydo version v0.40.0

Copy page as Markdown View page as Markdown

Usage

client.spaces_key.list(
    per_page=20,
    page=1,
    sort="created_at",
    sort_direction="desc",
    name=None,
    bucket=None,
    permission=None,
)
Returns JSONRaises HttpResponseError

Description

To list Spaces Access Key, send a GET request to /v2/spaces/keys. Sort parameter must be used with Sort Direction.

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

sort string optional

The field to sort by.

Default: created_at

sort_direction string optional

The direction to sort by. Possible values are asc or desc.

Default: desc

name string optional

The access key's name.

bucket string optional

The bucket's name.

permission string optional

The permission of the access key. Possible values are read, readwrite, fullaccess, or an empty string.

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.spaces_key.list()
pages = resp.get("links", {}).get("pages", {})

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

Response Example

Show Response Example
{
  "keys": [
    {
      "name": "my-access-key",
      "access_key": "DOACCESSKEYEXAMPLE",
      "grants": [
        {
          "bucket": "my-bucket",
          "permission": "read"
        }
      ],
      "created_at": "2018-07-19T15:04:16Z"
    }
  ],
  "links": {},
  "meta": {
    "total": 1
  }
}

More Information

See /v2/spaces/keys 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