Skip to content

Catalog Attribute Families — Datagrid Listing

Paginated, filterable, and sortable attribute family list that mirrors the Bagisto admin Catalog → Attribute Families datagrid 1:1. This is the authoritative family-management listing for the admin API — same 3 columns and the same sort options used by the datagrid.

How this menu works

For how a family's attribute groups + attributes are structured and the delete guards, see the Attribute Families overview.

Endpoint

EndpointMethodAuthentication
/api/admin/catalog/familiesGETAdmin Bearer token

Authentication

Every request requires:

Authorization: Bearer <token>

Obtain the Bearer token via Authentication.

Query Parameters

ParameterTypeDescriptionExample
pageintegerPage number (1-based, default 1)1
per_pageintegerItems per page (default 10, max 50)10
idstringFilter by family ID — single integer or comma-separated list (e.g. "1" or "1,2")1
codestringPartial family code match (SQL LIKE %value%)default
namestringPartial family name match (SQL LIKE %value%)Default
sortstringColumn to sort by (see Sorting section below)id
orderstringSort direction: asc or desc (default desc)desc

Response Shape

Responses use the standard admin { data, meta } envelope.

meta object

FieldTypeDescription
currentPageintegerCurrent page number (1-based)
perPageintegerNumber of items on this page
lastPageintegerTotal number of pages
totalintegerTotal matching families
frominteger1-based index of the first item on this page
tointeger1-based index of the last item on this page

Row fields (data[])

FieldTypeDescription
idintegerAttribute family ID
codestringFamily code (e.g. default, apparel)
namestringFamily display name (e.g. Default, Apparel)

Slim listing by design

The listing returns only 3 columns. The attribute_families table carries no timestamps ($timestamps = false on the Eloquent model), so createdAt and updatedAt do not exist. Attribute groups and their associated attributes are only available via the detail endpoint GET /api/admin/catalog/families/{id}.

Example Request

bash
curl -X GET "https://your-domain.com/api/admin/catalog/families?per_page=10&page=1&sort=id&order=desc" \
  -H "Authorization: Bearer <token>" \
  -H "Accept: application/json"

Example Response

json
{
  "data": [
    {
      "id": 1,
      "code": "default",
      "name": "Default"
    },
    {
      "id": 3,
      "code": "apparel",
      "name": "Apparel"
    }
  ],
  "meta": {
    "currentPage": 1,
    "perPage": 10,
    "lastPage": 1,
    "total": 2,
    "from": 1,
    "to": 2
  }
}

Sorting

Parameter formExample
Separate sort + order params?sort=id&order=desc

Sortable columns:

sort valueSorts by
idFamily ID (default)
codeFamily code
nameFamily display name

Pagination

  • Default page size: 10 items
  • Maximum page size: 50 items
  • Use ?page=N for page navigation and ?per_page=N to control page size

Errors

HTTP StatusCause
401 UnauthorizedMissing, expired, or revoked admin Bearer token
401 UnauthorizedMissing or invalid admin Bearer token

Unknown filter parameters are silently ignored — no error is returned.

Notes

  • Only 3 columns are returned. The listing mirrors the admin datagrid exactly: id, code, name. No timestamps exist on the attribute_families table. No attribute-group or attribute data is included — use GET /api/admin/catalog/families/{id} for the full nested payload.
  • No automatic filter applied. All families (system and user-defined) are returned by default. There is no is_user_defined filter on families — all families are returned.
  • Envelope-wrapped: { data: [...], meta: { currentPage, perPage, lastPage, total, from, to } }.
  • per_page caps at 50; values ≤ 0 fall back to the default of 10.

Released under the MIT License.