Organizations API
Manage organizations, team members, and organization-wide settings.
Multi-tenant
Organize personas and chats within separate organizational boundaries.
Team Management
Invite team members and manage roles (Owner, Admin, Member).
LLM Config
Configure LLM providers and API keys at the organization level.
The Organization Object
An organization represents a workspace containing personas, chat sessions, content, and team members.
Organization Structure
{
"id": "cmdhtumx9000nus412v5qezme",
"name": "Acme Corporation",
"slug": "acme-corporation-1702345678",
"description": "AI-powered customer support organization",
"image": "https://...",
"website": "https://acme.com",
"industry": "Technology",
"size": "50-100",
"location": "San Francisco, CA",
"ownerId": "user_abc123",
"createdAt": "2025-01-01T10:00:00.000Z",
"updatedAt": "2025-01-15T14:30:00.000Z",
"owner": {
"id": "user_abc123",
"name": "John Smith",
"email": "john@acme.com"
},
"members": [
{
"userId": "user_abc123",
"role": "OWNER",
"joinedAt": "2025-01-01T10:00:00.000Z",
"user": {
"id": "user_abc123",
"name": "John Smith",
"email": "john@acme.com",
"image": "https://..."
}
}
],
"_count": {
"members": 5,
"personas": 12,
"chatSessions": 342,
"content": 56,
"apiKeys": 3
}
}Organization Roles
| Role | Description | Permissions |
|---|---|---|
OWNER | Organization owner | Full control, can delete organization |
ADMIN | Administrator | Manage personas, members, settings |
MEMBER | Regular member | Use personas, create chats |
List Organizations
Get all organizations the authenticated user belongs to.
trpc.organization.listList all organizations for the current user.
curl -X GET "https://aipersona.dsethiopia.org/api/trpc/organization.list?input=%7B%7D" \
-H "X-API-Key: your-api-key" \
-H "X-Organization-ID: your-org-id"Response
{
"result": {
"data": [
{
"id": "cmdhtumx9000nus412v5qezme",
"name": "Acme Corporation",
"slug": "acme-corporation-1702345678",
"description": "AI-powered customer support",
"memberRole": "OWNER",
"joinedAt": "2025-01-01T10:00:00.000Z",
"_count": {
"members": 5,
"personas": 12,
"chatSessions": 342,
"content": 56
}
},
{
"id": "cln2xyz789abc123",
"name": "Side Project",
"slug": "side-project-1702456789",
"memberRole": "MEMBER",
"joinedAt": "2025-01-10T15:00:00.000Z",
"_count": {
"members": 2,
"personas": 3,
"chatSessions": 15,
"content": 5
}
}
]
}
}Get Organization
Get detailed information about a specific organization including members.
trpc.organization.getGet full organization details with member list.
curl -X GET "https://aipersona.dsethiopia.org/api/trpc/organization.get?input=%7B%22id%22%3A%22cmdhtumx9000nus412v5qezme%22%7D" \
-H "X-API-Key: your-api-key" \
-H "X-Organization-ID: your-org-id"Current Organization
Get the organization associated with the current API key or session.
trpc.organization.currentReturns the organization from the X-Organization-ID header context.
curl -X GET "https://aipersona.dsethiopia.org/api/trpc/organization.current?input=%7B%7D" \
-H "X-API-Key: your-api-key" \
-H "X-Organization-ID: your-org-id"Create Organization
Create a new organization. The creator becomes the owner.
trpc.organization.createCreate a new organization workspace.
curl -X POST "https://aipersona.dsethiopia.org/api/trpc/organization.create" \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key" \
-H "X-Organization-ID: your-org-id" \
-d '{
"json": {
"name": "New Organization",
"description": "Description of the organization"
}
}'Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Organization name (1-100 characters) |
| description | string | No | Optional description |
Update Organization
Update organization details. Requires Owner or Admin role.
trpc.organization.updateUpdate organization profile and settings.
curl -X POST "https://aipersona.dsethiopia.org/api/trpc/organization.update" \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key" \
-H "X-Organization-ID: your-org-id" \
-d '{
"json": {
"id": "cmdhtumx9000nus412v5qezme",
"name": "Updated Organization Name",
"description": "New description",
"website": "https://example.com",
"industry": "Technology",
"size": "50-100",
"location": "San Francisco, CA"
}
}'Updatable Fields
name - Organization namedescription - Descriptionimage - Logo URLwebsite - Website URLindustry - Industry typesize - Company sizelocation - LocationMember Management
Invite, update, and remove organization members.
trpc.organization.inviteMembercurl -X POST "https://aipersona.dsethiopia.org/api/trpc/organization.inviteMember" \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key" \
-H "X-Organization-ID: your-org-id" \
-d '{
"json": {
"organizationId": "cmdhtumx9000nus412v5qezme",
"email": "newmember@example.com",
"role": "MEMBER"
}
}'LLM Configuration
Manage LLM provider API keys at the organization level.
trpc.llmConfig.listcurl -X GET "https://aipersona.dsethiopia.org/api/trpc/llmConfig.list?input=%7B%7D" \
-H "X-API-Key: your-api-key" \
-H "X-Organization-ID: your-org-id"Response
{
"result": {
"data": [
{
"id": "config_abc123",
"provider": "OPENAI",
"isActive": true,
"isDefault": true,
"createdAt": "2025-01-01T10:00:00.000Z"
},
{
"id": "config_def456",
"provider": "ANTHROPIC",
"isActive": true,
"isDefault": false,
"createdAt": "2025-01-05T14:00:00.000Z"
}
]
}
}