# List metafield definition counts

> Retrieve the number of metafield definitions for each owner type.
{/* generated:versioned-pages - edit _pm-authored, not this file */}

`GET /api/metafield_definitions/counts`

Retrieves the collection of MetafieldDefinitionCount resources.

Returns, for each owner type (such as products or variants), the number of metafield definitions declared for it - a summary in a single call. Requires the `metafields:read` scope.

## Query parameters

| Name           | Type       | Required | Description                                                                                                                                                                                                                                                                          |
| -------------- | ---------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `properties[]` | `string[]` | -        | Allows you to reduce the response to contain only the properties you need. If your desired property is nested, you can address it using nested arrays. Example: properties[]={propertyName}&properties[]={anotherPropertyName}&properties[{nestedPropertyParent}][]={nestedProperty} |

## Response

**200** - MetafieldDefinitionCount collection

| Property     | Type                         | Required | Description |
| ------------ | ---------------------------- | -------- | ----------- |
| `search`     | `object`                     | -        |             |
| `totalItems` | `integer`                    | -        |             |
| `member`     | `MetafieldDefinitionCount[]` | Yes      |             |

## Errors

**403** - Access denied. The caller is missing one or more permissions required for this operation.

| Property             | Type               | Required | Description                                                                                                            |
| -------------------- | ------------------ | -------- | ---------------------------------------------------------------------------------------------------------------------- |
| `@context`           | `string \| object` | -        |                                                                                                                        |
| `@id`                | `string`           | Yes      |                                                                                                                        |
| `@type`              | `string`           | Yes      |                                                                                                                        |
| `detail`             | `string`           | -        |                                                                                                                        |
| `missingPermissions` | `string[]`         | -        | Permissions that the caller is missing for this operation. Present only when the 403 is caused by a denied permission. |
| `status`             | `integer`          | -        |                                                                                                                        |
| `title`              | `string`           | -        |                                                                                                                        |
| `type`               | `string`           | -        |                                                                                                                        |

## Examples

### Example request

```bash
curl -X GET 'https://<tenant>.product-management.flowkiwi.net/api/metafield_definitions/counts' \
  -H 'Authorization: Bearer {access_token}' \
  -H 'Flowkiwi-Api-Version: unstable' \
  -H 'Accept: application/ld+json'
```

### Example response

```json
{
  "search": {
    "@type": "string",
    "mapping": [
      {
        "@type": "string",
        "property": "string",
        "required": true,
        "variable": "string"
      }
    ],
    "template": "string",
    "variableRepresentation": "string"
  },
  "totalItems": 0,
  "member": [
    {
      "@context": "string",
      "@id": "string",
      "@type": "MetafieldDefinitionCount",
      "count": 0,
      "ownerType": "/api/metafield_owner_types/products"
    }
  ]
}
```
