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>"
]
},
"users": [
{
"object": "workspace-user",
"id": "66dc015d-0270-11f1-8eec-0e27d7367989",
"first_name": "John",
"last_name": "Doe",
"org_role": "admin",
"role": "admin",
"created_at": "2026-03-09T07:55:25.000Z",
"last_updated_at": "2026-03-09T07:55:25.000Z",
"status": "active",
"workspace_id": "bf276bb9-4cef-4d87-b69b-b23a6ed6b1dd",
"email": "john.doe@example.com",
"scopes": [
"organisations.read",
"organisation_users.read",
"workspaces.read",
"logs.list",
"logs.view",
"prompts.create",
"prompts.read",
"prompts.list",
"configs.create",
"configs.read",
"configs.list",
"virtual_keys.create",
"virtual_keys.read",
"virtual_keys.list",
"workspace_users.create",
"workspace_users.read",
"workspace_users.list",
"generations.create"
],
"settings": null
}
],
"usage_limits": [
{
"credit_limit": 10,
"periodic_reset": "monthly",
"alert_threshold": 8
}
],
"rate_limits": [
{
"value": 123
}
]
}Retrieve a Workspace
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,
"input_guardrails": [
"<string>"
],
"output_guardrails": [
"<string>"
]
},
"users": [
{
"object": "workspace-user",
"id": "66dc015d-0270-11f1-8eec-0e27d7367989",
"first_name": "John",
"last_name": "Doe",
"org_role": "admin",
"role": "admin",
"created_at": "2026-03-09T07:55:25.000Z",
"last_updated_at": "2026-03-09T07:55:25.000Z",
"status": "active",
"workspace_id": "bf276bb9-4cef-4d87-b69b-b23a6ed6b1dd",
"email": "john.doe@example.com",
"scopes": [
"organisations.read",
"organisation_users.read",
"workspaces.read",
"logs.list",
"logs.view",
"prompts.create",
"prompts.read",
"prompts.list",
"configs.create",
"configs.read",
"configs.list",
"virtual_keys.create",
"virtual_keys.read",
"virtual_keys.list",
"workspace_users.create",
"workspace_users.read",
"workspace_users.list",
"generations.create"
],
"settings": null
}
],
"usage_limits": [
{
"credit_limit": 10,
"periodic_reset": "monthly",
"alert_threshold": 8
}
],
"rate_limits": [
{
"value": 123
}
]
}Authorizations
Path Parameters
Response
200 - application/json
OK
Example:
"ws-test-a-174eb1"
Example:
"ws-test-a-174eb1"
Example:
"New Workspace"
Example:
null
Example:
"2024-07-30T13:27:29.000Z"
Example:
"2024-07-30T13:27:29.000Z"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Last modified on June 3, 2026
Was this page helpful?
⌘I

