younifyd
Menu

Update Comments

Update Multiple comments

PATCH/comments

Use it in a workflow

  1. Add a step and choose the Directus connector.
  2. Pick the Update Comments action (under Comments).
  3. Fill in the fields below, then reference the result from later steps as {{updateComments.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.

dataobject
collectionstring

Collection identifier in which the item resides.

idstring (uuid)

Unique identifier for the object.

itemstring

The item the comment is created for.

commentstring

User comment. This will store the comments that show up in the right sidebar of the item edit page in the Data Studio.

date_createdstring (date-time)

Timestamp in ISO8601 when the comment was created.

date_updatedstring (date-time)

Timestamp in ISO8601 when the comment was last updated.

user_createdstring

The user who created the comment. Many-to-one to users.

user_updatedstring

The user who last updated the comment. Many-to-one to users.

keysarray<string>
json
{
  "data": {
    "collection": "articles",
    "id": "2fab3b9d-0543-4b87-8a30-3c5ee66fedf1",
    "item": 15,
    "comment": "This is a comment on an article",
    "date_created": "2023-01-15T09:14:52Z",
    "date_updated": "2023-01-15T09:00:00Z",
    "user_created": "12e62fd0-29c7-4fd3-b3d3-c7a39933e8af",
    "user_updated": "12e62fd0-29c7-4fd3-b3d3-c7a39933e8af"
  },
  "keys": [
    "string"
  ]
}

Response

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

dataarray<object>
collectionstring

Collection identifier in which the item resides.

idstring (uuid)

Unique identifier for the object.

itemstring

The item the comment is created for.

commentstring

User comment. This will store the comments that show up in the right sidebar of the item edit page in the Data Studio.

date_createdstring (date-time)

Timestamp in ISO8601 when the comment was created.

date_updatedstring (date-time)

Timestamp in ISO8601 when the comment was last updated.

user_createdstring

The user who created the comment. Many-to-one to users.

user_updatedstring

The user who last updated the comment. Many-to-one to users.

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": [
    {
      "collection": "articles",
      "id": "2fab3b9d-0543-4b87-8a30-3c5ee66fedf1",
      "item": 15,
      "comment": "This is a comment on an article",
      "date_created": "2023-01-15T09:14:52Z",
      "date_updated": "2023-01-15T09:00:00Z",
      "user_created": "12e62fd0-29c7-4fd3-b3d3-c7a39933e8af",
      "user_updated": "12e62fd0-29c7-4fd3-b3d3-c7a39933e8af"
    }
  ],
  "meta": {
    "total_count": 0,
    "filter_count": 0
  }
}

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