Skip to content

Create a collection model

POST
/collection-models
curl --request POST \
--url https://acme.mykreezalid.com/api/v1/collection-models \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/json' \
--data '{ "handle": "voitures-par-marque", "title": "Voitures par marque", "type": "listing", "rules": { "inclusion": { "type": "AND", "rules": [ { "type": "order_type", "operator": "is", "value": [ "1" ] } ] } }, "pivot": { "type": "attribute", "field": "marque", "values": [ { "value": "12", "label": "Renault" }, { "value": "14", "label": "Peugeot" } ] }, "sort_by": "alphabetical", "hide_empty": false, "handle_pattern": "voitures-{value}", "title_pattern": "Voitures {value}", "page_title": "Voitures {value} d'\''occasion", "subtitle": "example", "description": "example", "image_alt": "example", "template": "example", "thumbnail": "example", "meta_title": "example", "meta_description": "example", "meta_keywords": "example", "no_index": false, "no_follow": false, "sitemap_changefreq": "example", "sitemap_priority": 1 }'

Creates the model and one collection per value, at the address its handle_pattern gives. An address a page, a route or another collection holds is never taken: the collection gets the first free -2, -3…, and its change says what held it (reason, wanted). With dry_run=1, nothing is written: the answer is what would be done.

dry_run
boolean

1 to preview, writing nothing

Media typeapplication/json

A collection model makes one storefront collection per value of a criterion and keeps them in step. Its text fields are patterns: {value} stands for each value’s label. A collection leaving a field unset (null) shows the pattern; one setting it keeps its own.

object
id
integer

Example

3
handle
required

Internal handle, unique among models: a model has no page, so it holds no address of the site

string

Example

voitures-par-marque
title
required

The model’s own name

string

Example

Voitures par marque
type

What its collections present

string
default: listing
Allowed values: listing user
rules

The conditions every collection shares, all of them met: inclusion {type: AND, rules: […]} and exclusion […]

object

Example

{
"inclusion": {
"type": "AND",
"rules": [
{
"type": "order_type",
"operator": "is",
"value": [
"1"
]
}
]
}
}
pivot
required

The criterion that varies: type (attribute, category, seller_group, order_type, city, country, department or tag; for users: seller_group, city, country, department), field (an attribute’s alias) and values, in order, each a value and its label. Sent, it replaces the previous criterion whole.

object

Example

{
"type": "attribute",
"field": "marque",
"values": [
{
"value": "12",
"label": "Renault"
},
{
"value": "14",
"label": "Peugeot"
}
]
}
criterion

The criterion as a person reads it

object

Example

{
"type": "attribute",
"field": "marque",
"name": "Marque"
}
sort_by

The order of its collections: by label, by how many items each presents (the fullest first), or the order of the values

string
default: alphabetical
Allowed values: alphabetical count manual
hide_empty

Whether the theme’s link block (Liquid collection_models.<handle>.collections) leaves out the collections presenting no item, counted every quarter of an hour; their pages stay online

boolean
handle_pattern
required

Its collections’ handle, with {value}

string

Example

voitures-{value}
title_pattern

Its collections’ name, with {value}; empty, the value’s label

string
nullable

Example

Voitures {value}
page_title
string
nullable

Example

Voitures {value} d'occasion
subtitle
string
nullable
description

HTML

string
nullable
image_alt

The image itself is uploaded in the back office

string
nullable
template

Suffix of the theme’s collection template

string
nullable
thumbnail

Snippet drawing each item

string
nullable
meta_title
string
nullable
meta_description
string
nullable
meta_keywords
string
nullable
no_index

Its collections’ default

boolean
no_follow

Its collections’ default

boolean
sitemap_changefreq

Always, hourly, daily, weekly, monthly, yearly or never

string
nullable
sitemap_priority

From 0 to 1

number
nullable
collections

Its collections, in its order: in short in a list of models; as they show (each unset field filled from the pattern, with replaced and count) for one model

Array<object>
Collection

Represents a logical group of listings, such as construction projects or promotions, or a storefront page presenting listings or users. A collection made by a collection model follows its model’s conditions; its fields left null show the model’s patterns.

object
id

Collection’s unique identifier

integer

Example

432432
handle
required

URL-friendly identifier for the collection (slug)

string

Example

soldes
title
required

Human-readable title of the collection

string

Example

Promotions de Printemps
metadata

Flexible metadata container for the collection

object

Example

{
"last_updated_at": "2025-07-01T10:00:00Z",
"theme": "blue"
}
parent_handle

Handle of the parent collection, if this is a sub-collection. It is not returned in responses: list a parent’s sub-collections with GET /collections/{parent_handle}.

string
nullable

Example

promos
storefront_enabled

Whether the collection is a storefront page, at /{handle}

boolean

Example

true
is_online

Whether its page is online

boolean

Example

true
type

What it presents: listing or user

string

Example

listing
page_title

The title its page shows. On a collection made by a model: null for the model’s pattern, empty for nothing, or its own

string
nullable

Example

Voitures électriques
subtitle

Same three states as page_title

string
nullable

Example

null
description

HTML; same three states as page_title

string
nullable

Example

null
image_alt

Alternative text of the image (the image itself is uploaded in the back office)

string
nullable

Example

null
rules

Its conditions: inclusion {type: AND or OR, rules: […]} and exclusion […]. Read-only on a collection made by a model

object

Example

null
template

Suffix of the theme’s collection template; empty, the default one

string
nullable

Example

null
thumbnail

Snippet drawing each item; empty, the default card of its type

string
nullable

Example

null
canonical_url

Full URL; never inherited

string
nullable

Example

null
meta_title

SEO title

string
nullable

Example

null
meta_description

SEO description

string
nullable

Example

null
meta_keywords

SEO keywords

string
nullable

Example

null
no_index

Kept out of search engines; null on a collection made by a model: as the model

boolean
nullable

Example

false
no_follow

Links not followed; null on a collection made by a model: as the model

boolean
nullable

Example

false
sitemap_changefreq

Always, hourly, daily, weekly, monthly, yearly or never

string
nullable

Example

null
sitemap_priority

From 0 to 1

number
nullable

Example

null
model_id

The id of the collection model it is made by; read-only

integer
nullable

Example

null
model_handle

The handle of that model; read-only

string
nullable

Example

null
pivot_value

The model’s value it stands for; read-only

string
nullable

Example

null
pivot_label

The label of that value; read-only

string
nullable

Example

null
model_pivot

The criterion its model varies on: type, field (an attribute’s alias) and a readable name

object

Example

{
"type": "attribute",
"field": "marque",
"name": "Marque"
}
created_at

Collection creation date

string format: date-time

Example

2025-07-20T10:30:00Z
updated_at

Date of last update

string format: date-time

Example

2025-07-20T14:45:00Z

Preview (dry_run): model unsaved, and plan

Media typeapplication/json

A collection model as saved (or as it would be), and the changes to its collections

object
dry_run

True when nothing was written

boolean
model

A collection model makes one storefront collection per value of a criterion and keeps them in step. Its text fields are patterns: {value} stands for each value’s label. A collection leaving a field unset (null) shows the pattern; one setting it keeps its own.

object
id
integer
handle
required

Internal handle, unique among models: a model has no page, so it holds no address of the site

string
title
required

The model’s own name

string
type

What its collections present

string
default: listing
Allowed values: listing user
rules

The conditions every collection shares, all of them met: inclusion {type: AND, rules: […]} and exclusion […]

object
pivot
required

The criterion that varies: type (attribute, category, seller_group, order_type, city, country, department or tag; for users: seller_group, city, country, department), field (an attribute’s alias) and values, in order, each a value and its label. Sent, it replaces the previous criterion whole.

object
criterion

The criterion as a person reads it

object
sort_by

The order of its collections: by label, by how many items each presents (the fullest first), or the order of the values

string
default: alphabetical
Allowed values: alphabetical count manual
hide_empty

Whether the theme’s link block (Liquid collection_models.<handle>.collections) leaves out the collections presenting no item, counted every quarter of an hour; their pages stay online

boolean
handle_pattern
required

Its collections’ handle, with {value}

string
title_pattern

Its collections’ name, with {value}; empty, the value’s label

string
nullable
page_title
string
nullable
subtitle
string
nullable
description

HTML

string
nullable
image_alt

The image itself is uploaded in the back office

string
nullable
template

Suffix of the theme’s collection template

string
nullable
thumbnail

Snippet drawing each item

string
nullable
meta_title
string
nullable
meta_description
string
nullable
meta_keywords
string
nullable
no_index

Its collections’ default

boolean
no_follow

Its collections’ default

boolean
sitemap_changefreq

Always, hourly, daily, weekly, monthly, yearly or never

string
nullable
sitemap_priority

From 0 to 1

number
nullable
collections

Its collections, in its order: in short in a list of models; as they show (each unset field filled from the pattern, with replaced and count) for one model

Array<object>
Collection

Represents a logical group of listings, such as construction projects or promotions, or a storefront page presenting listings or users. A collection made by a collection model follows its model’s conditions; its fields left null show the model’s patterns.

object
id

Collection’s unique identifier

integer
handle
required

URL-friendly identifier for the collection (slug)

string
title
required

Human-readable title of the collection

string
metadata

Flexible metadata container for the collection

object
parent_handle

Handle of the parent collection, if this is a sub-collection. It is not returned in responses: list a parent’s sub-collections with GET /collections/{parent_handle}.

string
nullable
storefront_enabled

Whether the collection is a storefront page, at /{handle}

boolean
is_online

Whether its page is online

boolean
type

What it presents: listing or user

string
page_title

The title its page shows. On a collection made by a model: null for the model’s pattern, empty for nothing, or its own

string
nullable
subtitle

Same three states as page_title

string
nullable
description

HTML; same three states as page_title

string
nullable
image_alt

Alternative text of the image (the image itself is uploaded in the back office)

string
nullable
rules

Its conditions: inclusion {type: AND or OR, rules: […]} and exclusion […]. Read-only on a collection made by a model

object
template

Suffix of the theme’s collection template; empty, the default one

string
nullable
thumbnail

Snippet drawing each item; empty, the default card of its type

string
nullable
canonical_url

Full URL; never inherited

string
nullable
meta_title

SEO title

string
nullable
meta_description

SEO description

string
nullable
meta_keywords

SEO keywords

string
nullable
no_index

Kept out of search engines; null on a collection made by a model: as the model

boolean
nullable
no_follow

Links not followed; null on a collection made by a model: as the model

boolean
nullable
sitemap_changefreq

Always, hourly, daily, weekly, monthly, yearly or never

string
nullable
sitemap_priority

From 0 to 1

number
nullable
model_id

The id of the collection model it is made by; read-only

integer
nullable
model_handle

The handle of that model; read-only

string
nullable
pivot_value

The model’s value it stands for; read-only

string
nullable
pivot_label

The label of that value; read-only

string
nullable
model_pivot

The criterion its model varies on: type, field (an attribute’s alias) and a readable name

object
created_at

Collection creation date

string format: date-time
updated_at

Date of last update

string format: date-time
plan

One change per collection concerned; a collection already in step is not in it

Array<object>

What saving a model does to one of its collections

object
action

Create: a new value’s collection; update: its conditions rewritten; online: a value put back; offline: a value taken out (its texts kept)

string
Allowed values: create update online offline
value
string
label
string
handle

The collection’s handle

string
collection_id

The collection’s id; null for one still to create

integer
nullable
reason

For a create whose address was held: what held it. The collection then takes the first free -2, -3…

string
nullable
Allowed values: page route collection
wanted

For a create: the address the pattern gave

string
nullable

Example

{
"model": {
"id": 3,
"handle": "voitures-par-marque",
"title": "Voitures par marque",
"type": "listing",
"rules": {
"inclusion": {
"type": "AND",
"rules": [
{
"type": "order_type",
"operator": "is",
"value": [
"1"
]
}
]
}
},
"pivot": {
"type": "attribute",
"field": "marque",
"values": [
{
"value": "12",
"label": "Renault"
},
{
"value": "14",
"label": "Peugeot"
}
]
},
"criterion": {
"type": "attribute",
"field": "marque",
"name": "Marque"
},
"sort_by": "alphabetical",
"hide_empty": false,
"handle_pattern": "voitures-{value}",
"title_pattern": "Voitures {value}",
"page_title": "Voitures {value} d'occasion",
"no_index": false,
"no_follow": false,
"collections": [
{
"id": 432432,
"handle": "soldes",
"title": "Promotions de Printemps",
"metadata": {
"last_updated_at": "2025-07-01T10:00:00Z",
"theme": "blue"
},
"parent_handle": "promos",
"storefront_enabled": true,
"is_online": true,
"type": "listing",
"page_title": "Voitures électriques",
"subtitle": null,
"description": null,
"image_alt": null,
"rules": null,
"template": null,
"thumbnail": null,
"canonical_url": null,
"meta_title": null,
"meta_description": null,
"meta_keywords": null,
"no_index": false,
"no_follow": false,
"sitemap_changefreq": null,
"sitemap_priority": null,
"model_id": null,
"model_handle": null,
"pivot_value": null,
"pivot_label": null,
"model_pivot": {
"type": "attribute",
"field": "marque",
"name": "Marque"
},
"created_at": "2025-07-20T10:30:00Z",
"updated_at": "2025-07-20T14:45:00Z"
}
]
},
"plan": [
{
"action": "create",
"value": "12",
"label": "Renault",
"handle": "voitures-renault",
"reason": "page",
"wanted": "voitures-renault"
}
]
}

Created: model, and plan, the changes carried out

Media typeapplication/json

A collection model as saved (or as it would be), and the changes to its collections

object
dry_run

True when nothing was written

boolean
model

A collection model makes one storefront collection per value of a criterion and keeps them in step. Its text fields are patterns: {value} stands for each value’s label. A collection leaving a field unset (null) shows the pattern; one setting it keeps its own.

object
id
integer
handle
required

Internal handle, unique among models: a model has no page, so it holds no address of the site

string
title
required

The model’s own name

string
type

What its collections present

string
default: listing
Allowed values: listing user
rules

The conditions every collection shares, all of them met: inclusion {type: AND, rules: […]} and exclusion […]

object
pivot
required

The criterion that varies: type (attribute, category, seller_group, order_type, city, country, department or tag; for users: seller_group, city, country, department), field (an attribute’s alias) and values, in order, each a value and its label. Sent, it replaces the previous criterion whole.

object
criterion

The criterion as a person reads it

object
sort_by

The order of its collections: by label, by how many items each presents (the fullest first), or the order of the values

string
default: alphabetical
Allowed values: alphabetical count manual
hide_empty

Whether the theme’s link block (Liquid collection_models.<handle>.collections) leaves out the collections presenting no item, counted every quarter of an hour; their pages stay online

boolean
handle_pattern
required

Its collections’ handle, with {value}

string
title_pattern

Its collections’ name, with {value}; empty, the value’s label

string
nullable
page_title
string
nullable
subtitle
string
nullable
description

HTML

string
nullable
image_alt

The image itself is uploaded in the back office

string
nullable
template

Suffix of the theme’s collection template

string
nullable
thumbnail

Snippet drawing each item

string
nullable
meta_title
string
nullable
meta_description
string
nullable
meta_keywords
string
nullable
no_index

Its collections’ default

boolean
no_follow

Its collections’ default

boolean
sitemap_changefreq

Always, hourly, daily, weekly, monthly, yearly or never

string
nullable
sitemap_priority

From 0 to 1

number
nullable
collections

Its collections, in its order: in short in a list of models; as they show (each unset field filled from the pattern, with replaced and count) for one model

Array<object>
Collection

Represents a logical group of listings, such as construction projects or promotions, or a storefront page presenting listings or users. A collection made by a collection model follows its model’s conditions; its fields left null show the model’s patterns.

object
id

Collection’s unique identifier

integer
handle
required

URL-friendly identifier for the collection (slug)

string
title
required

Human-readable title of the collection

string
metadata

Flexible metadata container for the collection

object
parent_handle

Handle of the parent collection, if this is a sub-collection. It is not returned in responses: list a parent’s sub-collections with GET /collections/{parent_handle}.

string
nullable
storefront_enabled

Whether the collection is a storefront page, at /{handle}

boolean
is_online

Whether its page is online

boolean
type

What it presents: listing or user

string
page_title

The title its page shows. On a collection made by a model: null for the model’s pattern, empty for nothing, or its own

string
nullable
subtitle

Same three states as page_title

string
nullable
description

HTML; same three states as page_title

string
nullable
image_alt

Alternative text of the image (the image itself is uploaded in the back office)

string
nullable
rules

Its conditions: inclusion {type: AND or OR, rules: […]} and exclusion […]. Read-only on a collection made by a model

object
template

Suffix of the theme’s collection template; empty, the default one

string
nullable
thumbnail

Snippet drawing each item; empty, the default card of its type

string
nullable
canonical_url

Full URL; never inherited

string
nullable
meta_title

SEO title

string
nullable
meta_description

SEO description

string
nullable
meta_keywords

SEO keywords

string
nullable
no_index

Kept out of search engines; null on a collection made by a model: as the model

boolean
nullable
no_follow

Links not followed; null on a collection made by a model: as the model

boolean
nullable
sitemap_changefreq

Always, hourly, daily, weekly, monthly, yearly or never

string
nullable
sitemap_priority

From 0 to 1

number
nullable
model_id

The id of the collection model it is made by; read-only

integer
nullable
model_handle

The handle of that model; read-only

string
nullable
pivot_value

The model’s value it stands for; read-only

string
nullable
pivot_label

The label of that value; read-only

string
nullable
model_pivot

The criterion its model varies on: type, field (an attribute’s alias) and a readable name

object
created_at

Collection creation date

string format: date-time
updated_at

Date of last update

string format: date-time
plan

One change per collection concerned; a collection already in step is not in it

Array<object>

What saving a model does to one of its collections

object
action

Create: a new value’s collection; update: its conditions rewritten; online: a value put back; offline: a value taken out (its texts kept)

string
Allowed values: create update online offline
value
string
label
string
handle

The collection’s handle

string
collection_id

The collection’s id; null for one still to create

integer
nullable
reason

For a create whose address was held: what held it. The collection then takes the first free -2, -3…

string
nullable
Allowed values: page route collection
wanted

For a create: the address the pattern gave

string
nullable

Example

{
"model": {
"id": 3,
"handle": "voitures-par-marque",
"title": "Voitures par marque",
"type": "listing",
"rules": {
"inclusion": {
"type": "AND",
"rules": [
{
"type": "order_type",
"operator": "is",
"value": [
"1"
]
}
]
}
},
"pivot": {
"type": "attribute",
"field": "marque",
"values": [
{
"value": "12",
"label": "Renault"
},
{
"value": "14",
"label": "Peugeot"
}
]
},
"criterion": {
"type": "attribute",
"field": "marque",
"name": "Marque"
},
"sort_by": "alphabetical",
"hide_empty": false,
"handle_pattern": "voitures-{value}",
"title_pattern": "Voitures {value}",
"page_title": "Voitures {value} d'occasion",
"no_index": false,
"no_follow": false,
"collections": [
{
"id": 432432,
"handle": "soldes",
"title": "Promotions de Printemps",
"metadata": {
"last_updated_at": "2025-07-01T10:00:00Z",
"theme": "blue"
},
"parent_handle": "promos",
"storefront_enabled": true,
"is_online": true,
"type": "listing",
"page_title": "Voitures électriques",
"subtitle": null,
"description": null,
"image_alt": null,
"rules": null,
"template": null,
"thumbnail": null,
"canonical_url": null,
"meta_title": null,
"meta_description": null,
"meta_keywords": null,
"no_index": false,
"no_follow": false,
"sitemap_changefreq": null,
"sitemap_priority": null,
"model_id": null,
"model_handle": null,
"pivot_value": null,
"pivot_label": null,
"model_pivot": {
"type": "attribute",
"field": "marque",
"name": "Marque"
},
"created_at": "2025-07-20T10:30:00Z",
"updated_at": "2025-07-20T14:45:00Z"
}
]
},
"plan": [
{
"action": "create",
"value": "12",
"label": "Renault",
"handle": "voitures-renault",
"reason": "page",
"wanted": "voitures-renault"
}
]
}

Invalid: errors lists every problem

Media typeapplication/json

Why a collection or collection model request was refused.

object
success
boolean
message
string
errors

The problems found: for a collection, field by field, the rules not met and their messages. Present only when there are some.

Example

{
"success": false,
"message": "Collection handle is required"
}