GET
/
admin
/
workspaces
/
{workspaceId}
/
users
/
{userId}
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": "[email protected]"
  },
  "role": "admin",
  "created_at": "2024-01-25 11:35:07",
  "last_updated_at": "2024-01-25 11:35:07"
}

Authorizations

x-portkey-api-key
string
header
required

Path Parameters

workspaceId
string
required
userId
string
required

Response

200 - application/json
OK
object
enum<string>
Available options:
workspace-user
Example:

"workspace-user"

id
string
Example:

"25afb7bd-f98a-11ee-85fe-0e27d7367987"

first_name
string
Example:

"John"

last_name
string
Example:

"Doe"

org_role
enum<string>
Available options:
admin,
member,
owner
Example:

"member"

role
enum<string>
Available options:
admin,
member,
manager
Example:

"member"

created_at
string
Example:

"2024-01-01T00:00:00.000Z"

last_updated_at
string
Example:

"2024-01-01T00:00:00.000Z"

status
enum<string>
Available options:
active
Example:

"active"