API ReferenceView as MarkdownOpenAPI

Collections

View as Markdown

Collections group and filter the site's items. The prefix of the name is its kind: product/ is a top-level product category, grouping/ a filter inside one, service/ a service category, calendar-filter/ a filter on the booking page, blogpost/ a blog category, and so on. Collections can nest and can show their own page.

Endpoints that need a token: the site owner creates it in their admin (Developers > API reference). AI assistants: how to ask the user for one.

14 endpoints in 2 parts: Collection, AI builder.

Retrieve an associated group

Get associated collections to another collection.

Public

Public - no token needed.

Path parameters
idstringRequired

The ID of the associated group.

Query parameters
topicstring

Only associated groups with this topic.

servicestring

Only associated groups with this service.

donation-topicstring

Only associated groups with this donation topic.

Status codes

200 404 500

GET/associated-groups/:id
curl -X GET 'http://allsport.bg/associated-groups/{id}?ionic=true&topic=...&service=...&donation-topic=...'
Response
{
  "name": "Example",
  "parent_collection": "6543210fedcba98765432100",
  "picture": "6543210fedcba98765432100",
  "about_page": "6543210fedcba98765432100",
  "match_to_option": false,
  "is_color": false,
  "color": "#3557c4",
  "position": 1,
  "items": [
    "6543210fedcba98765432101"
  ],
  "thumbnail": "6543210fedcba98765432100",
  "_id": "6543210fedcba98765432100"
}

List all collections

Returns the site's collections, newest first unless a sort is given.

Public

Public - no token needed.

Query parameters
typestring

Only collections with this type.

Returns

Returns a list of Collection objects.

Status codes

200 500

GET/collections
curl -X GET 'http://allsport.bg/collections?ionic=true&type=...'
Response
[
  {
    "name": "Example",
    "parent_collection": "6543210fedcba98765432100",
    "picture": "6543210fedcba98765432100",
    "about_page": "6543210fedcba98765432100",
    "match_to_option": false,
    "is_color": false,
    "color": "#3557c4",
    "position": 1,
    "items": [
      "6543210fedcba98765432101"
    ],
    "thumbnail": "6543210fedcba98765432100",
    "_id": "6543210fedcba98765432100"
  }
]

Create a collection

Create new collection.

Admin token

Needs a site admin token.

Parameters
createNavstring

The collection's create nav.

Returns

Returns the Collection object.

Status codes

201 400 401 500

POST/collections
curl -X POST 'http://allsport.bg/collections?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "createNav": "..." }'
Response
{
  "name": "Example",
  "parent_collection": "6543210fedcba98765432100",
  "picture": "6543210fedcba98765432100",
  "about_page": "6543210fedcba98765432100",
  "match_to_option": false,
  "is_color": false,
  "color": "#3557c4",
  "position": 1,
  "items": [
    "6543210fedcba98765432101"
  ],
  "thumbnail": "6543210fedcba98765432100",
  "_id": "6543210fedcba98765432100"
}

Reorder collections

Persist a new display order for a set of collections.

Admin token

Needs a site admin token.

Parameters
itemsstring

The collection's items.

Status codes

200 400 401 500

PATCH/collections-reorder
curl -X PATCH 'http://allsport.bg/collections-reorder?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "items": "..." }'

Retrieve a collection

Returns one collection, found by its ID.

Public

Public - no token needed.

Path parameters
idstringRequired

The ID of the collection.

Returns

Returns the Collection object.

Status codes

200 404 500

GET/collections/:id
curl -X GET 'http://allsport.bg/collections/{id}?ionic=true'
Response
{
  "name": "Example",
  "parent_collection": "6543210fedcba98765432100",
  "picture": "6543210fedcba98765432100",
  "about_page": "6543210fedcba98765432100",
  "match_to_option": false,
  "is_color": false,
  "color": "#3557c4",
  "position": 1,
  "items": [
    "6543210fedcba98765432101"
  ],
  "thumbnail": "6543210fedcba98765432100",
  "_id": "6543210fedcba98765432100"
}

Update a collection

Update Collection by id.

Admin token

Needs a site admin token.

Path parameters
idstringRequired

The ID of the collection.

Returns

Returns the Collection object.

Status codes

200 400 401 404 500

PATCH/collections/:id
curl -X PATCH 'http://allsport.bg/collections/{id}?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'
Response
{
  "name": "Example",
  "parent_collection": "6543210fedcba98765432100",
  "picture": "6543210fedcba98765432100",
  "about_page": "6543210fedcba98765432100",
  "match_to_option": false,
  "is_color": false,
  "color": "#3557c4",
  "position": 1,
  "items": [
    "6543210fedcba98765432101"
  ],
  "thumbnail": "6543210fedcba98765432100",
  "_id": "6543210fedcba98765432100"
}

Delete a collection

Delete Collection record by id.

Admin token

Needs a site admin token.

Path parameters
idstringRequired

The ID of the collection.

Returns

Returns an empty answer on success.

Status codes

200 401 404 500

DELETE/collections/:id
curl -X DELETE 'http://allsport.bg/collections/{id}?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

Retrieve a collection

Returns one collection, found by its ID.

Public

Public - no token needed.

Path parameters
idstringRequired

The ID of the collection.

Returns

Returns the Collection object.

Status codes

200 404 500

GET/collections/:id/media
curl -X GET 'http://allsport.bg/collections/{id}/media?ionic=true'
Response
{
  "name": "Example",
  "parent_collection": "6543210fedcba98765432100",
  "picture": "6543210fedcba98765432100",
  "about_page": "6543210fedcba98765432100",
  "match_to_option": false,
  "is_color": false,
  "color": "#3557c4",
  "position": 1,
  "items": [
    "6543210fedcba98765432101"
  ],
  "thumbnail": "6543210fedcba98765432100",
  "_id": "6543210fedcba98765432100"
}

Create a collection

Creates a collection from the fields sent.

Admin token

Needs a site admin token.

Path parameters
idstringRequired

The ID of the collection.

Status codes

200 400 401

POST/collections/:id/media
curl -X POST 'http://allsport.bg/collections/{id}/media?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

Delete a collection

Deletes the collection. This cannot be undone.

Admin token

Needs a site admin token.

Path parameters
idstringRequired

The ID of the collection.

Returns

Returns an empty answer on success.

Status codes

200 401

DELETE/collections/:id/media
curl -X DELETE 'http://allsport.bg/collections/{id}/media?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

Create a collection with AI

Create a collection from a prompt, written by the AI builder.

Admin token

Needs a site admin token.

Parameters
promptstring

What the AI should do with the collection, in plain words - any language.

chatIdstring

The AI chat this request belongs to; its history and language carry over. Leave it out to start a new chat.

aiVersionstring

Which version of the AI builder to use; leave it out for the current one.

item_idstring

The ID of the collection to change.

Status codes

200 401 500

POST/create-new-collection
curl -X POST 'http://allsport.bg/create-new-collection?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "prompt": "...", "chatId": "...", "aiVersion": "...", "item_id": "..." }'
Response
{
  "chat_id": "6543210fedcba98765432100",
  "role": "user",
  "text": "Text shown on the site.",
  "target_url": "example-item",
  "action": "RESPONSE",
  "options": [
    "example"
  ],
  "medias": [
    {
      "media": "6543210fedcba98765432100",
      "gcs_url": "example-item",
      "gemini_uri": "example",
      "gemini_interaction_id": "example",
      "_id": "6543210fedcba98765432100"
    }
  ],
  "products": [
    "6543210fedcba98765432101"
  ],
  "services": [
    "6543210fedcba98765432101"
  ],
  "blogposts": [
    "6543210fedcba98765432101"
  ],
  "programs": [
    "6543210fedcba98765432101"
  ],
  "suggestions": [
    {
      "text": "Text shown on the site.",
      "route": "example",
      "item_id": "6543210fedcba98765432100",
      "medias": [],
      "picture": "6543210fedcba98765432100",
      "_id": "6543210fedcba98765432100"
    }
  ],
  "is_system": false,
  "_id": "6543210fedcba98765432100",
  "updatedAt": "2026-11-04T12:00:00.000Z",
  "createdAt": "2026-11-04T12:00:00.000Z",
  "data": {
    "object": "example",
    "object_type": "example",
    "edit_summary": "example",
    "edit_diff": "example",
    "undo_record": "example",
    "hero_animation_offer": "example",
    "preview_state": "example",
    "pending_credit_cost": 0,
    "target_restore": "example",
    "media_request": "example",
    "item_request": "example",
    "reference_request": "example"
  }
}

Generate a collection with AI

Use it to create a new category/collection/filter/store/topic for products, services, programs, blogposts, or donations.

Admin token

Needs a site admin token.

Parameters
promptstring

What the AI should do with the collection, in plain words - any language.

chatIdstring

The AI chat this request belongs to; its history and language carry over. Leave it out to start a new chat.

Status codes

200 401 500

POST/generate-collection
curl -X POST 'http://allsport.bg/generate-collection?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "prompt": "...", "chatId": "..." }'

Generate an undefined collection with AI

Generate an undefined collection from a prompt, written by the AI builder.

Admin token

Needs a site admin token.

Parameters
chatIdstring

The AI chat this request belongs to; its history and language carry over. Leave it out to start a new chat.

Status codes

200 401 500

POST/generate-undefined-collection
curl -X POST 'http://allsport.bg/generate-undefined-collection?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "chatId": "..." }'
Response
{
  "chat_id": "6543210fedcba98765432100",
  "role": "user",
  "text": "Text shown on the site.",
  "target_url": "example-item",
  "action": "RESPONSE",
  "options": [
    "example"
  ],
  "medias": [
    {
      "media": "6543210fedcba98765432100",
      "gcs_url": "example-item",
      "gemini_uri": "example",
      "gemini_interaction_id": "example",
      "_id": "6543210fedcba98765432100"
    }
  ],
  "products": [
    "6543210fedcba98765432101"
  ],
  "services": [
    "6543210fedcba98765432101"
  ],
  "blogposts": [
    "6543210fedcba98765432101"
  ],
  "programs": [
    "6543210fedcba98765432101"
  ],
  "suggestions": [
    {
      "text": "Text shown on the site.",
      "route": "example",
      "item_id": "6543210fedcba98765432100",
      "medias": [],
      "picture": "6543210fedcba98765432100",
      "_id": "6543210fedcba98765432100"
    }
  ],
  "is_system": false,
  "_id": "6543210fedcba98765432100",
  "updatedAt": "2026-11-04T12:00:00.000Z",
  "createdAt": "2026-11-04T12:00:00.000Z",
  "data": {
    "object": "example",
    "object_type": "example",
    "edit_summary": "example",
    "edit_diff": "example",
    "undo_record": "example",
    "hero_animation_offer": "example",
    "preview_state": "example",
    "pending_credit_cost": 0,
    "target_restore": "example",
    "media_request": "example",
    "item_request": "example",
    "reference_request": "example"
  }
}

Modify a collection with AI

Use it to modify existing collection/category/filter.

Admin token

Needs a site admin token.

Parameters
promptstring

What the AI should do with the collection, in plain words - any language.

item_datastring

The current collection, as JSON - the AI changes it and returns the result.

chatIdstring

The AI chat this request belongs to; its history and language carry over. Leave it out to start a new chat.

item_idstring

The ID of the collection to change.

item_idsstring

The collection's item ids.

Status codes

200 401 500

POST/modify-collection
curl -X POST 'http://allsport.bg/modify-collection?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "prompt": "...", "item_data": "...", "chatId": "...", "item_id": "...", "item_ids": "..." }'
↑↓ Navigate↵ GoEsc Close