Skip to content

Contents

In Atlas CMS, Contents are the entities you add through the Admin UI or the API. They are composed by a common set of properties and the set of attributes specified in the model.

Content Object

The Content data model is like the following:

json
{
  "id": "string",
  "locale": "string",
  "createdAt": "datetime",
  "createdBy": "string",
  "modifiedAt": "datetime",
  "modifiedBy": "string",
  "hash": "string",
  "stage": "string",
  "modelId": "string",
  "modelKey": "string",
  "attributes": {
    "prop1": "...",
    "prop2": "..."
  },
  "locales": [
    {
      "id": "string",
      "culture": "string"
    }
  ]
}
PropertyDescription
idThe Entity ID
localeThe Entity Locale. If Model is not localizable this property is not available
createdAtCreation date (UTC)
createdByThe username of the user who created the Entity
modifiedAtModify date (UTC)
modifiedByThe username of the user who modified the Entity
stagepublished or unpublished. If Model doesn't have Stage mode active this property is not available
modelIdThe ID of the model
modelKeyThe API Key name of the model
attributesThe object with the properties defined in the model
localesThe list of translations id/culture. If Model is not localizable this property is not available
hashThe hash representation of the attributes

Attributes and Fields

The Content object contains an attributes property. Inside it are all the fields, in the form of JSON properties, defined for the model with the relative value inserted for the Content.

Each field can be filtered using specific field operators. Check Filtering Contents for all available filtering options.

Field Representations

Each field has its own JSON representation which corresponds to the underlying data type:

Field TypeData type
Textstring
Rich Textstring
Numberinteger or decimal
Yes/Noboolean
Datestring (ISO date)
Date & Timestring (ISO datetime)
Timestring
Single Choicestring
EnumerationArray of strings
Mediastring (id) or object (when resolve=media)
Media GalleryArray of strings or Array of objects (when resolve=media)
Mapobject with coordinates
Key/ValueArray of objects [{"key":"key1","value":"value1"},...]
Value ArrayArray of strings
Jsonobject or array
RelationsArray of strings (ids) or Array of objects (when resolve=relations)
Componentobject
Multi ComponentArray of objects

Media and Relations

When sending data:

  • Media: Can be string (id) or object (media object)
  • Relations: Can be Array of strings (content ids)

When receiving data:

  • Media: string (id) or object (if resolve=media parameter is passed)
  • Relations: Array of strings (ids) or Array of objects (if resolve=relations is passed)

TIP

Content update API acts like a patch for the attributes object. To clean up a field, pass it with null. Fields not in the model are skipped.

Atlas CMS Documentation