borkoldocs

Objects

Types

List the store's object types and their property definitions.

View as Markdown

Object types are the schema half of the Objects module. Fetch them to learn which content types exist for the store and what shape their records have. See the Objects concept page for the full property type reference.

GET /v1/api/objects/types

List all object types with their active (non-archived) property definitions, ordered by type name. The list is not paginated; the response is a plain data array. Requires the objects:read scope.

No parameters.

Request
curl https://api.borkol.com/v1/api/objects/types \
  -H "Authorization: Bearer {api_key}"
Request (JS)
const res = await fetch("https://api.borkol.com/v1/api/objects/types", {
  headers: { Authorization: `Bearer ${apiKey}` },
});
const { data: types } = await res.json();

Status: 200 OK. Each type contains:

FieldTypeDescription
namestringSingular display name.
plural_namestringPlural display name.
keystringUnique slug. Use it in GET /v1/api/objects/types/{key}/records.
propertiesarrayActive property definitions, each {key, label, type, options, is_required, position}. Archived properties are omitted.
Response
{
  "data": [
    {
      "name": "FAQ",
      "plural_name": "FAQs",
      "key": "faq",
      "properties": [
        {
          "key": "name",
          "label": "Name",
          "type": "text",
          "options": null,
          "is_required": true,
          "position": 0
        },
        {
          "key": "answer",
          "label": "Answer",
          "type": "textarea",
          "options": null,
          "is_required": true,
          "position": 1
        },
        {
          "key": "category",
          "label": "Category",
          "type": "select",
          "options": ["shipping", "returns", "payment"],
          "is_required": false,
          "position": 2
        }
      ]
    }
  ]
}

Errors

  • 403 {"error":"Module not enabled: objects"} when the Objects module is disabled.
  • 403 {"message":"Invalid ability provided."} when the API key lacks the objects:read scope.