FAQ / APIs

On this page

Are Contentful sys.id values unique?

Whether a sys.id value generated by Contentful is unique depends on the specific context of the ID:

  • Organization IDs - always unique.

  • Space IDs - always unique.

  • Environment IDs - always unique within a single space. These may be reused in other spaces.

  • Asset or Entry IDs - unique within a single environment in a single space. If an environment is forked, IDs will be reused for all assets and entries in that environment. Similarly, asset and entry IDs may be reused in other spaces or environments when auto-generated.

  • Other resource IDs - unique within the context of the resource. For example, App Definition IDs are an organization resource and are unique within an organization, while API Key IDs are a space resource and unique within a space. It is always recommended to specify the context you are querying for to ensure that the correct data is returned.

Why do I see error "not resolvable" in API response?

You can query an entry and its related data in a single request, however, if the linked items are unpublished or deleted, they will not be retrievable through the Delivery API and, as a consequence, a notResolvable error is returned in the API response.

How do I retrieve the linked entries/assets of an entry?

You can query an entry and its related data in a single request with include parameter, since the parameter is only available for the entry collection endpoint, you could use a query like: entries?sys.id={entry_id}&include=5

How to query never published entries?

You could use sys.publishedVersion[exists]=false in Content Management API to filter these entries. Entries that are never published don't have sys.publishedVersion attribute.

How to search for entries of multiple content types?

You could use the inclusion operator, for example: ?sys.contentType.sys.id[in]=content_type1,content_type2,...

Is there an OR operator for querying entries?

It is not directly possible via REST API, you will need to perform two requests to achieve so. Alternatively, it is possible to use GraphQL for OR operation, please find the documentation here.

How to find entries/assets that are not linked to any entry?

You could use the Content Delivery API:

  1. Retrieve all the entries/assets

  2. Perform an iterative process through all the entries/assets utilizing links_to_entry & links_to_assets query parameters

  3. The entries/assets that aren't linked to any entry return "total": 0 in the API response

The process might be costly, but it should be feasible if it is for housekeeping purposes.

Why image transformation doesn't work?

If the image is larger than 20 MB, then it is consider as an asset per the techinical limit, so the image transformation will not work.

Futhermore, you will also notice asset domain changes. For image assets <20 MB, the endpoint will be images.ctfassets.net. For image assets >20 MB, it will be downloads.ctfassets.net. For other file types, it will point to assets.ctfassets.net.

How to receive an alert notification when reaching the record limit?

There isn't a built-in solution at the moment. However, you could set up a cron job that pings the Content Management API to calculate records usage (#records = #entries + #assets, current usage can be found at the "total" property in the API response), and triggers an alert notification once a threshold is reached.

Why do I receive a 404 error when fetching data from a specific environment?

It could be due to that the API token you use doesn't have access to the environment, you could go to 'Settings' -> 'API Keys' -> 'Environments' to check and configure it.

add-circle arrow-right remove style-two-pin-marker subtract-circle remove