Create Workspace
Authorizations
Body
namestringOptional
descriptionstringOptional
usersstring[]Optional
Responses
200
OK
application/json
post
from portkey_ai import Portkey
# Initialize the Portkey client
portkey = Portkey(
api_key="PORTKEY_API_KEY",
)
# Add a workspace
workspace = portkey.admin.workspaces.create(
name='WORKSPACE_NAME_0909',
description="WORKSPACE_DESCRIPTION",
defaults={
"metadata": {
"environment": "production",
"foo": "bar"
}
}
)
print(workspace)
200
OK
{
"id": "ws-test-a-174eb1",
"slug": "ws-test-a-174eb1",
"name": "New Workspace",
"description": null,
"created_at": "2024-07-30T13:27:29.000Z",
"last_updated_at": "2024-07-30T13:27:29.000Z",
"defaults": {
"metadata": {
"foo": "bar"
},
"is_default": 0,
"object": "workspace"
}
}
Last updated
Was this helpful?