API Reference
Users & Tenants
Manage users, roles, and tenant configuration for your organization.
User and tenant endpoints cover account management, role assignment, and multi-tenant configuration. Only ADMIN-role users can manage other users and tenant settings.
Users Endpoints
| Method | Endpoint | Permission | Description |
|---|---|---|---|
| GET | /users | user:read | List all users in tenant |
| GET | /users/:id | user:read | Get user details |
| POST | /users | user:create | Create a new user |
| PUT | /users/:id | user:update | Update user details or role |
| DELETE | /users/:id | user:delete | Delete user account |
| POST | /users/:id/change-password | Any (self) | Change user password |
Tenant Endpoints
| Method | Endpoint | Permission | Description |
|---|---|---|---|
| GET | /tenants | tenant:read | List all tenants (super-admin) |
| GET | /tenants/:id | tenant:read | Get tenant by ID |
| POST | /tenants | tenant:create | Create new tenant |
| PUT | /tenants/:id | tenant:update | Update tenant configuration |
| DELETE | /tenants/:id | tenant:delete | Delete tenant |
POST /users — Create User
bash
curl -X POST https://mayaapi.teamcast.ai/api/v1/users \
-H "Authorization: Bearer <admin-jwt>" \
-H "Content-Type: application/json" \
-d '{
"email": "recruiter@example.com",
"name": "Alex Johnson",
"role": "RECRUITER",
"password": "TempPass123!"
}'Response 201
{
"id": "user-uuid",
"email": "recruiter@example.com",
"name": "Alex Johnson",
"role": "RECRUITER",
"tenantId": "tenant-uuid",
"createdAt": "2024-01-15T10:00:00.000Z"
}| Role | Permissions |
|---|---|
| ADMIN | Full access — users, tenants, all interviews, all approvals |
| RECRUITER | Create/read/update/approve interviews within tenant |
| VIEWER | Read-only access to interviews and assessments |
GET /users/:id — Get User
bash
curl https://mayaapi.teamcast.ai/api/v1/users/user-uuid \
-H "Authorization: Bearer <jwt>"Response 200
{
"id": "user-uuid",
"email": "admin@demo.ai-interview.com",
"name": "Platform Admin",
"role": "ADMIN",
"tenantId": "tenant-uuid",
"createdAt": "2024-01-01T00:00:00.000Z"
}GET /tenants/:id — Get Tenant
bash
curl https://mayaapi.teamcast.ai/api/v1/tenants/tenant-uuid \
-H "Authorization: Bearer <admin-jwt>"Response 200
{
"id": "tenant-uuid",
"name": "Acme Corp",
"slug": "acme",
"createdAt": "2024-01-01T00:00:00.000Z"
}Users are strictly isolated by
tenantId. An ADMIN can only manage users within their own tenant — cross-tenant access is blocked at the RLS level.Was this page helpful?