> ## Documentation Index
> Fetch the complete documentation index at: https://docs.penbox.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Count Requests

> Previous version of Count Forms. Count requests matching filter criteria.

<Warning>
  Previous API version. Use [`GET /forms/count`](/api-reference/requests/count-requests) for new integrations. This route still works but is deprecated.
</Warning>

Get the total count of requests matching your filter criteria, with optional grouping by field values.

```text theme={null}
GET https://connect.penbox.io/v1/requests/count
```

## Query Parameters

| Parameter  | Type   | Description                                                 |
| ---------- | ------ | ----------------------------------------------------------- |
| `filter`   | string | JSON-encoded filter object (same keys as `GET /requests`)   |
| `group-by` | string | Group counts by `status`, `user.{field}`, or `data.{field}` |

## Response

### Without grouping

```json theme={null}
{ "count": 42 }
```

### With grouping

```json theme={null}
{
  "count": 42,
  "by": {
    "status": { "pending": 15, "completed": 20, "draft": 7 }
  }
}
```

## Example

```bash cURL theme={null}
curl 'https://connect.penbox.io/v1/requests/count?group-by=status' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN'
```

## Response Codes

| Code  | Description                              |
| ----- | ---------------------------------------- |
| `200` | Success                                  |
| `400` | Bad Request — invalid filter or group-by |
| `401` | Unauthorized                             |
| `403` | Forbidden                                |
| `429` | Too Many Requests                        |
| `500` | Server Error                             |
