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,
"input_guardrails": [
"<string>"
],
"output_guardrails": [
"<string>"
],
"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"
}
]
}
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,
"input_guardrails": [
"<string>"
],
"output_guardrails": [
"<string>"
],
"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"
}
]
}
OK
The response is of type object
.
Was this page helpful?