Our approach

Workspace and projects

Your master project that contains the data for your production environment lives within a workspace along with other sandbox projects that can be used for testing purposes or local development.

Your content types and documents exist within a project, where you can:

  • Manage your content types
  • Manage fields and field validations
  • Browse, create and manage your documents
  • Upload assets your media library
  • Invite other users to collaborate on your project
  • Manage authorization tokens for your project
  • View your own API documentation
  • Use the built-in GraphiQL IDE to explore your API

Content types

A content type defines a document's data structure in your project. A content type consists of one or more fields. A field describes the type of the data that will be included in your document. The type of a field is either a predefined type or a content type that you have defined previously.

There are four different content types:

  • Simple content type

    A simple content type is the default one. Content editors can create multiple documents of a simple content type.

  • Singleton content type

    Content editors can create only one document of a singleton content type. It is ideal for content that are not repeatable (like a footer component, or a landing page)

  • Enumeration content type

    Enumeration content types are for defining list values. These enumeration content types can be used as values for the select input in the content editor

  • Embeddable content type

    Across different content types you can find yourself to repeat the same set of fields with same settings. For this Mozaik supports content type embedding. An embeddable content type cannot be used to create a document. It works as a predefined set of fields that can be used in multiple content types.

    Let's see how it works through an example. Let's assume your project has the following content types:

    • Article

      The Article content type has a publish date, an author, a title, a content field, and since you're building a responsive website it also has three image fields: one for mobile view, one for tablet, and one for desktop.

    • Event

      The Event content type has a date and a location field, and just like the Article content type three image fields: one for mobile view, one for tablet, and one for desktop.

    With Mozaik you can extract these repeated fields into a new content type. Let's call it Responsive Image. Now you can use this content type as a field type and instead of defining three different fields on the Article and Event content types, you only need to define one (let's name it image) and set the field type to the new Responsive Image.

    Content editors will see all three fields when editing an Article or Event document and you can still easily query the images. You don't have to maintain the same fields across different content types, but only in one place.


Fields

Fields are the small building blocks describing the type of the data. Mozaik gives you the following types by default:

  • Single line text
  • Multiline text
  • Integer
  • Float
  • Date
  • Date and time
  • Boolean
  • Rich text
  • Asset (image, audio, video, file)
  • Select

And as soon as a new content type is defined in the project, it becomes available as a field type.

Document references

When you create a field and set its type to another content type, Mozaik will create a document reference. You can easily select one or more documents from a list of documents.

Field validations

A field can have validations (min or max value, required, pattern, etc.), based on the type of the field.


Documents

There are four main document statuses:

  • Draft
  • Timed
  • Published
  • Archived

Mozaik supports document versioning, and a document version can have the following statuses:

  • Draft
  • Timed
  • Published

When querying documents through the API it will return only the documents with Published status by default.

Versioning

A new document version is created every time a Published document is modified. However when a document version is in Draft or Timed status the content will be overwritten on update.

Edit history

Mozaik always keeps the full edit history. Although the content of a document version in Draft or Timed status is overwritten on update, the previous versions are still saved.

Publishing workflow

Since Mozaik supports document versioning, it comes with a simple publishing workflow as well. There are eight operations for documents:

  • Create a document
  • Update a document
  • Schedule a document for publishing
  • Publish a document
  • Unpublish a document
  • Archive a document
  • Unarchive a document
  • Revert document to the previous version

When a new document is created it gets into Draft status. A document cannot be created and published at the same time. Saving updates to a draft document updates that version, but all edit history is kept for every version.

When a document is in draft status it can be either scheduled for publishing (when this happens the document status is changed to Timed) or publish immediately (document status is changed to Published).

Saving changes to a published document doesn't effect the live content of your document but creates a new document version in Draft status. If you are happy with your changes you can simply publish the new version.

Unpublishing a document

A document can be unpublished. It changes the document status to draft, and it won't be returned in the document queries.

Archiving a document

Documents cannot be deleted at the moment, but they can be archived. When a document is in Archived status, it is not returned in the document queries. All versions and edit history are kept.

Unarchiving a document

An archived document can be unarchived. When it happens the main document status becomes Published if there was a Published version at any point in time, and becomes Draft if there was none.

Revert document to the previous version

If a document is in Published status and the latest version is Published too, it can be reverted to the previous published version. When it happens the current version becomes a draft and the previous version becomes the live version again.


Media library

The Media Library contains all your assets that you uploaded in your project. We serve your assets through a content delivery network to assure quick delivery.


Webhooks

Webhooks are callbacks that you can create to subscribe for certain events happening in your project. Webhooks can have a lot of different use cases: generating static HTML, sending newsletter, posting to social media to name a few.

Currently only document editing events are supported:

  • Create
  • Update
  • Schedule
  • Publish
  • Unpublish
  • Archive
  • Unarchive
  • Revert

Roles and permissions

There are three predefined roles for a project

  • Admin: the owner of the project by default, it has full access to the project.
  • Developer: it can create and manage content types and documents, but can't modify the project settings.
  • Editor: it can only create and manage documents in the project.

API authorization

To access the API you have to create an access token, and you have to use this token in a request's authorization header. Mozaik allows you to set different scopes for each token so you have full control over your data. There are four scopes:

  • Content read: only published documents can be retrieved through the API
  • Content write: only document queries (published and unpublished) and document related mutations are allowed
  • Project read: only project related queries are allowed
  • Project write: only project related mutations are allowed