younifyd
Menu

Update Content Versions

Update Multiple Content Versions

PATCH/versions

Use it in a workflow

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

Request

Query parameters

fieldsarray<string>

Control what fields are being returned in the object.

limitinteger

A limit on the number of objects that are returned.

metastring

What metadata to return in the response.

offsetinteger

How many items to skip when fetching data.

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.

Request body

Enter the body as JSON in the step's Body field.

dataoneOfrequired
keysarray<string>required
json
{
  "data": null,
  "keys": [
    "string"
  ]
}

Response

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

dataarray<object>
idstring

Primary key of the Content Version.

keystring

Key of the Content Version, used as the value for the "version" query parameter.

namestring

Descriptive name of the Content Version.

collectionstring

Name of the collection the Content Version is created on.

itemstring

The item the Content Version is created on. Many-to-one to items.

hashstring
date_createdstring (date-time)

When the Content Version was created.

date_updatedstring (date-time)

When the Content Version was updated.

user_createdstring

User that created the Content Version. Many-to-one to users.

user_updatedstring

User that updated the Content Version. Many-to-one to users.

deltaobject

The current changes compared to the main version of the item.

metaobject
total_countinteger

Returns the total item count of the collection you're querying.

filter_countinteger

Returns the item count of the collection you're querying, taking the current filter/search parameters into account.

json
{
  "data": [
    {
      "id": "63716273-0f29-4648-8a2a-2af2948f6f78",
      "key": "draft",
      "name": "My Draft",
      "collection": "articles",
      "item": "168",
      "hash": "string",
      "date_created": "2022-05-11T13:14:52Z",
      "date_updated": "2022-05-11T13:14:53Z",
      "user_created": "63716273-0f29-4648-8a2a-2af2948f6f78",
      "user_updated": "63716273-0f29-4648-8a2a-2af2948f6f78",
      "delta": {}
    }
  ],
  "meta": {
    "total_count": 0,
    "filter_count": 0
  }
}

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

Was this page helpful?