Skip to main content

Collections

A collection is a container for related documents that share the same structure and purpose. Think of it as a template that defines what kind of content you want to manage. For example, you might have a "Home Banners" collection for promotional content on your app's home screen, or a "Summer Coupons" collection for seasonal discounts.

Collection Properties

Each collection has the following properties:

  • Name: Human-readable name for the collection (e.g., "Home Page Banners")
  • Slug: URL-friendly identifier (e.g., "home-banners"), auto-generated from the name
  • Content Type: Categorizes the collection ("static" or "coupon")
  • Description: Optional explanation of the collection's purpose
  • Tags: Optional array of strings for categorization and filtering
  • FTS Fields: Fields to index for full-text search (e.g., ["name", "description"])
  • Facet Fields: Fields that can be used for filtering with data type mapping
  • JSON Schema: Optional schema for validating document attributes

Collection Types

The Content Manager supports two types of collections, each optimized for different use cases:

Static Collections

Static collections give you complete control over the content. You manually create each document and define all its properties.

Best for:

  • Promotional banners with custom images and links
  • Featured products or services
  • Announcements and news updates
  • Educational content or tutorials
  • App onboarding flows

Example:

{
"name": "Home Page Banners",
"slug": "home-banners",
"contentType": "static",
"description": "Promotional content for the app home screen",
"tags": ["promotion", "home"],
"ftsFields": ["name", "description"],
"facetFields": {
"category": "string"
}
}

Coupon Collections

Coupon collections are specifically designed to showcase coupons from your existing coupon books system. When you add a coupon to a collection, many fields are automatically populated from the coupon book data.

Best for:

  • Available discounts showcase
  • Tier-specific coupon displays
  • Seasonal promotion collections
  • Curated reward offerings

Auto-populated fields:

  • Name (from coupon book)
  • Description
  • Picture URL
  • Valid dates (fromDate/toDate)
  • Audience keys (eligibility)
  • Coupon book key (for redemption)

Example:

{
"name": "Summer Discounts",
"slug": "summer-discounts",
"contentType": "coupon",
"description": "Seasonal coupon offers for summer",
"tags": ["coupon", "summer", "seasonal"]
}

Full-Text Search (FTS) Fields

When creating a collection, you can specify which document attributes should be indexed for full-text search. This allows client applications to search for content by keywords.

For example, if you set ftsFields: ["name", "description"], clients can search for documents containing specific words in those fields:

GET /cms/collections/home-banners/documents?q=summer+sale

Facet Fields

Facet fields enable filtering by specific attribute values. You define which attributes can be used as facets and their data types:

{
"facetFields": {
"category": "string",
"priority": "number",
"validUntil": "date"
}
}

Clients can then filter documents:

GET /cms/collections/home-banners/documents?facet.category=electronics

The search response will also include aggregated counts for each facet value, useful for building filter UIs.

Multi-Tenancy

Collections are automatically scoped to your organization. This means:

  • Your collections are private and not visible to other organizations
  • Collection names and slugs must be unique within your organization
  • All API requests are authenticated and scoped to your organization ID

Collection Lifecycle

  1. Create: Define a collection with its structure and properties
  2. Populate: Add documents with content (see Documents)
  3. Publish: Make content available to client applications
  4. Update: Modify documents or collection properties as needed
  5. Archive: Collections can be modified but not deleted (data preservation)

Note: While documents support soft deletion, collections themselves remain in the system for data integrity and audit purposes.

Next Steps

  • Learn about Documents - the content items within collections