Skip to content

Catalog Attributes — Datagrid Listing

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

How this menu works

For attribute types, options, and the configurable/filterable flags, see the Attributes overview.

Endpoint

EndpointMethodAuthentication
/api/admin/catalog/attributesGETAdmin 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 attribute ID — single integer or comma-separated list (e.g. "1" or "1,2")1
codestringPartial attribute code match (SQL LIKE %value%)color
typestringExact attribute type filterselect
admin_namestringPartial admin name match (SQL LIKE %value%)Color
is_requiredintegerFilter by is_required: 0 = no, 1 = yes1
is_uniqueintegerFilter by is_unique: 0 = no, 1 = yes0
is_filterableintegerFilter by is_filterable: 0 = no, 1 = yes1
is_configurableintegerFilter by is_configurable: 0 = no, 1 = yes0
is_visible_on_frontintegerFilter by is_visible_on_front: 0 = no, 1 = yes1
is_user_definedintegerFilter by is_user_defined: 0 = no, 1 = yes1
value_per_localeintegerFilter by value_per_locale: 0 = no, 1 = yes0
value_per_channelintegerFilter by value_per_channel: 0 = no, 1 = yes0
localestringLocale code for translation resolution (default: app locale)en
sortstringColumn to sort by (see Sorting section below)id
orderstringSort direction: asc or desc (default desc)desc

Valid type values: text, textarea, price, boolean, select, multiselect, datetime, date, image, file, checkbox

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 attributes
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 ID
codestringAttribute code (e.g. color, size)
typestringAttribute type (e.g. select, text, boolean)
adminNamestringInternal admin-facing label
isRequiredinteger1 = required on product forms, 0 = optional
isUniqueinteger1 = value must be unique across products
valuePerLocaleinteger1 = separate value per store locale
valuePerChannelinteger1 = separate value per channel
isFilterableinteger1 = attribute appears in layered navigation filters
isConfigurableinteger1 = used as a configurable variant axis
isVisibleOnFrontinteger1 = shown on the product page storefront
isUserDefinedinteger1 = created by an admin user (not a system attribute)
swatchTypestring|nullSwatch rendering mode (color, image, text); null for non-swatch types
positionintegerDisplay order position
localestring|nullLocale code used for name resolution
createdAtstring|nullISO 8601 creation timestamp
updatedAtstring|nullISO 8601 last-update timestamp
translationsnullAlways null in list responses — full translations are available via the detail endpoint GET /api/admin/catalog/attributes/{id}
optionsnullAlways null in list responses — option data is available via the detail endpoint
validationnullAlways null in list responses — available via the detail endpoint
defaultValuenullAlways null in list responses — available via the detail endpoint

Example Request

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

Example Response

json
{
  "data": [
    {
      "id": 1,
      "code": "sku",
      "type": "text",
      "adminName": "SKU",
      "isRequired": 1,
      "isUnique": 1,
      "valuePerLocale": 0,
      "valuePerChannel": 0,
      "isFilterable": 0,
      "isConfigurable": 0,
      "isVisibleOnFront": 0,
      "isUserDefined": 0,
      "swatchType": null,
      "position": 1,
      "locale": "en",
      "createdAt": "2024-01-01T00:00:00+00:00",
      "updatedAt": "2024-01-01T00:00:00+00:00",
      "translations": null,
      "options": null,
      "validation": null,
      "defaultValue": null
    }
  ],
  "meta": {
    "currentPage": 1,
    "perPage": 10,
    "lastPage": 5,
    "total": 47,
    "from": 1,
    "to": 10
  }
}

Sorting

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

Sortable columns:

sort valueSorts by
idAttribute ID (default)
codeAttribute code
admin_nameAdmin label
typeAttribute type
positionDisplay order position

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

  • translations, options, validation, and defaultValue are always null in list rows. These detail-only fields are only populated by GET /api/admin/catalog/attributes/{id}, which loads all locale translations and — for select, multiselect, and checkbox types — all options with their own translations.
  • adminName is the value from the attributes.admin_name column. It is not locale-aware — it is the internal admin label set when the attribute was created.
  • locale query parameter controls which attribute_translations row is used to resolve any locale-specific display name in the provider. If no translation exists for the requested locale, the adminName column value is used as a fallback.
  • No automatic filter applied. This endpoint returns all attributes (system and user-defined). Pass ?is_user_defined=1 to restrict to admin-created attributes, or ?is_user_defined=0 for system attributes only.
  • 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.