List organizations with their members (internal)

Add MCP server to your AI tool

Allow AI tools and LLMs to interact with the API documentation portal through MCP.

MCP server URL

https://docs.usehearsay.com/mcp

Standard setup for AI tools providing an mcp.json file

mcp.json
{
  "integrations MCP server": {
    "url": "https://docs.usehearsay.com/mcp"
  }
}

Close
GET /admin/organization/directory

Lists organizations one page at a time (newest first by default), each with a capped list of its members (id, name, email, role in that organization, active state) that leaves out claimable placeholder accounts and deleted users; membershipCount counts every membership and hasMoreUsers means the list was cut, so page the rest with GET /admin/user?organizationId=<id> using skip/limit. searchText matches the organization name, slug or email, not users, and total counts organizations. Super admin only.

Query parameters

  • page number

    Maximum value is 1000. Default value is 1.

  • perPage number

    Maximum value is 100. Default value is 10.

  • skip number

    Takes precedence over page/perPage when provided. Mutually exclusive with page in practice: nextPage/previousPage track page, so they are meaningless when paging by skip.

    Maximum value is 100000.

  • limit number

    Takes precedence over perPage when provided.

    Maximum value is 100.

  • sortOrder string

    Values are asc or desc. Default value is desc.

  • searchText string

    Case-insensitive partial match on organization name, slug, or email. Does not match users.

    Minimum length is 1, maximum length is 100.

  • sortBy string

    Values are createdAt, updatedAt, or name. Default value is createdAt.

  • isActive boolean

    Filter by the ORGANIZATION's active state. Does not filter the nested users.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • data object Required
      Hide data attributes Show data attributes object
      • total number Required
      • page number
      • perPage number
      • skip number
      • limit number
      • totalPages number Required
      • nextPage number | null Required
      • previousPage number | null Required
      • data array[object]
        Hide data attributes Show data attributes object
        • createdAt string(date-time) Required
        • updatedAt string(date-time) Required
        • id string Required
        • name string Required
        • slug string Required
        • isActive boolean Required
        • users array[object] Required

          Members of this organization, excluding claimable placeholder accounts and memberships whose user no longer exists. An empty array therefore means "no listable members", not necessarily "no memberships".

          Hide users attributes Show users attributes object
          • id string Required
          • name string Required
          • email string Required
          • role string Required

            Values are user, client, employee, billing, full_access, admin, owner, or member.

          • isActive boolean Required
        • membershipCount number Required

          Total memberships for this organization, counted before truncation and before claimable/deleted users are filtered out. Always >= users.length.

        • hasMoreUsers boolean Required

          True when this organization has more memberships than the response cap and users was truncated. For the full member list use GET /admin/user?organizationId=&skip=0&limit=100 — page it with skip/limit rather than page/perPage, and note that endpoint does not exclude claimable accounts.

    • statusCode number Required
    • timestamp string(date-time) Required
GET /admin/organization/directory
curl \
 --request GET 'http://api.example.com/admin/organization/directory' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "data": {
    "total": 42,
    "page": 1,
    "perPage": 20,
    "skip": 0,
    "limit": 20,
    "totalPages": 3,
    "nextPage": 2,
    "previousPage": 42.0,
    "data": [
      {
        "createdAt": "2026-01-15T14:30:00.000Z",
        "updatedAt": "2026-01-15T14:30:00.000Z",
        "id": "507f1f77bcf86cd799439011",
        "name": "Example Firm",
        "slug": "example-firm",
        "isActive": true,
        "users": [
          {
            "id": "65a1b2c3d4e5f6a7b8c9d0e4",
            "name": "Jane Doe",
            "email": "jane.doe@example.com",
            "role": "admin",
            "isActive": true
          }
        ],
        "membershipCount": 12,
        "hasMoreUsers": false
      }
    ]
  },
  "statusCode": 200,
  "timestamp": "2026-01-15T10:15:00.000Z"
}