# Confluence Cloud REST API Get Groups - is totalSize supported?

**URL:** <https://community.developer.atlassian.com/t/confluence-cloud-rest-api-get-groups-is-totalsize-supported/77220>\
**Category:** Confluence Cloud\
**Tags:** pagination, confluence-cloud, rest-api\
**Created:** [February 13, 2024, 5:01am UTC](https://community.developer.atlassian.com/t/confluence-cloud-rest-api-get-groups-is-totalsize-supported/77220 "2024-02-13T05:01:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![BryanGuffey2](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/bryanguffey2/32/50053_2.png) [@BryanGuffey2](https://community.developer.atlassian.com/u/BryanGuffey2)\
**Post date:** [February 13, 2024, 5:01am UTC](https://community.developer.atlassian.com/t/confluence-cloud-rest-api-get-groups-is-totalsize-supported/77220/1 "2024-02-13T05:01:30Z")

</div>

According to the response parameters at [Get Groups API Response- Confluence Cloud](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-group/#api-wiki-rest-api-group-get-response), the `shouldReturnTotalSize` boolean should be supported, and when set to `True`, it should return `totalSize`.

However,

```auto
import requests
from requests.auth import HTTPBasicAuth
import json
import csv
url = "https://xxxx.atlassian.net/wiki/rest/api/group"

auth = HTTPBasicAuth("myname@xxxx.com", "abcdefghijklomnop")
headers = {
    "Accept": "application/json",

}

response = requests.request(
   "GET",
   url,
   headers=headers,
   auth=auth,
   params= {
         'start': 0,
         'limit': 2,
         'shouldReturnTotalSize': True
   }
)

print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": ")))

```

returns the following, missing `totalSize`. Please assist!

```auto
 "_links": {
        "base": "https://xxxx.atlassian.net/wiki",
        "context": "/wiki",
        "next": "/rest/api/group?next=true&limit=2&start=2&shouldReturnTotalSize=True",
        "self": "https://xxxx.atlassian.net/wiki/rest/api/group?shouldReturnTotalSize=True"
    },
    "limit": 2,
    "results": [
        {
            "_links": {
                "self": "https://sonosinc-sandbox-559.atlassian.net/wiki/rest/experimental/group/system-administrators"
            },
            "id": "d58844de-702b-4d51-a640-d34c4e6be24b",
            "name": "system-administrators",
            "type": "group"
        },
        {
            "_links": {
                "self": "https://sonosinc-sandbox-559.atlassian.net/wiki/rest/experimental/group/confluence-users-sonosinc-sandbox-559"
            },
            "id": "ea750de6-8025-4a49-bdda-63df0a3b2dc7",
            "name": "confluence-users-sonosinc-sandbox-559",
            "type": "group"
        }
    ],
    "size": 2,
    "start": 0
}

```

---

<div class="post-metadata">

**Author:** ![anon96974232](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@anon96974232](https://community.developer.atlassian.com/u/anon96974232)\
**Post date:** [February 13, 2024, 5:12am UTC](https://community.developer.atlassian.com/t/confluence-cloud-rest-api-get-groups-is-totalsize-supported/77220/2 "2024-02-13T05:12:28Z")

</div>

Hello @BryanGuffey2

It’s probably just errata in the documentation.

1. The parameter `shouldReturnTotalSize` is _not_ listed as being a supported. Only `start`, `limit` and `accessType` are shown as supported.
2. A `totalSize` object is _not_ included in the sample response.

---

<div class="post-metadata">

**Author:** ![rcsr](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/rcsr/32/50184_2.png) [@rcsr](https://community.developer.atlassian.com/u/rcsr)\
**Post date:** [February 13, 2024, 5:34am UTC](https://community.developer.atlassian.com/t/confluence-cloud-rest-api-get-groups-is-totalsize-supported/77220/3 "2024-02-13T05:34:03Z")

</div>

Might be a typo in the docs as I can see from [this post](https://community.developer.atlassian.com/t/total-size-parameter-for-search-user-groups-and-get-group-members-apis/55075) that only certain endpoints support `totalSize`.

Having said that, you can query the `totalSize` by hitting `https://your-domain.atlassian.net/wiki/rest/api/group/picker?shouldReturnTotalSize=true`

---

<div class="post-metadata">

**Author:** ![BryanGuffey2](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/bryanguffey2/32/50053_2.png) [@BryanGuffey2](https://community.developer.atlassian.com/u/BryanGuffey2)\
**Post date:** [February 13, 2024, 5:36am UTC](https://community.developer.atlassian.com/t/confluence-cloud-rest-api-get-groups-is-totalsize-supported/77220/4 "2024-02-13T05:36:12Z")

</div>

Thanks - so how would I handle pagination if I can’t get `totalSize`?

---

<div class="post-metadata">

**Author:** ![rcsr](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/rcsr/32/50184_2.png) [@rcsr](https://community.developer.atlassian.com/u/rcsr)\
**Post date:** [February 13, 2024, 5:41am UTC](https://community.developer.atlassian.com/t/confluence-cloud-rest-api-get-groups-is-totalsize-supported/77220/5 "2024-02-13T05:41:48Z")

</div>

Does the endpoint I included above not solve your issue?

[https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-group/#api-wiki-rest-api-group-picker-get](https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-group/#api-wiki-rest-api-group-picker-get)

---

<div class="post-metadata">

**Author:** ![BryanGuffey2](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/bryanguffey2/32/50053_2.png) [@BryanGuffey2](https://community.developer.atlassian.com/u/BryanGuffey2)\
**Post date:** [February 13, 2024, 5:43am UTC](https://community.developer.atlassian.com/t/confluence-cloud-rest-api-get-groups-is-totalsize-supported/77220/6 "2024-02-13T05:43:02Z")

</div>

It provides that count, so I guess I could store that and then do a compare against the `limit`.
