Sorry, no results found for "".

Show examples in:
Javascript HTTP

Content Management API > Record

List all records

To retrieve a collection of records, send a GET request to the /items endpoint. The collection is paginated, so make sure to iterate over all the pages if you need every record in the collection!

The following table contains the list of all the possible arguments, along with their type, description and examples values.

Pro tip: in case of any doubts you can always inspect the network calls that the CMS interface is doing, as it's using the Content Management API as well!

Query parameters

nested boolean

For Modular Content, Structured Text and Single Block fields. If set, returns full payload for nested blocks instead of IDs

filter object

Attributes to filter records

ids string

Record (or block record) IDs to fetch, comma separated. If you use this filter, you must not use filter[type] or filter[fields]

Example: "c89tCUarTvGKxA37acCEWA,aCiWeOsUT3mxY0KIzUfAhw"
type string

Model ID or api_key to filter. If you use this filter, you must not use filter[ids]. Comma separated values are accepted, but you must not use filter[fields] in this case

Example: "cat,dog"
query string

Textual query to match. You must not use filter[ids]. If locale is defined, search within that locale. Otherwise environment's main locale will be used.

Example: "foo"
fields object

Same as GraphQL API records filters: you must use square brackets to indicate nesting levels. E.g. if you wanna filter by parent record in a tree of records, you must use filter[fields][parent][eq]=<ID_VALUE>. Use snake_case for fields names. If locale is defined, search within that locale. Otherwise environment's main locale will be used.

Example: { name: { eq: "Buddy" } }
only_valid string

When set, only valid records are included in the results.

Example: "true"
locale string

When filter[query] or field[fields] is defined, filter by this locale. Default: environment's main locale

Example: "it"
page object

Parameters to control offset-based pagination

offset integer

The (zero-based) offset of the first entity returned in the collection (defaults to 0)

Example: 200
limit integer

The maximum number of entities to return (defaults to 30, maximum is 500)

order_by string

Fields used to order results. You must specify also filter[type] with one element only to be able use this option. Format: <field_name>_(ASC|DESC), where <field_name> can be either the API key of a model's field, or one of the following meta columns: id, _updated_at, _created_at, _status, _published_at, _first_published_at, _publication_scheduled_at, _unpublishing_scheduled_at, _is_valid, position (only for sortable models). You can pass multiple comma separated rules.

Example: "name_DESC"
version string

Whether you want the currently published versions (published, default) of your records, or the latest available (current)

Example: "current"

Returns

Returns an array of resource objects of type item.

Other examples

If you don't specify any parameters, we'll simply return the first 30 records. They can be from any model in your project.

GET https://site-api.datocms.com/items HTTP/1.1
Authorization: Bearer YOUR-API-TOKEN
Accept: application/json
X-Api-Version: 3
Terminal window
curl -g 'https://site-api.datocms.com/items' \
\
-H "Authorization: Bearer YOUR-API-TOKEN" \
-H "Accept: application/json" \
-H "X-Api-Version: 3"
await fetch("https://site-api.datocms.com/items", {
headers: {
Authorization: "Bearer YOUR-API-TOKEN",
Accept: "application/json",
"X-Api-Version": "3",
},
});
HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: cache-control: max-age=0, private, must-revalidate
X-RateLimit-Limit: 30
X-RateLimit-Remaining: 28
{
"data": [
{
"id": "VDd0Ig2WTZukQ8DU9ZskXg",
"type": "item",
"attributes": {
"name": "Shout"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:33.887+00:00",
"updated_at": "2024-03-12T20:08:33.895+00:00",
"published_at": "2024-03-12T20:08:33.945+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:33.945+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "LPlwzflrSYyH4FQhCubRgQ",
"stage": null
}
},
{
"id": "fPW3GwaCTAaCfHWr9C1RrQ",
"type": "item",
"attributes": {
"name": "Coming Up"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:33.841+00:00",
"updated_at": "2024-03-12T20:08:33.850+00:00",
"published_at": "2024-03-12T20:08:33.882+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:33.882+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "IiCnty-tSdGnvBUZPd_g4A",
"stage": null
}
},
{
"id": "N_-eUO9JQYGaaglCwQSWog",
"type": "item",
"attributes": {
"name": "Help Me"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:33.822+00:00",
"updated_at": "2024-03-12T20:08:33.829+00:00",
"published_at": "2024-03-12T20:08:33.855+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:33.855+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "OBGHUfjgQzWyTiBZ3S0ZxA",
"stage": null
}
},
{
"id": "QzIMNNYARMiT7mXQffJXUw",
"type": "item",
"attributes": {
"name": "Revolution"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:33.755+00:00",
"updated_at": "2024-03-12T20:08:33.790+00:00",
"published_at": "2024-03-12T20:08:33.888+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:33.888+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "UM3T3zlISyKWp3lAethauA",
"stage": null
}
},
{
"id": "cSp-WX-_R7m_r_hG0D0Ekg",
"type": "item",
"attributes": {
"name": "One of Us"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:33.743+00:00",
"updated_at": "2024-03-12T20:08:33.755+00:00",
"published_at": "2024-03-12T20:08:34.240+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:34.240+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "SjWxQjSCRy-g_B7t1GcnPw",
"stage": null
}
},
{
"id": "Se50jCOWT5SOghV3onN6Mw",
"type": "item",
"attributes": {
"name": "Sweet Child O' Mine"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:33.719+00:00",
"updated_at": "2024-03-12T20:08:33.747+00:00",
"published_at": "2024-03-12T20:08:33.924+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:33.924+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "TVRARw0hSt6hUiQvLv2ang",
"stage": null
}
},
{
"id": "fbR0-_4QTHqJmJia2h16Rw",
"type": "item",
"attributes": {
"name": "Mmmbop"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:33.720+00:00",
"updated_at": "2024-03-12T20:08:33.743+00:00",
"published_at": "2024-03-12T20:08:33.911+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:33.911+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "Bz6Q2sN9SReSkExNVmtsbg",
"stage": null
}
},
{
"id": "PDsVV3r_QB2svx1kUF8Rpg",
"type": "item",
"attributes": {
"name": "Sexyback"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:33.700+00:00",
"updated_at": "2024-03-12T20:08:33.741+00:00",
"published_at": "2024-03-12T20:08:33.805+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:33.805+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "GSzCoAaRQEiT7QuRGHwFjg",
"stage": null
}
},
{
"id": "RIBJJQMSS5eXJwGxbifYHw",
"type": "item",
"attributes": {
"name": "Disturbia"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:33.720+00:00",
"updated_at": "2024-03-12T20:08:33.734+00:00",
"published_at": "2024-03-12T20:08:33.784+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:33.784+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "V9c7_0jCSWOX8RWVMQGUwg",
"stage": null
}
},
{
"id": "Ieuj8bvVRSu9mwMveGSwXw",
"type": "item",
"attributes": {
"name": "Freak Me"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:33.706+00:00",
"updated_at": "2024-03-12T20:08:33.713+00:00",
"published_at": "2024-03-12T20:08:33.734+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:33.734+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "dstkWckSQgauGwRlDIUBwA",
"stage": null
}
},
{
"id": "TbI1PkaNR0e3LFcw6Ckmog",
"type": "item",
"attributes": {
"name": "Kiss & Say Goodbye"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:33.641+00:00",
"updated_at": "2024-03-12T20:08:33.705+00:00",
"published_at": "2024-03-12T20:08:33.773+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:33.773+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "IGCN5mkFRp-tnZxxZ_a9lA",
"stage": null
}
},
{
"id": "c8J1VJ_OSySn_QBW-hHahw",
"type": "item",
"attributes": {
"name": "Nothing Compares 2 U"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:33.639+00:00",
"updated_at": "2024-03-12T20:08:33.649+00:00",
"published_at": "2024-03-12T20:08:33.705+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:33.705+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "TIKPdgkIT9aupLazDwczAg",
"stage": null
}
},
{
"id": "KhMoyywXQ3m3tpegrsh6VQ",
"type": "item",
"attributes": {
"name": "Here Without You"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:33.564+00:00",
"updated_at": "2024-03-12T20:08:33.577+00:00",
"published_at": "2024-03-12T20:08:33.611+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:33.611+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "fwFBPaVGRrulUy0PWjGmFw",
"stage": null
}
},
{
"id": "Qje_l1cnSmu5baRVOFw7gQ",
"type": "item",
"attributes": {
"name": "Lights"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:33.549+00:00",
"updated_at": "2024-03-12T20:08:33.558+00:00",
"published_at": "2024-03-12T20:08:33.586+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:33.586+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "XucCRmJGQLKwc-N_ng47zQ",
"stage": null
}
},
{
"id": "PYJxVcctSiSM5XeSynv_1Q",
"type": "item",
"attributes": {
"name": "Another Brick in the Wall (part 2)"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:33.542+00:00",
"updated_at": "2024-03-12T20:08:33.551+00:00",
"published_at": "2024-03-12T20:08:33.590+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:33.590+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "TDODGE4FTc2G43E162qGOg",
"stage": null
}
},
{
"id": "J1yFGsVRQi-m15gNcF8P6A",
"type": "item",
"attributes": {
"name": "Nights in White Satin"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:33.531+00:00",
"updated_at": "2024-03-12T20:08:33.537+00:00",
"published_at": "2024-03-12T20:08:33.557+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:33.557+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "UjxUj6lVTwW24f4hRQ4tmQ",
"stage": null
}
},
{
"id": "aSvm-MvUQ5uxUNh_WKq3Zw",
"type": "item",
"attributes": {
"name": "Mr Big Stuff"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:32.047+00:00",
"updated_at": "2024-03-12T20:08:32.353+00:00",
"published_at": "2024-03-12T20:08:33.190+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:33.190+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "PvAQQ8a4TL2UalPgz28T6Q",
"stage": null
}
},
{
"id": "PaawsjZoTV-ntkDYKXdnDQ",
"type": "item",
"attributes": {
"name": "Puttin' on the Ritz"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:30.907+00:00",
"updated_at": "2024-03-12T20:08:30.914+00:00",
"published_at": "2024-03-12T20:08:30.940+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:30.940+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "CzJ-blM8TRCy4YERcFscCQ",
"stage": null
}
},
{
"id": "aTGstd4dR2GZmqziBae1Ng",
"type": "item",
"attributes": {
"name": "Give Me Everything"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:30.896+00:00",
"updated_at": "2024-03-12T20:08:30.904+00:00",
"published_at": "2024-03-12T20:08:30.933+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:30.933+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "JMgMTVGpSeq9a_RdMQUvPA",
"stage": null
}
},
{
"id": "XeyHPBhRQuyPnF5MqJeFIw",
"type": "item",
"attributes": {
"name": "Brother Louie"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:30.893+00:00",
"updated_at": "2024-03-12T20:08:30.900+00:00",
"published_at": "2024-03-12T20:08:30.932+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:30.932+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "DZoZPfKxTpiAv4daOfpWoQ",
"stage": null
}
},
{
"id": "PnE_1FRNQSGNOaKsPSAeVA",
"type": "item",
"attributes": {
"name": "Check On It"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:30.838+00:00",
"updated_at": "2024-03-12T20:08:30.846+00:00",
"published_at": "2024-03-12T20:08:30.878+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:30.878+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "e7x9KwfLRPmJgn6Vgl_E1g",
"stage": null
}
},
{
"id": "Bmrj1Q_DT-y0HvdAEzzsug",
"type": "item",
"attributes": {
"name": "The End of the World"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:30.638+00:00",
"updated_at": "2024-03-12T20:08:30.663+00:00",
"published_at": "2024-03-12T20:08:30.715+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:30.715+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "FcT-R4rdRJW9Q4VB16lcpA",
"stage": null
}
},
{
"id": "SgdmhG1hRGm_nCUfzUOVyA",
"type": "item",
"attributes": {
"name": "We Built This City"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:30.636+00:00",
"updated_at": "2024-03-12T20:08:30.663+00:00",
"published_at": "2024-03-12T20:08:30.898+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:30.898+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "LLxY-PY0RhaFxMb91SvRfQ",
"stage": null
}
},
{
"id": "QNVucI-QTXOW28BI_BODEw",
"type": "item",
"attributes": {
"name": "Someday"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:30.617+00:00",
"updated_at": "2024-03-12T20:08:30.645+00:00",
"published_at": "2024-03-12T20:08:30.726+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:30.726+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "ddNw2_qDQWu34BrBt8vgZg",
"stage": null
}
},
{
"id": "L5cEb4ABQ86F09KMnvmZHA",
"type": "item",
"attributes": {
"name": "Vision of Love"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:30.625+00:00",
"updated_at": "2024-03-12T20:08:30.643+00:00",
"published_at": "2024-03-12T20:08:30.726+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:30.726+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "O1AIxobDR_SY1iDgLIKrXg",
"stage": null
}
},
{
"id": "SDt2EmrzQr-KKS0lQKfQug",
"type": "item",
"attributes": {
"name": "We Found Love"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:30.611+00:00",
"updated_at": "2024-03-12T20:08:30.625+00:00",
"published_at": "2024-03-12T20:08:30.723+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:30.723+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "HtywHW7aSXiqY8yOrn8MNQ",
"stage": null
}
},
{
"id": "JHCg3GESTBCp9D6UHz9UyQ",
"type": "item",
"attributes": {
"name": "I'll Walk Alone"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:30.601+00:00",
"updated_at": "2024-03-12T20:08:30.616+00:00",
"published_at": "2024-03-12T20:08:30.698+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:30.698+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "GRt_lHV6Slqnja3nyCFwlA",
"stage": null
}
},
{
"id": "LRltshTASSyT5S-XcLp3AQ",
"type": "item",
"attributes": {
"name": "Like a Prayer"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:30.576+00:00",
"updated_at": "2024-03-12T20:08:30.582+00:00",
"published_at": "2024-03-12T20:08:30.607+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:30.607+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "aHKqe8epQX60p_T2UdeCGQ",
"stage": null
}
},
{
"id": "JujCZAUxSZKMgq2GoU6-0A",
"type": "item",
"attributes": {
"name": "Unbelievable"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:30.564+00:00",
"updated_at": "2024-03-12T20:08:30.572+00:00",
"published_at": "2024-03-12T20:08:30.600+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:30.600+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "ZHKL6ZzdTCeKe-fjakChiA",
"stage": null
}
},
{
"id": "PFrB-unuQ2CV48tqaxHRCg",
"type": "item",
"attributes": {
"name": "Too Close"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:30.564+00:00",
"updated_at": "2024-03-12T20:08:30.571+00:00",
"published_at": "2024-03-12T20:08:30.595+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:30.595+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "IxNPJWfuQGCk35HsB5PRqw",
"stage": null
}
}
],
"meta": {
"total_count": 264
}
}

To fetch a specific page, you can use the page object in the query params together with its offset and limit parameters. They will still be from any model in your project.

To get 2 records starting from position 4, we should use: ?page[limit]=2page[offset]=3 (because record counting starts from 0)

GET https://site-api.datocms.com/items?page[limit]=2page[offset]=3 HTTP/1.1
Authorization: Bearer YOUR-API-TOKEN
Accept: application/json
X-Api-Version: 3

To get 2 records starting from position 4, we should use: ?page[limit]=2page[offset]=3 (because record counting starts from 0)

Terminal window
curl -g 'https://site-api.datocms.com/items?page[limit]=2page[offset]=3' \
\
-H "Authorization: Bearer YOUR-API-TOKEN" \
-H "Accept: application/json" \
-H "X-Api-Version: 3"

To get 2 records starting from position 4, we should use: ?page[limit]=2page[offset]=3 (because record counting starts from 0)

await fetch("https://site-api.datocms.com/items?page[limit]=2page[offset]=3", {
headers: {
Authorization: "Bearer YOUR-API-TOKEN",
Accept: "application/json",
"X-Api-Version": "3",
},
});
HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: cache-control: max-age=0, private, must-revalidate
X-RateLimit-Limit: 30
X-RateLimit-Remaining: 28
{
"data": [
{
"id": "VDd0Ig2WTZukQ8DU9ZskXg",
"type": "item",
"attributes": {
"name": "Shout"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:33.887+00:00",
"updated_at": "2024-03-12T20:08:33.895+00:00",
"published_at": "2024-03-12T20:08:33.945+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:33.945+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "LPlwzflrSYyH4FQhCubRgQ",
"stage": null
}
},
{
"id": "fPW3GwaCTAaCfHWr9C1RrQ",
"type": "item",
"attributes": {
"name": "Coming Up"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:33.841+00:00",
"updated_at": "2024-03-12T20:08:33.850+00:00",
"published_at": "2024-03-12T20:08:33.882+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:33.882+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "IiCnty-tSdGnvBUZPd_g4A",
"stage": null
}
}
],
"meta": {
"total_count": 264
}
}

You can retrieve a list of records (or blocks) by their record IDs. They can be from the same or different models.

Filtering by 2 specific record IDs, across different models (one dog record, and one song record). Note that filter[ids] must be comma-separated, with no spaces.

GET https://site-api.datocms.com/items?filter[ids]=QHr0FFO0Ro6DtNBrFCwV0A,cSp-WX-_R7m_r_hG0D0Ekg HTTP/1.1
Authorization: Bearer YOUR-API-TOKEN
Accept: application/json
X-Api-Version: 3

Filtering by 2 specific record IDs, across different models (one dog record, and one song record). Note that filter[ids] must be comma-separated, with no spaces.

Terminal window
curl -g 'https://site-api.datocms.com/items?filter[ids]=QHr0FFO0Ro6DtNBrFCwV0A,cSp-WX-_R7m_r_hG0D0Ekg' \
\
-H "Authorization: Bearer YOUR-API-TOKEN" \
-H "Accept: application/json" \
-H "X-Api-Version: 3"

Filtering by 2 specific record IDs, across different models (one dog record, and one song record). Note that filter[ids] must be comma-separated, with no spaces.

await fetch(
"https://site-api.datocms.com/items?filter[ids]=QHr0FFO0Ro6DtNBrFCwV0A,cSp-WX-_R7m_r_hG0D0Ekg",
{
headers: {
Authorization: "Bearer YOUR-API-TOKEN",
Accept: "application/json",
"X-Api-Version": "3",
},
},
);

Showing two records from different models: dog and song. The returned record order is random, not the order of the record IDs you specified.

HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: cache-control: max-age=0, private, must-revalidate
X-RateLimit-Limit: 30
X-RateLimit-Remaining: 28
{
"data": [
{
"id": "cSp-WX-_R7m_r_hG0D0Ekg",
"type": "item",
"attributes": {
"name": "One of Us"
},
"relationships": {
"item_type": {
"data": {
"id": "ZHiqi1KiTAuLf8GFN4k1Hg",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "254268",
"type": "access_token"
}
}
},
"meta": {
"created_at": "2024-03-12T20:08:33.743+00:00",
"updated_at": "2024-03-12T20:08:33.755+00:00",
"published_at": "2024-03-12T20:08:34.240+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T20:08:34.240+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "SjWxQjSCRy-g_B7t1GcnPw",
"stage": null
}
},
{
"id": "QHr0FFO0Ro6DtNBrFCwV0A",
"type": "item",
"attributes": {
"name": "Maji",
"breed": "mixed"
},
"relationships": {
"item_type": {
"data": {
"id": "MtzQYUvbS-S0LM2LZ5QlkQ",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "104280",
"type": "account"
}
}
},
"meta": {
"created_at": "2024-01-26T20:24:36.462+00:00",
"updated_at": "2024-01-26T20:24:36.618+00:00",
"published_at": "2024-01-26T20:24:36.779+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-01-26T20:24:36.779+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "YmES_iXOT3GguMQXoFZcWw",
"stage": null
}
}
],
"meta": {
"total_count": 2
}
}

You can filter the records by one or more model types. You can use either the model's api_key (that you define) or its unique ID (generated by DatoCMS). Multiple comma-separated values are accepted:

Filtering by the model with api_key cat and the model with ID of dog:

GET https://site-api.datocms.com/items?filter[type]=cat,MtzQYUvbS-S0LM2LZ5QlkQ HTTP/1.1
Authorization: Bearer YOUR-API-TOKEN
Accept: application/json
X-Api-Version: 3

Filtering by the model with api_key cat and the model with ID of dog:

Terminal window
curl -g 'https://site-api.datocms.com/items?filter[type]=cat,MtzQYUvbS-S0LM2LZ5QlkQ' \
\
-H "Authorization: Bearer YOUR-API-TOKEN" \
-H "Accept: application/json" \
-H "X-Api-Version: 3"

Filtering by the model with api_key cat and the model with ID of dog:

await fetch(
"https://site-api.datocms.com/items?filter[type]=cat,MtzQYUvbS-S0LM2LZ5QlkQ",
{
headers: {
Authorization: "Bearer YOUR-API-TOKEN",
Accept: "application/json",
"X-Api-Version": "3",
},
},
);
HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: cache-control: max-age=0, private, must-revalidate
X-RateLimit-Limit: 30
X-RateLimit-Remaining: 28
{
"data": [
{
"id": "QHr0FFO0Ro6DtNBrFCwV0A",
"type": "item",
"attributes": {
"name": "Maji",
"breed": "mixed"
},
"relationships": {
"item_type": {
"data": {
"id": "MtzQYUvbS-S0LM2LZ5QlkQ",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "104280",
"type": "account"
}
}
},
"meta": {
"created_at": "2024-01-26T20:24:36.462+00:00",
"updated_at": "2024-01-26T20:24:36.618+00:00",
"published_at": "2024-01-26T20:24:36.779+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-01-26T20:24:36.779+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "YmES_iXOT3GguMQXoFZcWw",
"stage": null
}
},
{
"id": "RGLUGlQiTKiAQuB3D9C_1g",
"type": "item",
"attributes": {
"name": "Higgins",
"breed": "hovawart"
},
"relationships": {
"item_type": {
"data": {
"id": "MtzQYUvbS-S0LM2LZ5QlkQ",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "104280",
"type": "account"
}
}
},
"meta": {
"created_at": "2024-01-26T20:23:49.239+00:00",
"updated_at": "2024-01-26T20:23:49.247+00:00",
"published_at": "2024-01-26T20:23:49.267+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-01-26T20:23:49.267+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "WvWbSB9iQfG8o2mg_f5K5A",
"stage": null
}
}
],
"meta": {
"total_count": 2
}
}

Within a specified model, you can further filter its records by their field values.

You must specify a single model using filter[type]. You cannot filter by field value across multiple models at once.

Valid filters are documented at GraphQL API records filters, so please check there. However, you cannot use deep filtering on Modular Content and Structured Text fields at the moment.

  • You may add an optional locale parameter if you are filtering by a localized field.
  • You may add an optional order_by parameter.

In this example, we are filtering the model dog by:

  • A single-line string field, name in ['Buddy','Rex'] (matching Buddy OR Rex)
  • A single-line string field, breed eq 'mixed' (matching exactly mixed)
  • A date field (_updated_at) (and ordering the results by the same)

Note the special handling of the in filter for the name field. Instead of a comma-separated string, it's two separate [fields][name][in][] parameters.

GET https://site-api.datocms.com/items?filter[type]=dog&filter[fields][name][in][]=Buddy&filter[fields][name][in][]=Rex&filter[fields][breed][eq]=mixed&filter[fields][_updated_at][gt]=2020-04-18T00:00:00&order_by=_updated_at_ASC HTTP/1.1
Authorization: Bearer YOUR-API-TOKEN
Accept: application/json
X-Api-Version: 3

Note the special handling of the in filter for the name field. Instead of a comma-separated string, it's two separate [fields][name][in][] parameters.

Terminal window
curl -g 'https://site-api.datocms.com/items?filter[type]=dog&filter[fields][name][in][]=Buddy&filter[fields][name][in][]=Rex&filter[fields][breed][eq]=mixed&filter[fields][_updated_at][gt]=2020-04-18T00:00:00&order_by=_updated_at_ASC' \
\
-H "Authorization: Bearer YOUR-API-TOKEN" \
-H "Accept: application/json" \
-H "X-Api-Version: 3"

Note the special handling of the in filter for the name field. Instead of a comma-separated string, it's two separate [fields][name][in][] parameters.

await fetch(
"https://site-api.datocms.com/items?filter[type]=dog&filter[fields][name][in][]=Buddy&filter[fields][name][in][]=Rex&filter[fields][breed][eq]=mixed&filter[fields][_updated_at][gt]=2020-04-18T00:00:00&order_by=_updated_at_ASC",
{
headers: {
Authorization: "Bearer YOUR-API-TOKEN",
Accept: "application/json",
"X-Api-Version": "3",
},
},
);
HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: cache-control: max-age=0, private, must-revalidate
X-RateLimit-Limit: 30
X-RateLimit-Remaining: 28
{
"data": [
{
"id": "EA4kSeoVQqKSR88cVq2kqQ",
"type": "item",
"attributes": {
"name": "Rex",
"breed": "mixed"
},
"relationships": {
"item_type": {
"data": {
"id": "MtzQYUvbS-S0LM2LZ5QlkQ",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "104280",
"type": "account"
}
}
},
"meta": {
"created_at": "2024-03-12T22:30:44.137+00:00",
"updated_at": "2024-03-12T22:30:44.146+00:00",
"published_at": "2024-03-12T22:30:44.178+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-12T22:30:44.178+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "QIjEZ8glRkix0gt9uz0Pfg",
"stage": null
}
},
{
"id": "B1E0yYBORgmRpa_oK5LrOw",
"type": "item",
"attributes": {
"name": "Buddy",
"breed": "mixed"
},
"relationships": {
"item_type": {
"data": {
"id": "MtzQYUvbS-S0LM2LZ5QlkQ",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "104280",
"type": "account"
}
}
},
"meta": {
"created_at": "2024-01-30T00:11:04.310+00:00",
"updated_at": "2024-03-12T22:31:26.455+00:00",
"published_at": "2024-03-12T22:31:26.491+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-01-30T00:11:04.340+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "KhshsDnyRVi3aMzBBs7QMQ",
"stage": null
}
}
],
"meta": {
"total_count": 2
}
}

You can retrieve a list of records filtered by a textual query match. It will search in block records content too. Set the nested parameter to true to retrieve embedded block content as well.

You can narrow your search to some models by specifying the field[type] attribute. You can use either the model's api_key or its unique ID. Multiple comma-separated values are accepted.

You should specify the locale attribute, or it use the environment's default locale.

Returned records are ordered by rank.

GET https://site-api.datocms.com/items?filter[type]=dog,cat&filter[query]=chicken&locale=en&order_by=_rank_DESC HTTP/1.1
Authorization: Bearer YOUR-API-TOKEN
Accept: application/json
X-Api-Version: 3
Terminal window
curl -g 'https://site-api.datocms.com/items?filter[type]=dog,cat&filter[query]=chicken&locale=en&order_by=_rank_DESC' \
\
-H "Authorization: Bearer YOUR-API-TOKEN" \
-H "Accept: application/json" \
-H "X-Api-Version: 3"
await fetch(
"https://site-api.datocms.com/items?filter[type]=dog,cat&filter[query]=chicken&locale=en&order_by=_rank_DESC",
{
headers: {
Authorization: "Bearer YOUR-API-TOKEN",
Accept: "application/json",
"X-Api-Version": "3",
},
},
);
HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: cache-control: max-age=0, private, must-revalidate
X-RateLimit-Limit: 30
X-RateLimit-Remaining: 28
{
"data": [
{
"id": "B1E0yYBORgmRpa_oK5LrOw",
"type": "item",
"attributes": {
"name": "Buddy",
"breed": "mixed",
"description": "Buddy loves chicken. Just make sure it's cooked and doesn't have any seasonings or bones!"
},
"relationships": {
"item_type": {
"data": {
"id": "MtzQYUvbS-S0LM2LZ5QlkQ",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "104280",
"type": "account"
}
}
},
"meta": {
"created_at": "2024-01-30T00:11:04.310+00:00",
"updated_at": "2024-03-12T22:31:26.455+00:00",
"published_at": "2024-03-12T22:31:26.491+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-01-30T00:11:04.340+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "KhshsDnyRVi3aMzBBs7QMQ",
"stage": null
}
},
{
"id": "c89tCUarTvGKxA37acCEWA",
"type": "item",
"attributes": {
"name": "Sheriff",
"breed": "domestic_longhair",
"description": "Sheriff loves salmon, sweet potatoes and chicken."
},
"relationships": {
"item_type": {
"data": {
"id": "JwCG35JtS_y92WZoOq1Ujw",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "104280",
"type": "account"
}
}
},
"meta": {
"created_at": "2024-01-26T20:23:31.721+00:00",
"updated_at": "2024-01-30T00:24:16.370+00:00",
"published_at": "2024-01-30T00:24:16.393+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-01-26T20:23:31.752+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "Uh_nr0kWRZy54W91MWrdLg",
"stage": null
}
}
],
"meta": {
"total_count": 2
}
}

Sometimes, you may wish to fetch a record that has embedded blocks inside Structured Text or Modular Content fields.

By default, we would return those nested blocks as references, like:

[
{
"item": "ahxSnFQEQ02K3TjttWAg-Q", "type": "block"
},
{
"item": "AppHB06oRBm-er3oooL_LA", "type": "block"
}
]

But if you add the nested=true query parameter, we'll embed the block content inline for you.

When nested=true, the maximum records you can request at once is limited to 30, compared to the usual 500.

GET https://site-api.datocms.com/items?filter[ids]=FEzWmQhjQgeHsCrUtvlEMw&nested=true HTTP/1.1
Authorization: Bearer YOUR-API-TOKEN
Accept: application/json
X-Api-Version: 3
Terminal window
curl -g 'https://site-api.datocms.com/items?filter[ids]=FEzWmQhjQgeHsCrUtvlEMw&nested=true' \
\
-H "Authorization: Bearer YOUR-API-TOKEN" \
-H "Accept: application/json" \
-H "X-Api-Version: 3"
await fetch(
"https://site-api.datocms.com/items?filter[ids]=FEzWmQhjQgeHsCrUtvlEMw&nested=true",
{
headers: {
Authorization: "Bearer YOUR-API-TOKEN",
Accept: "application/json",
"X-Api-Version": "3",
},
},
);
HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: cache-control: max-age=0, private, must-revalidate
X-RateLimit-Limit: 30
X-RateLimit-Remaining: 28
{
"data": [
{
"id": "FEzWmQhjQgeHsCrUtvlEMw",
"type": "item",
"attributes": {
"structured_text_field": {
"schema": "dast",
"document": {
"children": [
{
"item": {
"type": "item",
"attributes": {
"button_label": "Example button",
"button_url": "https://www.example.com"
},
"relationships": {
"item_type": {
"data": {
"id": "SkVjHJSGR5CyK16E8TfJxg",
"type": "item_type"
}
}
},
"id": "ahxSnFQEQ02K3TjttWAg-Q"
},
"type": "block"
},
{
"item": {
"type": "item",
"attributes": {
"nested_structured_text_field": {
"schema": "dast",
"document": {
"children": [
{
"children": [
{
"type": "span",
"value": "This is a "
},
{
"marks": ["emphasis"],
"type": "span",
"value": "nested"
},
{
"type": "span",
"value": " structured text block inside the parent structured text field."
}
],
"type": "paragraph"
},
{
"item": {
"type": "item",
"attributes": {
"button_label": "And this is a button inside the nested structured text block",
"button_url": "https://www.example2.com"
},
"relationships": {
"item_type": {
"data": {
"id": "SkVjHJSGR5CyK16E8TfJxg",
"type": "item_type"
}
}
},
"id": "CGqwjPDsTHKGFy1IbC0RAQ"
},
"type": "block"
}
],
"type": "root"
}
}
},
"relationships": {
"item_type": {
"data": {
"id": "Ty4S40cbQH6_VMNnGdd9KA",
"type": "item_type"
}
}
},
"id": "AppHB06oRBm-er3oooL_LA"
},
"type": "block"
}
],
"type": "root"
}
}
},
"relationships": {
"item_type": {
"data": {
"id": "UVa_hHEBSeefLEUnwoQFig",
"type": "item_type"
}
},
"creator": {
"data": {
"id": "104280",
"type": "account"
}
}
},
"meta": {
"created_at": "2024-03-13T17:01:19.243+00:00",
"updated_at": "2024-03-13T17:14:17.444+00:00",
"published_at": "2024-03-13T17:14:17.597+00:00",
"publication_scheduled_at": null,
"unpublishing_scheduled_at": null,
"first_published_at": "2024-03-13T17:01:19.326+00:00",
"is_valid": true,
"is_current_version_valid": true,
"is_published_version_valid": true,
"status": "published",
"current_version": "DLtyHZ2MTDqYMg7g5mgYEw",
"stage": null
}
}
],
"meta": {
"total_count": 1
}
}