Entities

Entities

Source:
The different kinds of top level entities you can find in Contentful

Type Definitions

Asset

Source:
Properties:
Name Type Description
sys Entities.Sys Standard system metadata with additional entry specific properties
Properties
Name Type Attributes Description
locale string <optional>
If present, indicates the locale which this asset uses
fields Object Object with content for each field
Properties
Name Type Description
title string Title for this asset
description string Description for this asset
file Object File object for this asset
Properties
Name Type Description
fileName string Name for the file
contentType string Mime type for the file
url string Url where the file is available at.
details Object Details for the file, depending on file type (example: image size in bytes, etc)
toPlainObject() function Returns this Asset as a plain JS object

AssetCollection

Source:
Properties:
Name Type Description
total number
skip number
limit number
items Array.<Entities.Asset>
toPlainObject() function Returns this Asset collection as a plain JS object

ContentType

Source:
Properties:
Name Type Description
sys Entities.Sys System metadata
name string
description string
displayField string Field used as the main display field for Entries
Array string All the fields contained in this Content Type
toPlainObject() function Returns this Content Type as a plain JS object

ContentTypeCollection

Source:
Properties:
Name Type Description
total number
skip number
limit number
items Array.<Entities.ContentType>
toPlainObject() function Returns this Content Type collection as a plain JS object

Entry

Source:
Properties:
Name Type Description
sys Entities.Sys Standard system metadata with additional entry specific properties
Properties
Name Type Attributes Description
contentType Entities.Link Content Type used by this Entry
locale string <optional>
If present, indicates the locale which this entry uses
fields Object.<EntryFields.Field> Object with content for each field
toPlainObject() function Returns this Entry as a plain JS object

EntryCollection

Source:
Properties:
Name Type Attributes Description
total number
skip number
limit number
items Array.<Entities.Entry>
errors Array.<Object> <optional>
Array of errors that might occur when retrieving entries.
includes Object.<Array> <optional>
Object with arrays of includes for Entries and Assets. This will be present if resolveLinks is on, and any linked entries or assets exist. Those links will be resolved in the Entries present in the items array, but they are also present here in raw form.
toPlainObject() function Returns this Entry collection as a plain JS object
stringifySafe(replacer,space) function Stringifies the entry collection, accounting for circular references. Circular references will be replaced with just a Link object, with a circular property set to true. See MDN and json-stringify-safe for more details on the arguments this method can take.

Field

Source:
A Field in an Entry can have one of the following types that can be defined in Contentful. See Field Types for more details.
Type:
Source:
Properties:
Name Type Description
type string type of this entity. Always link.
id string
linkType string type of this link. If defined, either Entry or Asset
Link to another entity. See Links for more details.

Locale

Source:
Properties:
Name Type Description
sys Entities.Sys Standard system metadata with additional entry specific properties
name string locale name (example: English)
code string locale code (example: en-US)
fallbackCode string the locale code to fallback to when there is not content for the current locale
default boolean If this is the default locale
optional boolean If the locale needs to be filled in on entries or not
toPlainObject() function Returns this Locale as a plain JS object

LocaleCollection

Source:
Properties:
Name Type Description
total number
skip number
limit number
items Array.<Entities.Locale>
toPlainObject() function Returns this Locale collection as a plain JS object

Space

Source:
Properties:
Name Type Description
sys Object System metadata
Properties
Name Type Description
id string Space id
type string Entity type
name string Space name
locales Array.<string> Array with locale codes
toPlainObject() function Returns this Space as a plain JS object

Sys

Source:
Properties:
Name Type Description
type string
id string
space Entities.Link
createdAt string
updatedAt string
revision number
System metadata. See Common Resource Attributes for more details.