Retrieve a Workspace

Get workspace

get
Authorizations
Path parameters
workspaceIdstringRequired
Responses
200

OK

application/json
get
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)
200

OK

{
  "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,
    "input_guardrails": [
      "text"
    ],
    "output_guardrails": [
      "text"
    ],
    "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"
    }
  ]
}

Last updated

Was this helpful?