Retrieve All Workspaces

Get All Workspaces

get
Authorizations
Query parameters
page_sizeintegerOptionalExample: 1
current_pageintegerOptionalExample: 0
Responses
200
OK
application/json
get
from portkey_ai import Portkey

# Initialize the Portkey client
portkey = Portkey(
    api_key="PORTKEY_API_KEY",
)

# List workspaces
workspaces = portkey.admin.workspaces.list()

print(workspaces)
200

OK

{
  "total": 2,
  "object": "list",
  "data": [
    {
      "id": "test-prod-ws-12345",
      "name": "Test prod workspace",
      "description": "This is a production workspace",
      "created_at": "2023-07-13 13:51:27",
      "last_updated_at": "2023-07-13 14:51:27",
      "object": "workspace"
    },
    {
      "id": "test-prod-ws-12345",
      "name": "Test prod workspace",
      "description": "This is a production workspace",
      "created_at": "2023-07-13 13:51:27",
      "last_updated_at": "2023-07-13 14:51:27",
      "object": "workspace"
    }
  ]
}

Last updated

Was this helpful?