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-...",
  "schemaName": "acme_e5f6a7b8",
  "isAdmin": true,
  "scopes": ["mcp"],
  "profile": {
    "name": "Alice Martin",
    "email": "alice@example.com",
    "role_id": "role_a1b2c3d4-..."
  }
}
FieldTypeDescription
userIdstringThe NextAuth user ID
organizationIdstringThe organization UUID
workspaceUserIdstringThe user's ID within the workspace
schemaNamestringThe organization's PostgreSQL schema name
isAdminbooleanWhether the user has admin privileges
scopesstring[]Array of scopes granted to the token
profileobject | nullUser profile (name, email, role_id), or null if the workspace user record is not found

List Workspace Users

GET /api/v1/users

Returns 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

ParameterTypeDefaultDescription
cursorstringPagination cursor from a previous response
limitinteger100Number of users per page (max 500)
is_activebooleanFilter by active status. Omit to include all users
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-...",
      "name": "Alice Martin",
      "email": "alice@example.com",
      "role_id": "role_a1b2c3d4-...",
      "is_active": true
    }
  ],
  "total": 1
}
FieldTypeDescription
idstringThe workspace user ID
namestringThe user's display name
emailstringThe user's email address
role_idstringThe ID of the user's role
is_activebooleanWhether 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/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",
      "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
}
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
created_atstringISO 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

StatusCodeDescription
401UNAUTHORIZEDMissing or invalid token
403PERMISSION_DENIEDToken lacks required scope

On this page