younifyd
Menu

Get Collection Items

List Items in a Collection

GET/items/{collection}

Use it in a workflow

  1. Add a step and choose the Directus connector.
  2. Pick the Get Collection Items action (under Items).
  3. Fill in the fields below, then reference the result from later steps as {{getCollectionItems.response.data}}.

Request

Path parameters

collectionstringrequired

Unique identifier of the collection the item resides in.

Query parameters

fieldsarray<string>

Control what fields are being returned in the object.

limitinteger

A limit on the number of objects that are returned.

offsetinteger

How many items to skip when fetching data.

pageinteger

Cursor for use in pagination. Often used in combination with limit.

metastring

What metadata to return in the response.

sortarray<string>

How to sort the returned items. `sort` is a CSV of fields used to sort the fetched items. Sorting defaults to ascending (ASC) order but a minus sign (` - `) can be used to reverse this to descending (DESC) order. Fields are prioritized by their order in the CSV.

filterany

Select items in collection by given conditions.

searchstring

Filter by items that contain the given search query in one of their fields.

exportstring

Saves the API response to a file. Accepts one of `csv`, `csv_utf8`, `json`, `xml`, `yaml`.

One ofcsvcsv_utf8jsonxmlyaml

versionstring

Retrieve an item's state from a specific Content Version. The value corresponds to the "key" of the Content Version.

versionRawboolean

Retrieve the raw delta of a Content Version item instead of the full merged item.

Default false

backlinkboolean

Retrieve relational items excluding reverse relations when using wildcard fields.

Default true

aggregateany

Aggregate functions allow you to perform calculations on a set of values. Accepts one or more of `count`, `countDistinct`, `countAll`, `sum`, `sumDistinct`, `avg`, `avgDistinct`, `min`, `max`.

grouparray<string>

Grouping allows for running the aggregation functions based on a shared value. Accepts an array of field names.

deepany

Deep allows you to set any of the other query parameters on a nested relational dataset. Use underscore-prefixed parameter names.

aliasany

Alias allows you to rename fields in the response payload. The key is the new name, the value is the original field name.

Response

Returns 200 with an object. Read it in later steps with {{getCollectionItems.response.data.<field>}}.

dataarray<object>
json
{
  "data": [
    {}
  ]
}

Need more? See the Directus guide for connection setup and behaviour shared by every action.

Get Collection Items — Directus — Documentation