Skip to content

feat(admin-controller): add route to fetch all circles#2614

Open
cristianscheid wants to merge 1 commit into
masterfrom
feat/1672/admin-route-circles-all
Open

feat(admin-controller): add route to fetch all circles#2614
cristianscheid wants to merge 1 commit into
masterfrom
feat/1672/admin-route-circles-all

Conversation

@cristianscheid

@cristianscheid cristianscheid commented Jul 8, 2026

Copy link
Copy Markdown
Member
  • Resolves: #

Summary

The existing admin endpoint for fetching circles requires an emulated user:

  • GET ocs/v2.php/apps/circles/admin/{emulated}/circles

Results are scoped to the emulated user, so only circles related to that specific user are returned.

This PR introduces a new admin endpoint that returns all circles from the instance without user scoping:

  • GET ocs/v2.php/apps/circles/admin/circlesall

"/circlesall" was used instead of "/circlesAll" or "/circles-all" to follow the standard from another multiword endpoint already present: "/probecircles"

The authenticated admin user is used for auth only, not to scope results:

// lib/Controller/AdminController::circlesAll()

// no need for emulated user since results are not scoped to any specific user
$this->setLocalFederatedUser($this->userSession->getUser()->getUID());

Params available:

- limit
- offset
- filterPersonal
- filterSingle
- filterSystem
- filterHidden
- filterBackend

The filter params are related to those configs (defined on lib/Model/Circle):

- CFG_PERSONAL - personal circle, only the owner can see it
- CFG_SINGLE - circle with only one single member
- CFG_SYSTEM - system Circle (not managed by the official front-end)
- CFG_HIDDEN - hidden from listing, but available as a share entity
- CFG_BACKEND - fully hidden, only backend Circles

All filter params default to true (1). So to include, for example, personal circles in the results, you must explicitly pass ?filterPersonal=0 to disable the filter.

Below are some request examples:

# get circles using default params
curl -X GET \
  -u "admin:admin" \
  -H "OCS-APIRequest: true" \
  "http://nextcloud.local/ocs/v2.php/apps/circles/admin/circlesall"

# include personal circles
curl -X GET \
  -u "admin:admin" \
  -H "OCS-APIRequest: true" \
  "http://nextcloud.local/ocs/v2.php/apps/circles/admin/circlesall?filterPersonal=0"

# limit results to 50 and set offset of 25
curl -X GET \
  -u "admin:admin" \
  -H "OCS-APIRequest: true" \
  "http://nextcloud.local/ocs/v2.php/apps/circles/admin/circlesall?limit=50&offset=25" 

# include system and hidden circles
curl -X GET \
  -u "admin:admin" \
  -H "OCS-APIRequest: true" \
  "http://nextcloud.local/ocs/v2.php/apps/circles/admin/circlesall?filterSystem=0&filterHidden=0"

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Signed-off-by: Cristian Scheid <cristianscheid@gmail.com>
@cristianscheid cristianscheid force-pushed the feat/1672/admin-route-circles-all branch from 53a5dd6 to 18e4e37 Compare July 8, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant