GET
/
admin
/
workspaces
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)
{
  "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",
      "defaults": {
        "metadata": {
          "foo": "bar"
        }
      },
      "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",
      "defaults": {
        "metadata": {
          "foo": "bar"
        }
      },
      "object": "workspace"
    }
  ]
}

Authorizations

x-portkey-api-key
string
header
required

Query Parameters

page_size
integer
current_page
integer

Response

200 - application/json
OK
total
integer
Example:

2

object
enum<string>
Available options:
list
data
object[]