Skip to main content
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-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
}

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<uuid>
Example:

"66dc015d-0270-11f1-8eec-0e27d7367989"

first_name
string
Example:

"John"

last_name
string
Example:

"Doe"

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

"admin"

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

"admin"

created_at
string<date-time>
Example:

"2026-03-09T07:55:25.000Z"

last_updated_at
string<date-time>
Example:

"2026-03-09T07:55:25.000Z"

status
enum<string>
Available options:
active
Example:

"active"

workspace_id
string<uuid>
Example:

"bf276bb9-4cef-4d87-b69b-b23a6ed6b1dd"

email
string<email>
Example:

"john.doe@example.com"

scopes
string[]
Example:
[
  "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
object
Example:

null

Last modified on April 2, 2026