Workspaces
Your AI empire starts here π’
Workspaces are like folders for your AI infrastructure. One workspace for customer support bots, another for analytics, maybe one just for fun? You do you!
Why Workspaces?
- ποΈ Organize - Keep different projects separate
- π₯ Collaborate - Share with team members
- π Isolate - Dev, staging, and prod separated
- π Track - See bot and memory counts at a glance
Quick Operations
List All Workspaces
Show me what you got! π
GET /api/workspaces/workspaces
Example:
curl -H "Authorization: Bearer moa_your_token" \
https://api.memof.ai/api/workspaces/workspaces
Response:
[
{
"id": "ws_123456789",
"name": "Customer Support",
"description": "Support bot workspace",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"members_count": 3,
"bots_count": 5
}
]
Create Workspace
Time to build! ποΈ
POST /api/workspaces/workspace/create
Request Body:
{
"name": "string (required)",
"description": "string (optional)"
}
Example:
curl -X POST https://api.memof.ai/api/workspaces/workspace/create \
-H "Authorization: Bearer moa_your_token" \
-H "Content-Type: application/json" \
-d '{
"name": "Analytics Bots",
"description": "Data analysis and reporting bots"
}'
Response:
{
"id": "ws_123456789",
"name": "Analytics Bots",
"description": "Data analysis and reporting bots",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
Get Workspace Details
The full story π
GET /api/workspaces/workspace/{workspace_id}
Example:
curl -H "Authorization: Bearer moa_your_token" \
https://api.memof.ai/api/workspaces/workspace/ws_123456789
Response:
{
"id": "ws_123456789",
"name": "Customer Support",
"description": "Support bot workspace",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"members": [
{
"id": "member_123",
"user": {
"id": "user_456",
"username": "john_doe",
"email": "john@example.com"
},
"role": "admin",
"joined_at": "2024-01-15T10:30:00Z"
}
],
"bots": [
{
"id": "bot_789",
"name": "Support Bot Alpha",
"description": "First line support"
}
]
}
Update Workspace
Change of plans? βοΈ
PUT /api/workspaces/workspace/{workspace_id}/update
Request Body:
{
"name": "string (optional)",
"description": "string (optional)"
}
Example:
curl -X PUT https://api.memof.ai/api/workspaces/workspace/ws_123456789/update \
-H "Authorization: Bearer moa_your_token" \
-H "Content-Type: application/json" \
-d '{
"name": "Premium Customer Support",
"description": "VIP customer support bots"
}'
Delete Workspace
Goodbye, old friend π
DELETE /api/workspaces/workspace/{workspace_id}/delete
β οΈ Warning: This deletes all bots and memories in the workspace. No undo button!
Example:
curl -X DELETE https://api.memof.ai/api/workspaces/workspace/ws_123456789/delete \
-H "Authorization: Bearer moa_your_token"
Workspace Organization Tips
By Environment
π΅ Dev Workspace β Your playground
π‘ Staging Workspace β Pre-production testing
π’ Production Workspace β The real deal
By Function
π€ Customer Support β Support bots
π Analytics β Data bots
π¬ Chat Bots β Conversational agents
π§ Internal Tools β Employee assistants
By Client
π’ Acme Corp β Client A bots
π Globex Inc β Client B bots
πͺ Initech LLC β Client C bots
Common Patterns
Multi-Tenant Setup
# Create separate workspaces per client
for client in "ClientA" "ClientB" "ClientC"; do
curl -X POST https://api.memof.ai/api/workspaces/workspace/create \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d "{\"name\": \"$client Workspace\"}"
done
Environment Separation
# Create environment-specific workspaces
for env in "Development" "Staging" "Production"; do
curl -X POST https://api.memof.ai/api/workspaces/workspace/create \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d "{\"name\": \"$env Environment\"}"
done
Error Scenarios
Duplicate Name
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Workspace name already exists"
}
}
Tip: Add a date or version number to make it unique.
Workspace Not Found
{
"error": {
"code": "NOT_FOUND",
"message": "Workspace not found"
}
}
Double-check that workspace ID!
Best Practices
β
Do This
- Descriptive names - "Production Support Bots" beats "Workspace 1"
- Add descriptions - Future you will thank present you
- Separate environments - Don't mix dev and prod
- Regular cleanup - Delete unused workspaces
β Avoid This
- Generic names - "Test", "New", "Workspace"
- Everything in one - Organization is your friend
- Forgetting to delete - Unused workspaces pile up
- No descriptions - "What was this for again?"
What's Next?
Workspace created? Awesome! Now:
- Create a Bot - Populate your workspace
- Store Memories - Give your bot a brain
- Check Examples - See it all in action
Happy organizing! π―