from portkey_ai import Portkey
# Initialize the Portkey client
portkey = Portkey(
api_key="PORTKEY_API_KEY",
)
# Add user to workspace
user = portkey.admin.workspaces.users.create(
workspace_id="WORKSPACE_SLUG",
users=[
{
"id": "USER_ID",
"role": "member"
}
]
)
print(user){}Add a Workspace Member
POST
/
admin
/
workspaces
/
{workspaceId}
/
users
from portkey_ai import Portkey
# Initialize the Portkey client
portkey = Portkey(
api_key="PORTKEY_API_KEY",
)
# Add user to workspace
user = portkey.admin.workspaces.users.create(
workspace_id="WORKSPACE_SLUG",
users=[
{
"id": "USER_ID",
"role": "member"
}
]
)
print(user){}Documentation Index
Fetch the complete documentation index at: https://portkey-docs-fix-cache-hit-elaborate.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Last modified on May 21, 2026
Was this page helpful?
⌘I

