---
schema: "agents-md/1.0"
ai_agents_docs_site_root: "https://agents.1health.io/public/demo/api/"
rest_api_root: "/v3/custom-data/definition/{id}/statistics"
path_to_agent_file: "https://agents.1health.io/public/demo/api/v3/custom-data/definition/_id_/statistics/agents.md"
kind: "endpoints"
methods: [GET]
api_version: "v3"
parent: "https://agents.1health.io/public/demo/api/v3/custom-data/definition/_id_/agents.md"
html: "https://agents.1health.io/public/demo/api/v3/custom-data/definition/_id_/statistics/index.html"
how_to: "https://agents.1health.io/public/demo/api/v3/custom-data/definition/_id_/statistics/how-to.md"
example: "https://agents.1health.io/public/demo/api/v3/custom-data/definition/_id_/statistics/example.md"
source_version: "c6d8615bf85dc53cecac8f4d6146c22e6edc1563"
extractor_model: "gpt-4o-2024-08-06"
extractor_prompt_version: "2026-08-13.v1"
reconciler_model: "claude-sonnet-4-6"
reconciler_prompt_version: "2026-08-13.v1"
generated_at: "2026-10-07T03:00:11.782040+00:00"
---

# /v3/custom-data/definition/{id}/statistics

**URL**: https://demo.1health.io/api/v3/custom-data/definition/{id}/statistics

_No description available in the API specification._

## Endpoints

| Endpoint | Method | Description |
| --- | --- | --- |
| /v3/custom-data/definition/{id}/statistics | GET | Get statistics for a custom data definition |

---

## GET /v3/custom-data/definition/{id}/statistics

Get statistics for a custom data definition

### Overview

Returns statistics for a single custom data definition: how many instances hold a value for each of its fields, the definition's row count, and slot usage per field-type family.

### Authorization

Bearer JWT required. See the [authentication guide](https://agents.1health.io/public/demo/api/authentication/agents.md).

### Path Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| id | Long | Yes | The ID of the custom data definition. |

### Query Parameters

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| appId | Long | No |  | External application the custom data belongs to. Optional; when omitted, the application is resolved from the authenticated context. Reading is allowed for the owner and any tenant the application is visible to (public, or explicitly allowed for a private application). A request with neither an application context nor an explicit appId is rejected. |

### Responses

#### 200 OK

Definition statistics retrieved successfully.

**DTO**: `CustomDataDefinitionStatsDTO`

```json
{
  "definitionId": 1001,
  "boClassId": 1001,
  "rowCount": 1001,
  "fields": [
    {}
  ],
  "slots": [
    {}
  ]
}
```

| Field | Type | Nullable | Description |
| --- | --- | --- | --- |
| definitionId | Long | Yes | Custom data definition instance ID. |
| boClassId | Long | Yes | ID of the business object class the definition is attached to. |
| rowCount | long | No | Number of custom_data rows for this definition across all tenants of the application. |
| fields | List<CustomDataFieldStatDTO> | Yes | Per-field value counts for the definition's fields. |
| slots | List<SlotUsageDTO> | Yes | Used and remaining slots per field-type family. |

#### 400 Bad Request

Invalid request. Missing external application context.

#### 401 Unauthorized

Not authenticated — valid session required.

#### 404 Not Found

Custom data definition not found.

### Example

```bash
curl -X GET "https://demo.1health.io/api/v3/custom-data/definition/1001/statistics" \
  -H "Authorization: Bearer $TOKEN"
```

---

## Navigation
Parent: https://agents.1health.io/public/demo/api/v3/custom-data/definition/_id_/agents.md · Site guide: https://agents.1health.io/public/demo/api/agents.md
