GET
/
admin
/
workspaces
/
{workspaceId}
from portkey_ai import Portkey

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

# Get workspace details
workspace = portkey.admin.workspaces.retrieve(
    workspace_id='WORKSPACE_SLUG'
)

print(workspace)
{
  "id": "ws-test-a-174eb1",
  "slug": "ws-test-a-174eb1",
  "name": "New Workspace",
  "description": null,
  "created_at": "2024-07-30T13:27:29.000Z",
  "last_updated_at": "2024-07-30T13:27:29.000Z",
  "defaults": {
    "metadata": {
      "foo": "bar"
    },
    "is_default": 0,
    "object": "workspace"
  },
  "users": [
    {
      "object": "workspace-user",
      "id": "25afb7bd-f98a-11ee-85fe-0e27d7367987",
      "first_name": "John",
      "last_name": "Doe",
      "org_role": "member",
      "role": "member",
      "created_at": "2024-01-01T00:00:00.000Z",
      "last_updated_at": "2024-01-01T00:00:00.000Z",
      "status": "active"
    }
  ]
}

Authorizations

x-portkey-api-key
string
header
required

Path Parameters

workspaceId
string
required

Response

200 - application/json
OK
id
string
Example:

"ws-test-a-174eb1"

slug
string
Example:

"ws-test-a-174eb1"

name
string
Example:

"New Workspace"

description
string | null
Example:

null

created_at
string
Example:

"2024-07-30T13:27:29.000Z"

last_updated_at
string
Example:

"2024-07-30T13:27:29.000Z"

defaults
object | null
users
object[]