Skip to content
Get started

List API tokens

auth.api_keys.list(APIKeyListParams**kwargs) -> APIKeyListResponse
GET/api/auth/api-keys/

List metadata for API tokens you created (secrets are never returned).

ParametersExpand Collapse
ordering: Optional[str]

Which field to use when ordering the results.

page: Optional[int]

A page number within the paginated result set.

ReturnsExpand Collapse
class APIKeyListResponse:
count: int
results: List[Result]
id: str
formatuuid
created_at: datetime
formatdate-time
prefix: str
maxLength12
project: str
formatuuid
expires_at: Optional[datetime]
formatdate-time
is_active: Optional[bool]
last_used_at: Optional[datetime]
formatdate-time
name: Optional[str]
maxLength255
List API tokens
from overmind_lab import OvermindLab

client = OvermindLab()
api_keys = client.auth.api_keys.list()
print(api_keys.count)
{
  "count": 123,
  "results": [
    {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "created_at": "2019-12-27T18:11:19.117Z",
      "prefix": "prefix",
      "project": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "expires_at": "2019-12-27T18:11:19.117Z",
      "is_active": true,
      "last_used_at": "2019-12-27T18:11:19.117Z",
      "name": "name"
    }
  ],
  "next": "http://api.example.org/accounts/?page=4",
  "previous": "http://api.example.org/accounts/?page=2"
}
Returns Examples
{
  "count": 123,
  "results": [
    {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "created_at": "2019-12-27T18:11:19.117Z",
      "prefix": "prefix",
      "project": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "expires_at": "2019-12-27T18:11:19.117Z",
      "is_active": true,
      "last_used_at": "2019-12-27T18:11:19.117Z",
      "name": "name"
    }
  ],
  "next": "http://api.example.org/accounts/?page=4",
  "previous": "http://api.example.org/accounts/?page=2"
}