Entries

Entry object description

Entry object consists of the following top-level properties:

FieldTypeDescription
metadataMetadataUser-controlled metadata.
Note: Currently holds tags and concepts property, which contains lists of tags and taxonomy concepts assigned to an entry, respectively.
sysSysCommon system properties. For detailed description of properties, please refer to Common resource attributes.
fieldsObjectFields that are custom defined by a user through the definition of content types.
fields object in CMA always includes locale.

Entries collection

Entries represent text content in a space, and the data structure of an entry must adhere to a certain content type.

Get all entries of a space

To fetch specific entries like e.g. entries of a particular content type use query search parameters.

Create an entry

Before you can create an entry you need to create and activate a content type as outlined above.

When creating a new entry, you need to pass the ID of the desired content type as the X-Contentful-Content-Type header and pass the field data as a JSON payload.

When using this endpoint, an ID will be automatically generated for the created entry and returned in the response.

If default values are set for some field of the content type, they will be applied at entry creation, if the corresponding field isn’t provided in the request body. Default values don’t affect entry updates.

New entries are created as drafts. To make new content entries available via the CDA, create and publish them.

Published Entries collection

Use this endpoint to get all published entries of a given space.

Get all published entries of a space

Entry

Create an entry with ID

Use this endpoint to create a new entry with a specified ID. When creating a new entry, you need to pass the ID of the entry’s desired content type as the X-Contentful-Content-Type header.

To update an entry, use the Create an entry with ID endpoint to update a specific entry via its ID. When updating an existing entry, you need to specify the last version of the entry you are updating with X-Contentful-Version.

You do not need to pass the ID of the entry’s content type.

Patch an entry

Use this endpoint to update a specific entry via its ID using JSON Patch format. When patching an entry, you need to specify the current version of the entry you are updating with X-Contentful-Version.

JSON Patch cannot perform operations on non-existing fields. If the field is defined on the Content Type but has not been set on the Entry yet, the API will return a validation error when you try to perform an operation on this field. The accepted workaround is to pass the entire sub-object to the top-most existing field, including locale and initial value.
1// may result in the validation error if `description` field is undefined:
2[{"op": "add", "path": "/fields/description/en-US", "value": "initial value"}]
3
4// if `description` field is not defined on Entry, but defined in the Content Type, make sure to provide the locale in the payload:
5[{"op": "add", "path": "/fields/description", "value": {"en-US": "initial value"}}]

Get an entry

Use this endpoint to fetch an entry with a specified ID. All empty entry fields are omitted from the response, that means if the field is empty its key is not going to be presented in the response. If the entry has no set fields the corresponding key is missing as well. In order to update the entry with empty fields all keys that need to be updated should be added to the entry object.

Delete an entry

Entry references

Recursively collects references of an entry and their descendants, up to 10 levels deep, and returns them.

Limitations

  • Collect all descendants, up to 10 levels deep.
  • The maximum size of includes array is 1000.

Get entry references

Entry publishing

After publishing the entry, it will be available via the Content Delivery API.

Publish an entry

Unpublish an entry

Locale-based publishing

This feature is only available on the Premium/Enterprise pricing plans.

To publish or unpublish entry’s fields in certain locales, use the Entry publishing endpoints and pass in the locales in the payload as show in the examples below:

Publish entry locales:

{
"add": {
"fields": {
"*": [
"en-US",
"de-DE"
]
}
}
}

Unpublish entry locales:

{
"remove": {
"fields": {
"*": [
"en-US",
"de-DE"
]
}
}
}

Entry archiving

You can only archive an entry when it’s not published.

Archive an entry

Unarchive an entry