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

MethodEndpointPermissionDescription
GET/usersuser:readList all users in tenant
GET/users/:iduser:readGet user details
POST/usersuser:createCreate a new user
PUT/users/:iduser:updateUpdate user details or role
DELETE/users/:iduser:deleteDelete user account
POST/users/:id/change-passwordAny (self)Change user password

Tenant Endpoints

MethodEndpointPermissionDescription
GET/tenantstenant:readList all tenants (super-admin)
GET/tenants/:idtenant:readGet tenant by ID
POST/tenantstenant:createCreate new tenant
PUT/tenants/:idtenant:updateUpdate tenant configuration
DELETE/tenants/:idtenant:deleteDelete 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"
}
RolePermissions
ADMINFull access — users, tenants, all interviews, all approvals
RECRUITERCreate/read/update/approve interviews within tenant
VIEWERRead-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?