API Reference
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-...",
"isAdmin": true,
"scopes": ["mcp"],
"profile": {
"full_name": "Alice Martin",
"email": "alice@example.com",
"avatar_url": "https://lh3.googleusercontent.com/..."
}
}| Field | Type | Description |
|---|---|---|
userId | string | The NextAuth user ID |
organizationId | string | The organization UUID |
workspaceUserId | string | The user's ID within the workspace |
isAdmin | boolean | Whether the user has admin privileges |
scopes | string[] | Array of scopes granted to the token |
profile | object | User profile information |
List Workspace Users
GET /api/v1/usersReturns a paginated list of users in the current workspace.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
cursor | string | Pagination cursor from a previous response | |
limit | integer | 50 | Number of users per page (max 500) |
is_active | boolean | Filter by active status | |
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-...",
"full_name": "Alice Martin",
"user_email": "alice@example.com",
"role": "admin",
"is_active": true,
"avatar_url": "https://lh3.googleusercontent.com/...",
"created_at": "2025-01-05T08:00:00Z"
}
],
"total": 1,
"nextCursor": null
}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"
},
{
"id": "int_e5f6a7b8-...",
"provider": "linkedin",
"account_email": "alice@example.com",
"status": "expired",
"last_sync_at": "2025-03-01T10:00:00Z"
}
]
}| 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 |
Error Responses
| Status | Code | Description |
|---|---|---|
| 401 | UNAUTHORIZED | Missing or invalid token |
| 403 | PERMISSION_DENIED | Token lacks required scope |