Users
Get the current user context, list workspace members, and check integration status.
The user endpoints provide information about the authenticated user, workspace members, and connected integrations.
Current User
GET /api/v1/meReturns the full context of the authenticated user, including organization, admin status, and granted scopes.
Example Request
curl -X GET "https://kasar.app/api/v1/me" \
-H "Authorization: Bearer ksr_a1b2c3d4e5f6..."Response
{
"userId": "usr_a1b2c3d4-...",
"organizationId": "org_e5f6a7b8-...",
"workspaceUserId": "wu_c9d0e1f2-...",
"schemaName": "acme_e5f6a7b8",
"isAdmin": true,
"scopes": ["mcp"],
"profile": {
"name": "Alice Martin",
"email": "alice@example.com",
"role_id": "role_a1b2c3d4-..."
}
}| Field | Type | Description |
|---|---|---|
userId | string | The NextAuth user ID |
organizationId | string | The organization UUID |
workspaceUserId | string | The user's ID within the workspace |
schemaName | string | The organization's PostgreSQL schema name |
isAdmin | boolean | Whether the user has admin privileges |
scopes | string[] | Array of scopes granted to the token |
profile | object | null | User profile (name, email, role_id), or null if the workspace user record is not found |
List Workspace Users
GET /api/v1/usersReturns a paginated list of users in the current workspace.
By default this returns all workspace users (both active and inactive). Pass is_active=true to restrict the result to active members only.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
cursor | string | Pagination cursor from a previous response | |
limit | integer | 100 | Number of users per page (max 500) |
is_active | boolean | Filter by active status. Omit to include all users | |
search | string | Search by name or email (case-insensitive partial match) |
Example Request
curl -X GET "https://kasar.app/api/v1/users?is_active=true&search=alice&limit=20" \
-H "Authorization: Bearer ksr_a1b2c3d4e5f6..."Response
{
"data": [
{
"id": "wu_c9d0e1f2-...",
"name": "Alice Martin",
"email": "alice@example.com",
"role_id": "role_a1b2c3d4-...",
"is_active": true
}
],
"total": 1
}| Field | Type | Description |
|---|---|---|
id | string | The workspace user ID |
name | string | The user's display name |
email | string | The user's email address |
role_id | string | The ID of the user's role |
is_active | boolean | Whether the user is an active member of the workspace |
Results are ordered by created_at ascending. nextCursor is included only when more results are available; pass it back as the cursor query parameter to fetch the next page.
The search parameter performs a case-insensitive partial match (ILIKE) on both the full_name and user_email columns.
Integration Status
GET /api/v1/integrations/statusReturns the status of the authenticated user's connected integrations. This is scoped to the user's own credentials only.
Example Request
curl -X GET "https://kasar.app/api/v1/integrations/status" \
-H "Authorization: Bearer ksr_a1b2c3d4e5f6..."Response
{
"integrations": [
{
"id": "int_a1b2c3d4-...",
"provider": "gmail",
"account_email": "alice@example.com",
"status": "active",
"last_sync_at": "2025-03-12T17:30:00Z",
"created_at": "2025-01-10T09:00:00Z"
},
{
"id": "int_e5f6a7b8-...",
"provider": "linkedin",
"account_email": "alice@example.com",
"status": "expired",
"last_sync_at": "2025-03-01T10:00:00Z",
"created_at": "2025-02-02T14:00:00Z"
}
],
"total": 2
}| Field | Type | Description |
|---|---|---|
id | string | The integration credential ID |
provider | string | The integration provider (e.g. gmail, outlook, linkedin) |
account_email | string | The email address associated with this integration |
status | string | Current status: active, expired, or error |
last_sync_at | string | ISO 8601 timestamp of the last successful sync |
created_at | string | ISO 8601 timestamp of when the integration was connected |
When the workspace has no integration credentials object, or none are connected, the response is { "integrations": [] } (with no total field).
Error Responses
| Status | Code | Description |
|---|---|---|
| 401 | UNAUTHORIZED | Missing or invalid token |
| 403 | PERMISSION_DENIED | Token lacks required scope |