User Management
Manage users, API keys, and access in ZIRI.
Creating Users
Via UI
- Go to Users page
- Click Create User
- Fill in:
- Email: User’s email address
- Name: User’s full name
- Tenant: Tenant identifier (optional)
- Role: Role ID (optional)
- Is Agent: Check for service accounts
- Rate Limit: Requests per minute (default: 100)
- Create API Key: Enable if the user should receive a key now
- Click Create User
API key creation is optional. If email delivery is disabled, the create response includes a generated password.
Via API
curl -X POST http://localhost:3100/api/users \
-H "Authorization: Bearer your-token" \
-H "Content-Type: application/json" \
-d '{
"email": "alice@example.com",
"name": "Alice",
"tenant": "engineering",
"roleId": "analyst",
"isAgent": false,
"limitRequestsPerMinute": 100,
"createApiKey": true
}'API Keys
Automatic Creation
API keys can be created during user creation (createApiKey: true) or later from the Keys page/API. The key format is:
ziri-{userId}-{hash}Viewing Keys
- Go to Keys page
- Find the key for your user
- Click on it to view details
The full key is only shown once when created. After that, only the hash is shown.
Creating Additional Keys
curl -X POST http://localhost:3100/api/keys \
-H "Authorization: Bearer your-token" \
-H "Content-Type: application/json" \
-d '{
"userId": "user-123"
}'Rotating Keys
Rotate (replace) a user’s API key:
curl -X POST http://localhost:3100/api/keys/user-123/rotate \
-H "Authorization: Bearer your-token"The old key is deleted immediately. Make sure users update their applications.
Managing Users
Update User
- Go to Users page
- Click on a user
- Click Edit
- Update fields
- Click Save
Delete User
- Go to Users page
- Click on a user
- Click Delete
- Confirm deletion
This deletes the user and all their keys. This cannot be undone.
Reset Password
- Go to Users page
- Click on a user
- Click Reset Password
The new password is shown (or emailed if email is configured).
Rate Limits
Set rate limits per user:
- Default: 100 requests per minute
- Unlimited: Set to 0 or null
- Custom: Set any number
Rate limits apply to all keys for that user.
Tenants
Use tenants to organize users:
engineeringresearchsalesexecutiveml_engineering
Use tenant values in policies for tenant-scoped access control.
Roles
Roles are modeled as Cedar Role entities and attached as parent relationships on User entities.
- Assign one role per user with
roleIdduring create or update. - Remove a role by sending
roleId: nullin user updates. - Manage role entities from Settings → Roles or
/api/roles.
Service Accounts
Mark users as agents (service accounts):
isAgent: true- Service accountisAgent: false- Regular user
Service accounts typically have higher rate limits and may have different policies.
Best Practices
- Organize by department.
- Set appropriate limits per user.
- Rotate API keys regularly.
- Monitor usage via audit logs.
- Delete users who no longer need access.
Common Tasks
Onboard New User
- Create user with email, name, and optional tenant.
- Get API key from Keys page.
- Share API key securely.
- Create policies allowing their access.
- Test with a sample request.
Offboard User
- Revoke their API keys (delete keys) or delete the user.
- Update policies if needed.
- Archive audit logs if required.
Change Tenant
- Update the user’s tenant.
- Update policies if tenant-based.
- Verify access still works.