> For the complete documentation index, see [llms.txt](https://spaceone-dev.gitbook.io/api-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://spaceone-dev.gitbook.io/api-reference/common-v1/statistics-query/ex.1-case-project.md).

# Ex.1 case: Project

```javascript
{
    "query": {
        "aggregate": {
            "group": {
                "keys": [
                    {
                        "key": "project_id",
                        "name": "project_id"
                    },
                    {
                        "key": "name",
                        "name": "project_name"
                    },
                    {
                        "key": "project_group.name",
                        "name": "project_group_name"
                    }
                ],
                "fields": [
                    {
                        "operator": "count",
                        "name": "project_count"
                    },
                    {
                        "key": "project_id",
                        "name": "selected_id",
                        "operator": "add_to_set"
                    }
                ]
            }
        },
        "filter": [
            {
                "key": "name",
                "value": [
                    "project",
                    "alters"
                ],
                "operator": "not_in"
            }
        ],
        "filter_or": [
            {
                "key": "name",
                "value": [
                    "stark",
                    "admin"
                ],
                "operator": "in"
            },
            {
                "key": "project_id",
                "value": [
                    "ua-abcdefg"
                ],
                "operator": "not_in"
            }
        ],
        "sort": {
            "name": "resource_count",
            "desc": true
        },
       "page": {
            "start": 1,
            "limit": 3
        }
    }
}
```

<mark style="color:green;">`POST`</mark> `https://{host/identity/project/stat`

This endpoint allows you to get free cakes.

#### Query Parameters

| Name       | Type   | Description                                                               |
| ---------- | ------ | ------------------------------------------------------------------------- |
| aggregate  | object | set grouping keys and fields                                              |
| filter     | array  | filter results out by given operators within conditions                   |
| filter\_or | array  | filter results out by given operators within conditions with OR condition |
| sort       | object | sorting a list with given keys                                            |
| page       | object | set limit and its start page                                              |

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}

```javascript
{
    "results": [
        {
            "selected_id": [
                "project-87925ea3ce65"
            ],
            "project_count": 14,
            "project_name": "[TEST] Lions",
            "project_group_name": "SpaceOne",
            "project_id": "project-87925ea3ce65"
        },
        {
            "project_count": 1,
            "project_name": "K8S_TF",
            "project_group_name": "Customer Co-work",
            "project_id": "project-e03c4399430e",
            "selected_id": [
                "project-e03c4399430e"
            ]
        },
        {
            "project_count": 1,
            "project_name": "CMP",
            "project_group_name": "SpaceOne",
            "project_id": "project-d452c2cce950",
            "selected_id": [
                "project-d452c2cce950"
            ]
        }
    ]
}
```

{% endtab %}
{% endtabs %}
