KasarKasar Docs
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/me

Returns 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/..."
  }
}
FieldTypeDescription
userIdstringThe NextAuth user ID
organizationIdstringThe organization UUID
workspaceUserIdstringThe user's ID within the workspace
isAdminbooleanWhether the user has admin privileges
scopesstring[]Array of scopes granted to the token
profileobjectUser profile information

List Workspace Users

GET /api/v1/users

Returns a paginated list of users in the current workspace.

Query Parameters

ParameterTypeDefaultDescription
cursorstringPagination cursor from a previous response
limitinteger50Number of users per page (max 500)
is_activebooleanFilter by active status
searchstringSearch 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/status

Returns 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"
    }
  ]
}
FieldTypeDescription
idstringThe integration credential ID
providerstringThe integration provider (e.g. gmail, outlook, linkedin)
account_emailstringThe email address associated with this integration
statusstringCurrent status: active, expired, or error
last_sync_atstringISO 8601 timestamp of the last successful sync

Error Responses

StatusCodeDescription
401UNAUTHORIZEDMissing or invalid token
403PERMISSION_DENIEDToken lacks required scope

On this page