🎉 Portkey raises Series A - $15M to build AI that never breaks  Read announcement →
from portkey_ai import Portkey
# Initialize the Portkey client
portkey = Portkey(
api_key="PORTKEY_API_KEY",
)
# Get user from workspace
user = portkey.admin.workspaces.users.retrieve(
workspace_id="WORKSPACE_SLUG",
user_id="USER_ID"
)
print(user){
"object": "workspace_member",
"user_id": "61e08f60-4822-465e-ba23-39f85cd741cb",
"user": {
"object": "user",
"id": "61e08f60-4822-465e-ba23-39f85cd741cb",
"first_name": "horace",
"last_name": "slughorn",
"email": "horace.slughorn@example.com"
},
"role": "admin",
"created_at": "2024-01-25 11:35:07",
"last_updated_at": "2024-01-25 11:35:07"
}from portkey_ai import Portkey
# Initialize the Portkey client
portkey = Portkey(
api_key="PORTKEY_API_KEY",
)
# Get user from workspace
user = portkey.admin.workspaces.users.retrieve(
workspace_id="WORKSPACE_SLUG",
user_id="USER_ID"
)
print(user){
"object": "workspace_member",
"user_id": "61e08f60-4822-465e-ba23-39f85cd741cb",
"user": {
"object": "user",
"id": "61e08f60-4822-465e-ba23-39f85cd741cb",
"first_name": "horace",
"last_name": "slughorn",
"email": "horace.slughorn@example.com"
},
"role": "admin",
"created_at": "2024-01-25 11:35:07",
"last_updated_at": "2024-01-25 11:35:07"
}Documentation Index
Fetch the complete documentation index at: https://portkey-docs-log-export-guide-1773064217.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
OK
workspace-user "workspace-user"
"25afb7bd-f98a-11ee-85fe-0e27d7367987"
"John"
"Doe"
admin, member, owner "member"
admin, member, manager "member"
"2024-01-01T00:00:00.000Z"
"2024-01-01T00:00:00.000Z"
active "active"
Was this page helpful?