from portkey_ai import Portkey
# Initialize the Portkey client
portkey = Portkey(
api_key="PORTKEY_API_KEY",
)
# Add a user invite
user = portkey.admin.users.invites.create(
email="user@example.com",
role="member",
workspaces=[
{
"id": "WORKSPACE_SLUG",
"role": "admin"
}
],
workspace_api_key_details={
"scopes": [
"workspaces.list",
"logs.export",
"logs.list",
"logs.view",
]
}
)
print(user)
{
"id": "a286286b-633d-4c4f-bddb-86b84a50a25c",
"invite_link": "https://app.portkey.ai/invite_id"
}
Send an invite to user for your organization
from portkey_ai import Portkey
# Initialize the Portkey client
portkey = Portkey(
api_key="PORTKEY_API_KEY",
)
# Add a user invite
user = portkey.admin.users.invites.create(
email="user@example.com",
role="member",
workspaces=[
{
"id": "WORKSPACE_SLUG",
"role": "admin"
}
],
workspace_api_key_details={
"scopes": [
"workspaces.list",
"logs.export",
"logs.list",
"logs.view",
]
}
)
print(user)
{
"id": "a286286b-633d-4c4f-bddb-86b84a50a25c",
"invite_link": "https://app.portkey.ai/invite_id"
}
OK
The response is of type object
.
Was this page helpful?